Skip to content

Commit f833906

Browse files
authored
Adding Serverless + Golang + AL2 + CodeSee example (#2)
* Adding Serverless + Golang + AL2 example * update * resolve PR feedback
1 parent 7a269f0 commit f833906

File tree

11 files changed

+12079
-0
lines changed

11 files changed

+12079
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
./bin/bootstrap
2+
./bin/bootstrap.zip
13
.DS_Store
24

35
# Logs

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ This repo contains various example on how to integrate with CodeSee
55
`cdk-lambda-layer-example` - Show you example CDK to integrate with CodeSee Lambda Layer
66

77
`sst-cdk-lambda-layer-example` - Show you example Serverless Stack + CDK to integrate with CodeSee Lambda Layer
8+
9+
`serverless-al2-example` - Show you example Serverless + Golang + Amazon Linux 2 + CodeSee Lambda Layer

serverless-al2-example/Gopkg.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[[constraint]]
2+
name = "github.com/aws/aws-lambda-go"
3+
version = "1.x"

serverless-al2-example/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Serverless + Golang + Amazon Linux 2 (provided.al2) + CodeSee example
2+
3+
Using AL2 runtime + Datadog serverless plugin + CodeSee Layer Configured
4+
5+
## Installation:
6+
7+
```
8+
serverless plugin install --name serverless-plugin-datadog
9+
serverless plugin install --name serverless-go-plugin
10+
go get github.com/DataDog/datadog-lambda-go
11+
```
12+
13+
## Set required environment variables:
14+
15+
Make sure the following environment variables are set in your `serverless.yml` file.
16+
17+
```
18+
DD_APM_DD_URL: http://127.0.0.1:8080
19+
DD_APM_NON_LOCAL_TRAFFIC: true
20+
DD_APM_ENABLED: true
21+
CODESEE_BRIDGE_FORWARD_HOST: https://in-datadog.codesee.io
22+
CODESEE_BRIDGE_TOKEN: <YOUR_CODESEE_TOKEN>
23+
```
24+
25+
## Deploy
26+
```
27+
sls deploy --aws-profile <your-aws-profile> --region us-east-1
28+
```
29+
30+
## More info:
31+
32+
https://docs.codesee.io/docs/lambda-configuration-examples#serverless
20 MB
Binary file not shown.

serverless-al2-example/go.mod

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
module aws-golang-simple-http-endpoint
2+
3+
go 1.18
4+
5+
require github.com/aws/aws-lambda-go v1.34.1
6+
7+
require (
8+
github.com/DataDog/datadog-agent/pkg/obfuscate v0.41.1 // indirect
9+
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.42.0-rc.1 // indirect
10+
github.com/DataDog/datadog-go/v5 v5.2.0 // indirect
11+
github.com/DataDog/datadog-lambda-go v1.9.0 // indirect
12+
github.com/DataDog/go-tuf v0.3.0--fix-localmeta-fork // indirect
13+
github.com/DataDog/sketches-go v1.4.1 // indirect
14+
github.com/Microsoft/go-winio v0.5.2 // indirect
15+
github.com/andybalholm/brotli v1.0.4 // indirect
16+
github.com/aws/aws-sdk-go v1.44.168 // indirect
17+
github.com/aws/aws-sdk-go-v2 v1.17.3 // indirect
18+
github.com/aws/aws-sdk-go-v2/config v1.18.5 // indirect
19+
github.com/aws/aws-sdk-go-v2/credentials v1.13.5 // indirect
20+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.21 // indirect
21+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.27 // indirect
22+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.21 // indirect
23+
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.28 // indirect
24+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.21 // indirect
25+
github.com/aws/aws-sdk-go-v2/service/kms v1.19.2 // indirect
26+
github.com/aws/aws-sdk-go-v2/service/sso v1.11.27 // indirect
27+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.10 // indirect
28+
github.com/aws/aws-sdk-go-v2/service/sts v1.17.7 // indirect
29+
github.com/aws/aws-xray-sdk-go v1.8.0 // indirect
30+
github.com/aws/smithy-go v1.13.5 // indirect
31+
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
32+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
33+
github.com/dgraph-io/ristretto v0.1.0 // indirect
34+
github.com/dustin/go-humanize v1.0.0 // indirect
35+
github.com/golang/glog v1.0.0 // indirect
36+
github.com/golang/protobuf v1.5.2 // indirect
37+
github.com/google/uuid v1.3.0 // indirect
38+
github.com/jmespath/go-jmespath v0.4.0 // indirect
39+
github.com/klauspost/compress v1.15.13 // indirect
40+
github.com/philhofer/fwd v1.1.1 // indirect
41+
github.com/pkg/errors v0.9.1 // indirect
42+
github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect
43+
github.com/sony/gobreaker v0.5.0 // indirect
44+
github.com/tinylib/msgp v1.1.6 // indirect
45+
github.com/valyala/bytebufferpool v1.0.0 // indirect
46+
github.com/valyala/fasthttp v1.35.0 // indirect
47+
go.uber.org/atomic v1.10.0 // indirect
48+
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
49+
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 // indirect
50+
golang.org/x/net v0.7.0 // indirect
51+
golang.org/x/sys v0.5.0 // indirect
52+
golang.org/x/text v0.7.0 // indirect
53+
golang.org/x/time v0.3.0 // indirect
54+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
55+
google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f // indirect
56+
google.golang.org/grpc v1.45.0 // indirect
57+
google.golang.org/protobuf v1.28.0 // indirect
58+
gopkg.in/DataDog/dd-trace-go.v1 v1.48.0 // indirect
59+
inet.af/netaddr v0.0.0-20220617031823-097006376321 // indirect
60+
)

0 commit comments

Comments
 (0)