Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ With SCUD, you can deliver fast, secure, and maintainable serverless APIs withou
- [Container images](#container-images)
- [Universal Function](#universal-function)
- [Custom Go Environment](#custom-go-environment)
- [Logging](#logging)
- [Compressing binaries](#compressing-binaries)
- [API Gateway](#api-gateway)
- [Quick Start](#quick-start-1)
Expand Down Expand Up @@ -261,6 +262,13 @@ Default environment variables set by the library:
- `CGO_ENABLED=0`


### Logging

The L3 construct automatically creates a log group if one is not specified. It is recommended to define a single log group per application and reuse it across all Lambda functions.

> For example, you could use a single log group to store logs for all of the Lambda functions that make up a particular application.
- https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs-loggroups.html

### Compressing binaries

The L3 constuct uses the `-s` and `-w` linker flags by default to strip the debugging information from binaries. If you have [UPX](https://upx.github.io/) installed, you can enable binary compression by setting the `SCUD_COMPRESS_UPX=1` environment variable before deploying the application. This can significantly reduce the size (almost 7x smaller) of your Lambda deployment package:
Expand Down
15 changes: 11 additions & 4 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,21 @@ func NewContainerGo(scope constructs.Construct, id *string, spec *ContainerGoPro
props.Timeout = awscdk.Duration_Minutes(jsii.Number(1))
}

if props.LogRetention == "" {
props.LogRetention = awslogs.RetentionDays_FIVE_DAYS
}

if props.FunctionName == nil {
props.FunctionName = jsii.Sprintf("%s-%s", *awscdk.Aws_STACK_NAME(), spec.UniqueID())
}

if props.LogGroup == nil {
// See: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs-loggroups.html
props.LogGroup = awslogs.NewLogGroup(scope, jsii.String("LogGroup"),
&awslogs.LogGroupProps{
LogGroupName: props.FunctionName,
Retention: awslogs.RetentionDays_FIVE_DAYS,
RemovalPolicy: awscdk.RemovalPolicy_DESTROY,
},
)
}

// arm64 is default deployment
platContainer := "linux/arm64"
platCode := awsecrassets.Platform_LINUX_ARM64()
Expand Down
26 changes: 13 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ go 1.23.0
toolchain go1.24.1

require (
github.com/aws/aws-cdk-go/awscdk/v2 v2.184.1
github.com/aws/aws-lambda-go v1.47.0
github.com/aws/aws-cdk-go/awscdk/v2 v2.204.0
github.com/aws/aws-lambda-go v1.49.0
github.com/aws/constructs-go/constructs/v10 v10.4.2
github.com/aws/jsii-runtime-go v1.109.0
github.com/aws/jsii-runtime-go v1.112.0
)

require (
github.com/Masterminds/semver/v3 v3.3.1 // indirect
github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.227 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.244 // indirect
github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.1.0 // indirect
github.com/cdklabs/cloud-assembly-schema-go/awscdkcloudassemblyschema/v40 v40.7.0 // indirect
github.com/cdklabs/cloud-assembly-schema-go/awscdkcloudassemblyschema/v45 v45.2.0 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/yuin/goldmark v1.4.13 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.24.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/tools v0.31.0 // indirect
github.com/yuin/goldmark v1.7.12 // indirect
golang.org/x/lint v0.0.0-20241112194109-818c5a804067 // indirect
golang.org/x/mod v0.25.0 // indirect
golang.org/x/sync v0.15.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/tools v0.34.0 // indirect
)
54 changes: 26 additions & 28 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,58 +1,56 @@
github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4=
github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/aws/aws-cdk-go/awscdk/v2 v2.184.1 h1:rPZOecKKohLR9HP7i5YtwU0ZfhK903LTi4tCV1bMqmY=
github.com/aws/aws-cdk-go/awscdk/v2 v2.184.1/go.mod h1:DPhzICINlx7zXMrKjRGuta/bAAAaeBQbeStBzf8JHVI=
github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI=
github.com/aws/aws-lambda-go v1.47.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A=
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/aws/aws-cdk-go/awscdk/v2 v2.204.0 h1:AJVkWUMwTnVVTDsvtLUx60mLieeFy7coKceyS8ZlFpc=
github.com/aws/aws-cdk-go/awscdk/v2 v2.204.0/go.mod h1:cx5A9p1ru79f3I3MqBp5qlJiJsL65ccPYzzjpHA0kpY=
github.com/aws/aws-lambda-go v1.49.0 h1:z4VhTqkFZPM3xpEtTqWqRqsRH4TZBMJqTkRiBPYLqIQ=
github.com/aws/aws-lambda-go v1.49.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A=
github.com/aws/constructs-go/constructs/v10 v10.4.2 h1:+hDLTsFGLJmKIn0Dg20vWpKBrVnFrEWYgTEY5UiTEG8=
github.com/aws/constructs-go/constructs/v10 v10.4.2/go.mod h1:cXsNCKDV+9eR9zYYfwy6QuE4uPFp6jsq6TtH1MwBx9w=
github.com/aws/jsii-runtime-go v1.109.0 h1:PQkwf6bNxcqEabPh/C4Dnqm31WL0Uh47gGj1Q9ojwhs=
github.com/aws/jsii-runtime-go v1.109.0/go.mod h1:eLDUEd0lRYsu2WoR+EoApYPz6ibG7JOaJgbL0IlD/m8=
github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.227 h1:8ghiL3sdoTn8EGSWyyAmt7dO/h30+fgJK4nEA32jMPE=
github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.227/go.mod h1:DdG63+hiLpqqBWufXgZDgXuZm31yQdTd96M2HyqQllQ=
github.com/aws/jsii-runtime-go v1.112.0 h1:7jusWZUgSTuSPLa2ZRv+siGuyoFSzFNk/TaHqlcFe6Y=
github.com/aws/jsii-runtime-go v1.112.0/go.mod h1:jiAbLN2Hz+7At3C59LsQyv8gK3HvfNYF2YFPkWLHll8=
github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.244 h1:5BRmhBTRsGEH17AWRAO9exny9UQEnPYNXdKbQTIbwqw=
github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.244/go.mod h1:1FHlu1VKVvrE/Bmcow4crPddJlOWhEXde/Zi4TcUhkA=
github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.1.0 h1:kElXjprC8wkpJu58vp+WFH6z0AJw4zitg5iSKJPKe3c=
github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.1.0/go.mod h1:JY4UnvNa1YDGQ4H5wohXTHl6YVY3uCDUWl4JYUrQfb8=
github.com/cdklabs/cloud-assembly-schema-go/awscdkcloudassemblyschema/v40 v40.7.0 h1:ult7nwu68LJQwC9rLKrwQgFzH7CHT1IQVqtTFCgTiEE=
github.com/cdklabs/cloud-assembly-schema-go/awscdkcloudassemblyschema/v40 v40.7.0/go.mod h1:ce9S9a2dfGJqzzXHKgHiHCybH63d5MDkC18Ym0sHeHg=
github.com/cdklabs/cloud-assembly-schema-go/awscdkcloudassemblyschema/v45 v45.2.0 h1:d7nzm/qFsYWC5TPIayBGIWT/af6+bsmMDsYK/Y3t2ts=
github.com/cdklabs/cloud-assembly-schema-go/awscdkcloudassemblyschema/v45 v45.2.0/go.mod h1:HQLZo+YhqrT439d+7LrIhlM/oYzY+EVNlAuRd20m1kg=
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/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
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-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
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/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark v1.7.12 h1:YwGP/rrea2/CnCtUHgjuolG/PnMxdQtPMO5PvaE2/nY=
github.com/yuin/goldmark v1.7.12/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20241112194109-818c5a804067 h1:adDmSQyFTCiv19j015EGKJBoaa7ElV0Q1Wovb/4G7NA=
golang.org/x/lint v0.0.0-20241112194109-818c5a804067/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
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.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
15 changes: 11 additions & 4 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,21 @@ func NewFunctionGo(scope constructs.Construct, id *string, spec *FunctionGoProps
props.Timeout = awscdk.Duration_Minutes(jsii.Number(1))
}

if props.LogRetention == "" {
props.LogRetention = awslogs.RetentionDays_FIVE_DAYS
}

if props.FunctionName == nil {
props.FunctionName = jsii.Sprintf("%s-%s", *awscdk.Aws_STACK_NAME(), spec.UniqueID())
}

if props.LogGroup == nil {
// See: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs-loggroups.html
props.LogGroup = awslogs.NewLogGroup(scope, jsii.String("Logs"+spec.UniqueID()),
&awslogs.LogGroupProps{
LogGroupName: props.FunctionName,
Retention: awslogs.RetentionDays_FIVE_DAYS,
RemovalPolicy: awscdk.RemovalPolicy_DESTROY,
},
)
}

// arm64 is default deployment
props.Architecture = awslambda.Architecture_ARM_64()
if spec.GoEnv != nil {
Expand Down
44 changes: 22 additions & 22 deletions scud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func TestFunctionGo(t *testing.T) {
)

require := map[*string]*float64{
jsii.String("AWS::IAM::Role"): jsii.Number(2),
jsii.String("AWS::Lambda::Function"): jsii.Number(2),
jsii.String("Custom::LogRetention"): jsii.Number(1),
jsii.String("AWS::IAM::Role"): jsii.Number(1),
jsii.String("AWS::Lambda::Function"): jsii.Number(1),
jsii.String("AWS::Logs::LogGroup"): jsii.Number(1),
}

template := assertions.Template_FromStack(stack, nil)
Expand Down Expand Up @@ -67,9 +67,9 @@ func TestFunctionGoArch(t *testing.T) {
)

require := map[*string]*float64{
jsii.String("AWS::IAM::Role"): jsii.Number(2),
jsii.String("AWS::Lambda::Function"): jsii.Number(2),
jsii.String("Custom::LogRetention"): jsii.Number(1),
jsii.String("AWS::IAM::Role"): jsii.Number(1),
jsii.String("AWS::Lambda::Function"): jsii.Number(1),
jsii.String("AWS::Logs::LogGroup"): jsii.Number(1),
}

template := assertions.Template_FromStack(stack, nil)
Expand Down Expand Up @@ -100,9 +100,9 @@ func TestFunctionGoWithProps(t *testing.T) {
)

require := map[*string]*float64{
jsii.String("AWS::IAM::Role"): jsii.Number(2),
jsii.String("AWS::Lambda::Function"): jsii.Number(2),
jsii.String("Custom::LogRetention"): jsii.Number(1),
jsii.String("AWS::IAM::Role"): jsii.Number(1),
jsii.String("AWS::Lambda::Function"): jsii.Number(1),
jsii.String("AWS::Logs::LogGroup"): jsii.Number(1),
}

template := assertions.Template_FromStack(stack, nil)
Expand Down Expand Up @@ -159,9 +159,9 @@ func TestFunctionGoContainer(t *testing.T) {
)

require := map[*string]*float64{
jsii.String("AWS::IAM::Role"): jsii.Number(2),
jsii.String("AWS::Lambda::Function"): jsii.Number(2),
jsii.String("Custom::LogRetention"): jsii.Number(1),
jsii.String("AWS::IAM::Role"): jsii.Number(1),
jsii.String("AWS::Lambda::Function"): jsii.Number(1),
jsii.String("AWS::Logs::LogGroup"): jsii.Number(1),
}

template := assertions.Template_FromStack(stack, nil)
Expand Down Expand Up @@ -195,9 +195,9 @@ func TestFunctionGoContainerArch(t *testing.T) {
)

require := map[*string]*float64{
jsii.String("AWS::IAM::Role"): jsii.Number(2),
jsii.String("AWS::Lambda::Function"): jsii.Number(2),
jsii.String("Custom::LogRetention"): jsii.Number(1),
jsii.String("AWS::IAM::Role"): jsii.Number(1),
jsii.String("AWS::Lambda::Function"): jsii.Number(1),
jsii.String("AWS::Logs::LogGroup"): jsii.Number(1),
}

template := assertions.Template_FromStack(stack, nil)
Expand Down Expand Up @@ -225,9 +225,9 @@ func TestUniversalWithFunction(t *testing.T) {
)

require := map[*string]*float64{
jsii.String("AWS::IAM::Role"): jsii.Number(2),
jsii.String("AWS::Lambda::Function"): jsii.Number(2),
jsii.String("Custom::LogRetention"): jsii.Number(1),
jsii.String("AWS::IAM::Role"): jsii.Number(1),
jsii.String("AWS::Lambda::Function"): jsii.Number(1),
jsii.String("AWS::Logs::LogGroup"): jsii.Number(1),
}

template := assertions.Template_FromStack(stack, nil)
Expand All @@ -248,9 +248,9 @@ func TestUniversalWithContainer(t *testing.T) {
)

require := map[*string]*float64{
jsii.String("AWS::IAM::Role"): jsii.Number(2),
jsii.String("AWS::Lambda::Function"): jsii.Number(2),
jsii.String("Custom::LogRetention"): jsii.Number(1),
jsii.String("AWS::IAM::Role"): jsii.Number(1),
jsii.String("AWS::Lambda::Function"): jsii.Number(1),
jsii.String("AWS::Logs::LogGroup"): jsii.Number(1),
}

template := assertions.Template_FromStack(stack, nil)
Expand Down Expand Up @@ -334,7 +334,7 @@ func TestAddResourceDepthPath(t *testing.T) {
jsii.String("AWS::ApiGatewayV2::Stage"): jsii.Number(2),
jsii.String("AWS::ApiGatewayV2::Route"): jsii.Number(2),
jsii.String("AWS::ApiGatewayV2::Integration"): jsii.Number(2),
jsii.String("AWS::Lambda::Function"): jsii.Number(2),
jsii.String("AWS::Lambda::Function"): jsii.Number(1),
}

template := assertions.Template_FromStack(stack, nil)
Expand Down
Loading