-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
31 lines (26 loc) · 662 Bytes
/
Copy pathmain.go
File metadata and controls
31 lines (26 loc) · 662 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/apigatewayv2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create lambda function that will return HTML.
lambda, err := CreateGoLambda(ctx)
if err != nil {
panic(err)
}
// Provision API Gateway instance to invoke Lambda
api, err := apigatewayv2.NewApi(ctx,
"serverless-parrot-demo-gov2",
&apigatewayv2.ApiArgs{
ProtocolType: pulumi.String("HTTP"),
RouteKey: pulumi.String("GET /"),
Target: lambda.InvokeArn,
},
nil,
)
ctx.Export("url", api.ApiEndpoint)
return nil
})
}