diff --git a/examples/cdk/lambda-http/cdk.json b/examples/cdk/lambda-http/cdk.json deleted file mode 100644 index 4322301..0000000 --- a/examples/cdk/lambda-http/cdk.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "app": "go mod download && go run app-serverless-cdk-go.go", - "context": { - "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true, - "aws-cdk:enableDiffNoFail": "true", - "@aws-cdk/core:stackRelativeExports": "true", - "@aws-cdk/aws-ecr-assets:dockerIgnoreSupport": true, - "@aws-cdk/aws-secretsmanager:parseOwnedSecretName": true, - "@aws-cdk/aws-kms:defaultKeyPolicies": true, - "@aws-cdk/aws-s3:grantWriteWithoutAcl": true, - "@aws-cdk/aws-ecs-patterns:removeDefaultDesiredCount": true, - "@aws-cdk/aws-rds:lowercaseDbIdentifier": true, - "@aws-cdk/aws-efs:defaultEncryptionAtRest": true, - "@aws-cdk/aws-lambda:recognizeVersionProps": true, - "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": true - } -} \ No newline at end of file diff --git a/examples/cdk/lambda-http/cdkapp.go b/examples/cdk/lambda-http/cdkapp.go deleted file mode 100644 index 24afb30..0000000 --- a/examples/cdk/lambda-http/cdkapp.go +++ /dev/null @@ -1,68 +0,0 @@ -package main - -import ( - "github.com/aws/aws-cdk-go/awscdk/v2" - "github.com/aws/aws-cdk-go/awscdk/v2/awslambda" - "github.com/aws/aws-cdk-go/awscdkapigatewayv2alpha/v2" - "github.com/aws/aws-cdk-go/awscdkapigatewayv2integrationsalpha/v2" - "github.com/aws/aws-cdk-go/awscdklambdagoalpha/v2" - "github.com/aws/constructs-go/constructs/v10" - "github.com/aws/jsii-runtime-go" -) - -type LambdaDynamodbStackProps struct { - awscdk.StackProps -} - -func NewLambdaDynamodbStack(scope constructs.Construct, id string, props *LambdaDynamodbStackProps) awscdk.Stack { - var sprops awscdk.StackProps - if props != nil { - sprops = props.StackProps - } - stack := awscdk.NewStack(scope, &id, &sprops) - - // create Lambda function - getHandler := awscdklambdagoalpha.NewGoFunction(stack, jsii.String("myGoHandler"), &awscdklambdagoalpha.GoFunctionProps{ - Runtime: awslambda.Runtime_GO_1_X(), - Entry: jsii.String("./lambda-handler"), - Bundling: &awscdklambdagoalpha.BundlingOptions{ - GoBuildFlags: jsii.Strings(`-ldflags "-s -w"`), - }, - }) - - // create HTTP API - httpApi := awscdkapigatewayv2alpha.NewHttpApi(stack, jsii.String("myHttpApi"), &awscdkapigatewayv2alpha.HttpApiProps{ - ApiName: jsii.String("myHttpApi"), - }) - - // add route to HTTP API - httpApi.AddRoutes(&awscdkapigatewayv2alpha.AddRoutesOptions{ - Path: jsii.String("/"), - Methods: &[]awscdkapigatewayv2alpha.HttpMethod{awscdkapigatewayv2alpha.HttpMethod_GET}, - Integration: awscdkapigatewayv2integrationsalpha.NewHttpLambdaIntegration(jsii.String("MyHttpLambdaIntegration"), getHandler, &awscdkapigatewayv2integrationsalpha.HttpLambdaIntegrationProps{}), - }) - - // log HTTP API endpoint - awscdk.NewCfnOutput(stack, jsii.String("myHttpApiEndpoint"), &awscdk.CfnOutputProps{ - Value: httpApi.ApiEndpoint(), - Description: jsii.String("HTTP API Endpoint"), - }) - - return stack -} - -func main() { - app := awscdk.NewApp(nil) - - NewLambdaDynamodbStack(app, "LambdaDynamodbStack", &LambdaDynamodbStackProps{ - awscdk.StackProps{ - Env: env(), - }, - }) - - app.Synth(nil) -} - -func env() *awscdk.Environment { - return nil -} diff --git a/examples/cdk/lambda-http/go.mod b/examples/cdk/lambda-http/go.mod deleted file mode 100644 index ff0a343..0000000 --- a/examples/cdk/lambda-http/go.mod +++ /dev/null @@ -1,11 +0,0 @@ -module app-serverless-cdk-go - -go 1.16 - -require ( - github.com/aws/aws-cdk-go/awscdk/v2 v2.38.1 - github.com/aws/aws-cdk-go/awscdklambdagoalpha/v2 v2.38.1-alpha.0 - github.com/aws/aws-lambda-go v1.34.1 - github.com/aws/constructs-go/constructs/v10 v10.1.75 - github.com/aws/jsii-runtime-go v1.64.0 -) diff --git a/examples/cdk/lambda-http/go.sum b/examples/cdk/lambda-http/go.sum deleted file mode 100644 index 82cdc62..0000000 --- a/examples/cdk/lambda-http/go.sum +++ /dev/null @@ -1,29 +0,0 @@ -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/aws/aws-cdk-go/awscdk/v2 v2.38.1 h1:5Jz4KkHMa0MS4uLQO8X32cuyHxRY8YOOWyFCJRFpfWE= -github.com/aws/aws-cdk-go/awscdk/v2 v2.38.1/go.mod h1:rNrZ+WbqCuPfpUrMcDmrEOel9ZlMCy2+E0iyNCJjS+4= -github.com/aws/aws-cdk-go/awscdklambdagoalpha/v2 v2.38.1-alpha.0 h1:2jzLmMmDwU4S39xtoQUZY0lgJC9vX02irHSOH1UVQOo= -github.com/aws/aws-cdk-go/awscdklambdagoalpha/v2 v2.38.1-alpha.0/go.mod h1:v6VTA3UXMCi//sLAoI4xz2dpPtw1MSnDCjG5cbRNIlY= -github.com/aws/aws-lambda-go v1.34.1 h1:M3a/uFYBjii+tDcOJ0wL/WyFi2550FHoECdPf27zvOs= -github.com/aws/aws-lambda-go v1.34.1/go.mod h1:jwFe2KmMsHmffA1X2R09hH6lFzJQxzI8qK17ewzbQMM= -github.com/aws/constructs-go/constructs/v10 v10.1.71/go.mod h1:nJzXC/q76n0XkbL76eG0OvJQwbD/lWc7sjerJEARubA= -github.com/aws/constructs-go/constructs/v10 v10.1.75 h1:9EquUmnQukoWmx+3uWtpWSeTuRVByjqS6GLDEoR62x0= -github.com/aws/constructs-go/constructs/v10 v10.1.75/go.mod h1:SqKMUVAlGEmcw+6dzpqhMyc76I6hqDKDJh/roKipeNU= -github.com/aws/jsii-runtime-go v1.63.2/go.mod h1:Dq2QkYFSpiHGabsCBMmLnnGkyx3lnf5k6C6fq8RN/90= -github.com/aws/jsii-runtime-go v1.64.0 h1:B0OuI1is3nl+NwxBGfUPHYA6Z4fhYaBrv15gCjVXOCU= -github.com/aws/jsii-runtime-go v1.64.0/go.mod h1:Dq2QkYFSpiHGabsCBMmLnnGkyx3lnf5k6C6fq8RN/90= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= \ No newline at end of file diff --git a/examples/cdk/lambda-http/lambda-handler/go.mod b/examples/cdk/lambda-http/lambda-handler/go.mod deleted file mode 100644 index 560e0cd..0000000 --- a/examples/cdk/lambda-http/lambda-handler/go.mod +++ /dev/null @@ -1,23 +0,0 @@ -module lambda-handler - -go 1.20 - -require ( - github.com/aws/aws-lambda-go v1.41.0 - github.com/awslabs/aws-lambda-go-api-proxy v0.16.0 - github.com/gofiber/fiber/v2 v2.50.0 -) - -require ( - github.com/andybalholm/brotli v1.0.5 // indirect - github.com/google/uuid v1.3.1 // indirect - github.com/klauspost/compress v1.16.7 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/uniseg v0.2.0 // indirect - github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.50.0 // indirect - github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.13.0 // indirect -) diff --git a/examples/cdk/lambda-http/lambda-handler/go.sum b/examples/cdk/lambda-http/lambda-handler/go.sum deleted file mode 100644 index f9f06aa..0000000 --- a/examples/cdk/lambda-http/lambda-handler/go.sum +++ /dev/null @@ -1,35 +0,0 @@ -github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= -github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/aws/aws-lambda-go v1.41.0 h1:l/5fyVb6Ud9uYd411xdHZzSf2n86TakxzpvIoz7l+3Y= -github.com/aws/aws-lambda-go v1.41.0/go.mod h1:jwFe2KmMsHmffA1X2R09hH6lFzJQxzI8qK17ewzbQMM= -github.com/awslabs/aws-lambda-go-api-proxy v0.16.0 h1:7bVD5nk2sA6RQnBUlrZBz88T9GxYl+ycRez/zAWBApo= -github.com/awslabs/aws-lambda-go-api-proxy v0.16.0/go.mod h1:DPHlODrQDzpZ5IGRueOmrXthxReqhHHIAnHpI2nsaTw= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/gofiber/fiber/v2 v2.50.0 h1:ia0JaB+uw3GpNSCR5nvC5dsaxXjRU5OEu36aytx+zGw= -github.com/gofiber/fiber/v2 v2.50.0/go.mod h1:21eytvay9Is7S6z+OgPi7c7n4++tnClWmhpimVHMimw= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= -github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M= -github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= -github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= -github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/examples/cdk/lambda-http/lambda-handler/main.go b/examples/cdk/lambda-http/lambda-handler/main.go deleted file mode 100644 index 1909fd8..0000000 --- a/examples/cdk/lambda-http/lambda-handler/main.go +++ /dev/null @@ -1,38 +0,0 @@ -// main.go -package main - -import ( - "context" - "fmt" - "os" - - "github.com/aws/aws-lambda-go/events" - "github.com/aws/aws-lambda-go/lambda" - fiberadapter "github.com/awslabs/aws-lambda-go-api-proxy/fiber" - "github.com/gofiber/fiber/v2" -) - -var fiberLambda *fiberadapter.FiberLambda - -// init the Fiber Server -func init() { - var app *fiber.App - app = fiber.New() - - app.Get("/", func(c *fiber.Ctx) error { - return c.SendString(fmt.Sprintf("Hello from Account: %s", os.Getenv("TELOPHASE_CUSTOMER"))) - }) - - fiberLambda = fiberadapter.New(app) -} - -// Handler will deal with Fiber working with Lambda -func Handler(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { - // If no name is provided in the HTTP request body, throw an error - return fiberLambda.ProxyWithContext(ctx, req) -} - -func main() { - // Make the handler available for Remote Procedure Call by AWS Lambda - lambda.Start(Handler) -}