diff --git a/integration_tests/snapshots/.gitignore b/integration_tests/snapshots/.gitignore new file mode 100644 index 000000000..5484d1cc5 --- /dev/null +++ b/integration_tests/snapshots/.gitignore @@ -0,0 +1 @@ +test-*-snapshot.json \ No newline at end of file diff --git a/integration_tests/snapshots/test-lambda-function-arm-stack-snapshot.json b/integration_tests/snapshots/test-lambda-function-arm-stack-snapshot.json deleted file mode 100644 index 4eca79e5d..000000000 --- a/integration_tests/snapshots/test-lambda-function-arm-stack-snapshot.json +++ /dev/null @@ -1,508 +0,0 @@ -{ - "Resources": { - "HelloHandlerServiceRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/HelloHandler/ServiceRole/Resource" - } - }, - "HelloHandlerXXXXXXXX": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Architectures": [ - "arm64" - ], - "Code": { - "ZipFile": "test" - }, - "Environment": { - "Variables": { - "DD_LAMBDA_HANDLER": "lambdaFunction.handler", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "false", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234" - } - }, - "Handler": "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler", - "Layers": [ - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node14-x:XXX", - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension-ARM:10" - ], - "Role": { - "Fn::GetAtt": [ - "HelloHandlerServiceRoleXXXXXXXX", - "Arn" - ] - }, - "Runtime": "nodejs14.x", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ] - }, - "DependsOn": [ - "HelloHandlerServiceRoleXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/HelloHandler/Resource" - } - }, - "restLogGroupXXXXXXXX": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 731 - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/restLogGroup/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Name": "rest-test" - }, - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/Resource" - } - }, - "resttestCloudWatchRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "apigateway.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/CloudWatchRole/Resource" - } - }, - "resttestAccountXXXXXXXX": { - "Type": "AWS::ApiGateway::Account", - "Properties": { - "CloudWatchRoleArn": { - "Fn::GetAtt": [ - "resttestCloudWatchRoleXXXXXXXX", - "Arn" - ] - } - }, - "DependsOn": [ - "resttestXXXXXXXX" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/Account" - } - }, - "resttestDeploymentXXXXXXXX": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "Description": "Automatically created by the RestApi construct", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "DependsOn": [ - "resttestproxyANYXXXXXXXX", - "resttestproxyXXXXXXXX", - "resttestANYXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/Deployment/Resource" - } - }, - "resttestDeploymentStageprodXXXXXXXX": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "AccessLogSetting": { - "DestinationArn": { - "Fn::GetAtt": [ - "restLogGroupXXXXXXXX", - "Arn" - ] - }, - "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] \"$context.httpMethod $context.resourcePath $context.protocol\" $context.status $context.responseLength $context.requestId" - }, - "DeploymentId": { - "Ref": "resttestDeploymentXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - }, - "StageName": "prod" - }, - "DependsOn": [ - "resttestAccountXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/DeploymentStage.prod/Resource" - } - }, - "resttestproxyXXXXXXXX": { - "Type": "AWS::ApiGateway::Resource", - "Properties": { - "ParentId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "PathPart": "{proxy+}", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/Default/{proxy+}/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.lambdafunctionarmstackresttest5EE8FF87.ANY..{proxy+}" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.Test.lambdafunctionarmstackresttest5EE8FF87.ANY..{proxy+}" - } - }, - "resttestproxyANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Ref": "resttestproxyXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/Default/{proxy+}/ANY/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/Default/ANY/ApiPermission.lambdafunctionarmstackresttest5EE8FF87.ANY.." - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/Default/ANY/ApiPermission.Test.lambdafunctionarmstackresttest5EE8FF87.ANY.." - } - }, - "resttestANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/rest-test/Default/ANY/Resource" - } - }, - "CDKMetadata": { - "Type": "AWS::CDK::Metadata", - "Properties": { - "Analytics": "vX:XXXXXX:XXXXXX" - }, - "Metadata": { - "aws:cdk:path": "lambda-function-arm-stack/CDKMetadata/Default" - } - } - }, - "Outputs": { - "resttestEndpointXXXXXXXX": { - "Value": { - "Fn::Join": [ - "", - [ - "https://", - { - "Ref": "resttestXXXXXXXX" - }, - ".execute-api.sa-east-1.", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/" - ] - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/integration_tests/snapshots/test-lambda-function-stack-legacy-datadog-api-snapshot.json b/integration_tests/snapshots/test-lambda-function-stack-legacy-datadog-api-snapshot.json deleted file mode 100644 index e69de29bb..000000000 diff --git a/integration_tests/snapshots/test-lambda-function-stack-snapshot.json b/integration_tests/snapshots/test-lambda-function-stack-snapshot.json deleted file mode 100644 index c1956d29d..000000000 --- a/integration_tests/snapshots/test-lambda-function-stack-snapshot.json +++ /dev/null @@ -1,505 +0,0 @@ -{ - "Resources": { - "HelloHandlerServiceRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "lambda-function-stack/HelloHandler/ServiceRole/Resource" - } - }, - "HelloHandlerXXXXXXXX": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "ZipFile": "test" - }, - "Environment": { - "Variables": { - "DD_LAMBDA_HANDLER": "lambdaFunction.handler", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "false", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234" - } - }, - "Handler": "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler", - "Layers": [ - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node14-x:XXX", - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension:XXX" - ], - "Role": { - "Fn::GetAtt": [ - "HelloHandlerServiceRoleXXXXXXXX", - "Arn" - ] - }, - "Runtime": "nodejs14.x", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ] - }, - "DependsOn": [ - "HelloHandlerServiceRoleXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-function-stack/HelloHandler/Resource" - } - }, - "restLogGroupXXXXXXXX": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 731 - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-function-stack/restLogGroup/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Name": "rest-test" - }, - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/Resource" - } - }, - "resttestCloudWatchRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "apigateway.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/CloudWatchRole/Resource" - } - }, - "resttestAccountXXXXXXXX": { - "Type": "AWS::ApiGateway::Account", - "Properties": { - "CloudWatchRoleArn": { - "Fn::GetAtt": [ - "resttestCloudWatchRoleXXXXXXXX", - "Arn" - ] - } - }, - "DependsOn": [ - "resttestXXXXXXXX" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/Account" - } - }, - "resttestDeploymentXXXXXXXX": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "Description": "Automatically created by the RestApi construct", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "DependsOn": [ - "resttestproxyANYXXXXXXXX", - "resttestproxyXXXXXXXX", - "resttestANYXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/Deployment/Resource" - } - }, - "resttestDeploymentStageprodXXXXXXXX": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "AccessLogSetting": { - "DestinationArn": { - "Fn::GetAtt": [ - "restLogGroupXXXXXXXX", - "Arn" - ] - }, - "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] \"$context.httpMethod $context.resourcePath $context.protocol\" $context.status $context.responseLength $context.requestId" - }, - "DeploymentId": { - "Ref": "resttestDeploymentXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - }, - "StageName": "prod" - }, - "DependsOn": [ - "resttestAccountXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/DeploymentStage.prod/Resource" - } - }, - "resttestproxyXXXXXXXX": { - "Type": "AWS::ApiGateway::Resource", - "Properties": { - "ParentId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "PathPart": "{proxy+}", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/Default/{proxy+}/Resource" - } - }, - "resttestproxyANYApiPermissionlambdafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.lambdafunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestproxyANYApiPermissionTestlambdafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.Test.lambdafunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestproxyANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Ref": "resttestproxyXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/Default/{proxy+}/ANY/Resource" - } - }, - "resttestANYApiPermissionlambdafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/Default/ANY/ApiPermission.lambdafunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestANYApiPermissionTestlambdafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/Default/ANY/ApiPermission.Test.lambdafunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-function-stack/rest-test/Default/ANY/Resource" - } - }, - "CDKMetadata": { - "Type": "AWS::CDK::Metadata", - "Properties": { - "Analytics": "vX:XXXXXX:XXXXXX" - }, - "Metadata": { - "aws:cdk:path": "lambda-function-stack/CDKMetadata/Default" - } - } - }, - "Outputs": { - "resttestEndpointXXXXXXXX": { - "Value": { - "Fn::Join": [ - "", - [ - "https://", - { - "Ref": "resttestXXXXXXXX" - }, - ".execute-api.sa-east-1.", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/" - ] - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/integration_tests/snapshots/test-lambda-java-function-stack-snapshot.json b/integration_tests/snapshots/test-lambda-java-function-stack-snapshot.json deleted file mode 100644 index fc5feb46b..000000000 --- a/integration_tests/snapshots/test-lambda-java-function-stack-snapshot.json +++ /dev/null @@ -1,509 +0,0 @@ -{ - "Resources": { - "HelloHandlerServiceRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/HelloHandler/ServiceRole/Resource" - } - }, - "HelloHandlerXXXXXXXX": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": "cdk-hnb659fds-assets-601427279990-sa-east-1", - "S3Key": "serverless/dd-cdk-construct-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-cdk-construct-integration-test.zip" - }, - "Environment": { - "Variables": { - "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "false", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234" - } - }, - "Handler": "handleRequest", - "Layers": [ - "arn:aws:lambda:sa-east-1:464622532012:layer:dd-trace-java:5", - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension:XXX" - ], - "Role": { - "Fn::GetAtt": [ - "HelloHandlerServiceRoleXXXXXXXX", - "Arn" - ] - }, - "Runtime": "java11", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ] - }, - "DependsOn": [ - "HelloHandlerServiceRoleXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/HelloHandler/Resource", - "aws:asset:path": "asset.XXXXXXXXXXXXX", - "aws:asset:is-bundled": false, - "aws:asset:property": "Code" - } - }, - "restLogGroupXXXXXXXX": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 731 - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/restLogGroup/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Name": "rest-test" - }, - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/Resource" - } - }, - "resttestCloudWatchRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "apigateway.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/CloudWatchRole/Resource" - } - }, - "resttestAccountXXXXXXXX": { - "Type": "AWS::ApiGateway::Account", - "Properties": { - "CloudWatchRoleArn": { - "Fn::GetAtt": [ - "resttestCloudWatchRoleXXXXXXXX", - "Arn" - ] - } - }, - "DependsOn": [ - "resttestXXXXXXXX" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/Account" - } - }, - "resttestDeploymentXXXXXXXX": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "Description": "Automatically created by the RestApi construct", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "DependsOn": [ - "resttestproxyANYXXXXXXXX", - "resttestproxyXXXXXXXX", - "resttestANYXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/Deployment/Resource" - } - }, - "resttestDeploymentStageprodXXXXXXXX": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "AccessLogSetting": { - "DestinationArn": { - "Fn::GetAtt": [ - "restLogGroupXXXXXXXX", - "Arn" - ] - }, - "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] \"$context.httpMethod $context.resourcePath $context.protocol\" $context.status $context.responseLength $context.requestId" - }, - "DeploymentId": { - "Ref": "resttestDeploymentXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - }, - "StageName": "prod" - }, - "DependsOn": [ - "resttestAccountXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/DeploymentStage.prod/Resource" - } - }, - "resttestproxyXXXXXXXX": { - "Type": "AWS::ApiGateway::Resource", - "Properties": { - "ParentId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "PathPart": "{proxy+}", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/Default/{proxy+}/Resource" - } - }, - "resttestproxyANYApiPermissionlambdajavafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.lambdajavafunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestproxyANYApiPermissionTestlambdajavafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.Test.lambdajavafunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestproxyANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Ref": "resttestproxyXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/Default/{proxy+}/ANY/Resource" - } - }, - "resttestANYApiPermissionlambdajavafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/Default/ANY/ApiPermission.lambdajavafunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestANYApiPermissionTestlambdajavafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/Default/ANY/ApiPermission.Test.lambdajavafunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/rest-test/Default/ANY/Resource" - } - }, - "CDKMetadata": { - "Type": "AWS::CDK::Metadata", - "Properties": { - "Analytics": "vX:XXXXXX:XXXXXX" - }, - "Metadata": { - "aws:cdk:path": "lambda-java-function-stack/CDKMetadata/Default" - } - } - }, - "Outputs": { - "resttestEndpointXXXXXXXX": { - "Value": { - "Fn::Join": [ - "", - [ - "https://", - { - "Ref": "resttestXXXXXXXX" - }, - ".execute-api.sa-east-1.", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/" - ] - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/integration_tests/snapshots/test-lambda-nodejs-function-stack-snapshot.json b/integration_tests/snapshots/test-lambda-nodejs-function-stack-snapshot.json deleted file mode 100644 index efc848dc1..000000000 --- a/integration_tests/snapshots/test-lambda-nodejs-function-stack-snapshot.json +++ /dev/null @@ -1,510 +0,0 @@ -{ - "Resources": { - "HelloHandlerServiceRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/HelloHandler/ServiceRole/Resource" - } - }, - "HelloHandlerXXXXXXXX": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": "cdk-hnb659fds-assets-601427279990-sa-east-1", - "S3Key": "serverless/dd-cdk-construct-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-cdk-construct-integration-test.zip" - }, - "Environment": { - "Variables": { - "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1", - "DD_LAMBDA_HANDLER": "index.handler", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "false", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234" - } - }, - "Handler": "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler", - "Layers": [ - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node14-x:XXX", - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension:XXX" - ], - "Role": { - "Fn::GetAtt": [ - "HelloHandlerServiceRoleXXXXXXXX", - "Arn" - ] - }, - "Runtime": "nodejs14.x", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ] - }, - "DependsOn": [ - "HelloHandlerServiceRoleXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/HelloHandler/Resource", - "aws:asset:path": "asset.XXXXXXXXXXXXX", - "aws:asset:is-bundled": true, - "aws:asset:property": "Code" - } - }, - "restLogGroupXXXXXXXX": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 731 - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/restLogGroup/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Name": "rest-test" - }, - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/Resource" - } - }, - "resttestCloudWatchRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "apigateway.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/CloudWatchRole/Resource" - } - }, - "resttestAccountXXXXXXXX": { - "Type": "AWS::ApiGateway::Account", - "Properties": { - "CloudWatchRoleArn": { - "Fn::GetAtt": [ - "resttestCloudWatchRoleXXXXXXXX", - "Arn" - ] - } - }, - "DependsOn": [ - "resttestXXXXXXXX" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/Account" - } - }, - "resttestDeploymentXXXXXXXX": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "Description": "Automatically created by the RestApi construct", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "DependsOn": [ - "resttestproxyANYXXXXXXXX", - "resttestproxyXXXXXXXX", - "resttestANYXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/Deployment/Resource" - } - }, - "resttestDeploymentStageprodXXXXXXXX": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "AccessLogSetting": { - "DestinationArn": { - "Fn::GetAtt": [ - "restLogGroupXXXXXXXX", - "Arn" - ] - }, - "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] \"$context.httpMethod $context.resourcePath $context.protocol\" $context.status $context.responseLength $context.requestId" - }, - "DeploymentId": { - "Ref": "resttestDeploymentXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - }, - "StageName": "prod" - }, - "DependsOn": [ - "resttestAccountXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/DeploymentStage.prod/Resource" - } - }, - "resttestproxyXXXXXXXX": { - "Type": "AWS::ApiGateway::Resource", - "Properties": { - "ParentId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "PathPart": "{proxy+}", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/Default/{proxy+}/Resource" - } - }, - "resttestproxyANYApiPermissionlambdafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.lambdanodejsfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestproxyANYApiPermissionTestlambdafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.Test.lambdanodejsfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestproxyANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Ref": "resttestproxyXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/Default/{proxy+}/ANY/Resource" - } - }, - "resttestANYApiPermissionlambdanodejsfunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/Default/ANY/ApiPermission.lambdanodejsfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestANYApiPermissionTestlambdanodejsfunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/Default/ANY/ApiPermission.Test.lambdanodejsfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/rest-test/Default/ANY/Resource" - } - }, - "CDKMetadata": { - "Type": "AWS::CDK::Metadata", - "Properties": { - "Analytics": "vX:XXXXXX:XXXXXX" - }, - "Metadata": { - "aws:cdk:path": "lambda-nodejs-function-stack/CDKMetadata/Default" - } - } - }, - "Outputs": { - "resttestEndpointXXXXXXXX": { - "Value": { - "Fn::Join": [ - "", - [ - "https://", - { - "Ref": "resttestXXXXXXXX" - }, - ".execute-api.sa-east-1.", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/" - ] - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/integration_tests/snapshots/test-lambda-provided-arm-stack-snapshot.json b/integration_tests/snapshots/test-lambda-provided-arm-stack-snapshot.json deleted file mode 100644 index 38d8d16c0..000000000 --- a/integration_tests/snapshots/test-lambda-provided-arm-stack-snapshot.json +++ /dev/null @@ -1,583 +0,0 @@ -{ - "Resources": { - "exampleBucketB33BA2C4": { - "Type": "AWS::S3::Bucket", - "Properties": { - "OwnershipControls": { - "Rules": [ - { - "ObjectOwnership": "BucketOwnerEnforced" - } - ] - }, - "PublicAccessBlockConfiguration": { - "BlockPublicAcls": true, - "BlockPublicPolicy": true, - "IgnorePublicAcls": true, - "RestrictPublicBuckets": true - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/exampleBucket/Resource" - } - }, - "HelloHandlerServiceRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/HelloHandler/ServiceRole/Resource" - } - }, - "HelloHandlerServiceRoleXXXXXXXX": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "exampleBucketB33BA2C4", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "exampleBucketB33BA2C4", - "Arn" - ] - }, - "/*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "HelloHandlerServiceRoleXXXXXXXX", - "Roles": [ - { - "Ref": "HelloHandlerServiceRoleXXXXXXXX" - } - ] - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/HelloHandler/ServiceRole/DefaultPolicy/Resource" - } - }, - "HelloHandlerXXXXXXXX": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Architectures": [ - "arm64" - ], - "Code": { - "S3Bucket": { - "Ref": "exampleBucketB33BA2C4" - }, - "S3Key": "serverless/dd-cdk-construct-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-cdk-construct-integration-test.zip" - }, - "Environment": { - "Variables": { - "DD_LAMBDA_HANDLER": "handler.handler", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "false", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234" - } - }, - "Handler": "handler.handler", - "Layers": [ - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension-ARM:49" - ], - "Role": { - "Fn::GetAtt": [ - "HelloHandlerServiceRoleXXXXXXXX", - "Arn" - ] - }, - "Runtime": "provided.al2", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ] - }, - "DependsOn": [ - "HelloHandlerServiceRoleXXXXXXXX", - "HelloHandlerServiceRoleXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/HelloHandler/Resource" - } - }, - "restLogGroupXXXXXXXX": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 731 - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/restLogGroup/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Name": "rest-test" - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/Resource" - } - }, - "resttestCloudWatchRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "apigateway.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/CloudWatchRole/Resource" - } - }, - "resttestAccountXXXXXXXX": { - "Type": "AWS::ApiGateway::Account", - "Properties": { - "CloudWatchRoleArn": { - "Fn::GetAtt": [ - "resttestCloudWatchRoleXXXXXXXX", - "Arn" - ] - } - }, - "DependsOn": [ - "resttestXXXXXXXX" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/Account" - } - }, - "resttestDeploymentXXXXXXXX": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "Description": "Automatically created by the RestApi construct", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "DependsOn": [ - "resttestproxyANYXXXXXXXX", - "resttestproxyXXXXXXXX", - "resttestANYXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/Deployment/Resource" - } - }, - "resttestDeploymentStageprodXXXXXXXX": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "AccessLogSetting": { - "DestinationArn": { - "Fn::GetAtt": [ - "restLogGroupXXXXXXXX", - "Arn" - ] - }, - "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] \"$context.httpMethod $context.resourcePath $context.protocol\" $context.status $context.responseLength $context.requestId" - }, - "DeploymentId": { - "Ref": "resttestDeploymentXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - }, - "StageName": "prod" - }, - "DependsOn": [ - "resttestAccountXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/DeploymentStage.prod/Resource" - } - }, - "resttestproxyXXXXXXXX": { - "Type": "AWS::ApiGateway::Resource", - "Properties": { - "ParentId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "PathPart": "{proxy+}", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/Default/{proxy+}/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.lambdaprovidedarmstackresttest0907B3D2.ANY..{proxy+}" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.Test.lambdaprovidedarmstackresttest0907B3D2.ANY..{proxy+}" - } - }, - "resttestproxyANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Ref": "resttestproxyXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/Default/{proxy+}/ANY/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/Default/ANY/ApiPermission.lambdaprovidedarmstackresttest0907B3D2.ANY.." - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/Default/ANY/ApiPermission.Test.lambdaprovidedarmstackresttest0907B3D2.ANY.." - } - }, - "resttestANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/rest-test/Default/ANY/Resource" - } - }, - "CDKMetadata": { - "Type": "AWS::CDK::Metadata", - "Properties": { - "Analytics": "vX:XXXXXX:XXXXXX" - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-arm-stack/CDKMetadata/Default" - } - } - }, - "Outputs": { - "resttestEndpointXXXXXXXX": { - "Value": { - "Fn::Join": [ - "", - [ - "https://", - { - "Ref": "resttestXXXXXXXX" - }, - ".execute-api.sa-east-1.", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/" - ] - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/integration_tests/snapshots/test-lambda-provided-stack-snapshot.json b/integration_tests/snapshots/test-lambda-provided-stack-snapshot.json deleted file mode 100644 index 05f826f2b..000000000 --- a/integration_tests/snapshots/test-lambda-provided-stack-snapshot.json +++ /dev/null @@ -1,580 +0,0 @@ -{ - "Resources": { - "exampleBucketB33BA2C4": { - "Type": "AWS::S3::Bucket", - "Properties": { - "OwnershipControls": { - "Rules": [ - { - "ObjectOwnership": "BucketOwnerEnforced" - } - ] - }, - "PublicAccessBlockConfiguration": { - "BlockPublicAcls": true, - "BlockPublicPolicy": true, - "IgnorePublicAcls": true, - "RestrictPublicBuckets": true - } - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/exampleBucket/Resource" - } - }, - "HelloHandlerServiceRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/HelloHandler/ServiceRole/Resource" - } - }, - "HelloHandlerServiceRoleXXXXXXXX": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "s3:GetObject*", - "s3:GetBucket*", - "s3:List*" - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "exampleBucketB33BA2C4", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "exampleBucketB33BA2C4", - "Arn" - ] - }, - "/*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "HelloHandlerServiceRoleXXXXXXXX", - "Roles": [ - { - "Ref": "HelloHandlerServiceRoleXXXXXXXX" - } - ] - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/HelloHandler/ServiceRole/DefaultPolicy/Resource" - } - }, - "HelloHandlerXXXXXXXX": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Ref": "exampleBucketB33BA2C4" - }, - "S3Key": "serverless/dd-cdk-construct-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-cdk-construct-integration-test.zip" - }, - "Environment": { - "Variables": { - "DD_LAMBDA_HANDLER": "handler.handler", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "false", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234" - } - }, - "Handler": "handler.handler", - "Layers": [ - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension:XXX" - ], - "Role": { - "Fn::GetAtt": [ - "HelloHandlerServiceRoleXXXXXXXX", - "Arn" - ] - }, - "Runtime": "provided.al2", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ] - }, - "DependsOn": [ - "HelloHandlerServiceRoleXXXXXXXX", - "HelloHandlerServiceRoleXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/HelloHandler/Resource" - } - }, - "restLogGroupXXXXXXXX": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 731 - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/restLogGroup/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Name": "rest-test" - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/Resource" - } - }, - "resttestCloudWatchRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "apigateway.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/CloudWatchRole/Resource" - } - }, - "resttestAccountXXXXXXXX": { - "Type": "AWS::ApiGateway::Account", - "Properties": { - "CloudWatchRoleArn": { - "Fn::GetAtt": [ - "resttestCloudWatchRoleXXXXXXXX", - "Arn" - ] - } - }, - "DependsOn": [ - "resttestXXXXXXXX" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/Account" - } - }, - "resttestDeploymentXXXXXXXX": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "Description": "Automatically created by the RestApi construct", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "DependsOn": [ - "resttestproxyANYXXXXXXXX", - "resttestproxyXXXXXXXX", - "resttestANYXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/Deployment/Resource" - } - }, - "resttestDeploymentStageprodXXXXXXXX": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "AccessLogSetting": { - "DestinationArn": { - "Fn::GetAtt": [ - "restLogGroupXXXXXXXX", - "Arn" - ] - }, - "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] \"$context.httpMethod $context.resourcePath $context.protocol\" $context.status $context.responseLength $context.requestId" - }, - "DeploymentId": { - "Ref": "resttestDeploymentXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - }, - "StageName": "prod" - }, - "DependsOn": [ - "resttestAccountXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/DeploymentStage.prod/Resource" - } - }, - "resttestproxyXXXXXXXX": { - "Type": "AWS::ApiGateway::Resource", - "Properties": { - "ParentId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "PathPart": "{proxy+}", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/Default/{proxy+}/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.lambdaprovidedstackresttest651D1AB2.ANY..{proxy+}" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.Test.lambdaprovidedstackresttest651D1AB2.ANY..{proxy+}" - } - }, - "resttestproxyANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Ref": "resttestproxyXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/Default/{proxy+}/ANY/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/Default/ANY/ApiPermission.lambdaprovidedstackresttest651D1AB2.ANY.." - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/Default/ANY/ApiPermission.Test.lambdaprovidedstackresttest651D1AB2.ANY.." - } - }, - "resttestANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/rest-test/Default/ANY/Resource" - } - }, - "CDKMetadata": { - "Type": "AWS::CDK::Metadata", - "Properties": { - "Analytics": "vX:XXXXXX:XXXXXX" - }, - "Metadata": { - "aws:cdk:path": "lambda-provided-stack/CDKMetadata/Default" - } - } - }, - "Outputs": { - "resttestEndpointXXXXXXXX": { - "Value": { - "Fn::Join": [ - "", - [ - "https://", - { - "Ref": "resttestXXXXXXXX" - }, - ".execute-api.sa-east-1.", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/" - ] - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/integration_tests/snapshots/test-lambda-python-function-stack-snapshot.json b/integration_tests/snapshots/test-lambda-python-function-stack-snapshot.json deleted file mode 100644 index e0d00fa96..000000000 --- a/integration_tests/snapshots/test-lambda-python-function-stack-snapshot.json +++ /dev/null @@ -1,509 +0,0 @@ -{ - "Resources": { - "HelloHandlerServiceRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/HelloHandler/ServiceRole/Resource" - } - }, - "HelloHandlerXXXXXXXX": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": "cdk-hnb659fds-assets-601427279990-sa-east-1", - "S3Key": "serverless/dd-cdk-construct-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-cdk-construct-integration-test.zip" - }, - "Environment": { - "Variables": { - "DD_LAMBDA_HANDLER": "example-python.handler", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "false", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234" - } - }, - "Handler": "datadog_lambda.handler.handler", - "Layers": [ - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Python37:XXX", - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension:XXX" - ], - "Role": { - "Fn::GetAtt": [ - "HelloHandlerServiceRoleXXXXXXXX", - "Arn" - ] - }, - "Runtime": "python3.7", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ] - }, - "DependsOn": [ - "HelloHandlerServiceRoleXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/HelloHandler/Resource", - "aws:asset:path": "asset.XXXXXXXXXXXXX", - "aws:asset:is-bundled": true, - "aws:asset:property": "Code" - } - }, - "restLogGroupXXXXXXXX": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 731 - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/restLogGroup/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Name": "rest-test" - }, - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/Resource" - } - }, - "resttestCloudWatchRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "apigateway.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/CloudWatchRole/Resource" - } - }, - "resttestAccountXXXXXXXX": { - "Type": "AWS::ApiGateway::Account", - "Properties": { - "CloudWatchRoleArn": { - "Fn::GetAtt": [ - "resttestCloudWatchRoleXXXXXXXX", - "Arn" - ] - } - }, - "DependsOn": [ - "resttestXXXXXXXX" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/Account" - } - }, - "resttestDeploymentXXXXXXXX": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "Description": "Automatically created by the RestApi construct", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "DependsOn": [ - "resttestproxyANYXXXXXXXX", - "resttestproxyXXXXXXXX", - "resttestANYXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/Deployment/Resource" - } - }, - "resttestDeploymentStageprodXXXXXXXX": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "AccessLogSetting": { - "DestinationArn": { - "Fn::GetAtt": [ - "restLogGroupXXXXXXXX", - "Arn" - ] - }, - "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] \"$context.httpMethod $context.resourcePath $context.protocol\" $context.status $context.responseLength $context.requestId" - }, - "DeploymentId": { - "Ref": "resttestDeploymentXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - }, - "StageName": "prod" - }, - "DependsOn": [ - "resttestAccountXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/DeploymentStage.prod/Resource" - } - }, - "resttestproxyXXXXXXXX": { - "Type": "AWS::ApiGateway::Resource", - "Properties": { - "ParentId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "PathPart": "{proxy+}", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/Default/{proxy+}/Resource" - } - }, - "resttestproxyANYApiPermissionlambdafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.lambdapythonfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestproxyANYApiPermissionTestlambdafunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.Test.lambdapythonfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestproxyANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Ref": "resttestproxyXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/Default/{proxy+}/ANY/Resource" - } - }, - "resttestANYApiPermissionlambdapythonfunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/Default/ANY/ApiPermission.lambdapythonfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestANYApiPermissionTestlambdapythonfunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/Default/ANY/ApiPermission.Test.lambdapythonfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "HelloHandlerXXXXXXXX", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/rest-test/Default/ANY/Resource" - } - }, - "CDKMetadata": { - "Type": "AWS::CDK::Metadata", - "Properties": { - "Analytics": "vX:XXXXXX:XXXXXX" - }, - "Metadata": { - "aws:cdk:path": "lambda-python-function-stack/CDKMetadata/Default" - } - } - }, - "Outputs": { - "resttestEndpointXXXXXXXX": { - "Value": { - "Fn::Join": [ - "", - [ - "https://", - { - "Ref": "resttestXXXXXXXX" - }, - ".execute-api.sa-east-1.", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/" - ] - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/integration_tests/snapshots/test-lambda-singleton-function-stack-snapshot.json b/integration_tests/snapshots/test-lambda-singleton-function-stack-snapshot.json deleted file mode 100644 index 412bc2a9a..000000000 --- a/integration_tests/snapshots/test-lambda-singleton-function-stack-snapshot.json +++ /dev/null @@ -1,505 +0,0 @@ -{ - "Resources": { - "SingletonLambdab55587fe69854c28ab514d0edb1ba8a1ServiceRole5C6B0587": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/SingletonLambdab55587fe69854c28ab514d0edb1ba8a1/ServiceRole/Resource" - } - }, - "SingletonLambdab55587fe69854c28ab514d0edb1ba8a1E1AFAB02": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "ZipFile": "test" - }, - "Environment": { - "Variables": { - "DD_LAMBDA_HANDLER": "lambdaFunction.handler", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "false", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234" - } - }, - "Handler": "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler", - "Layers": [ - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Node14-x:XXX", - "arn:aws:lambda:sa-east-1:464622532012:layer:Datadog-Extension:XXX" - ], - "Role": { - "Fn::GetAtt": [ - "SingletonLambdab55587fe69854c28ab514d0edb1ba8a1ServiceRole5C6B0587", - "Arn" - ] - }, - "Runtime": "nodejs14.x", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ] - }, - "DependsOn": [ - "SingletonLambdab55587fe69854c28ab514d0edb1ba8a1ServiceRole5C6B0587" - ], - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/SingletonLambdab55587fe69854c28ab514d0edb1ba8a1/Resource" - } - }, - "restLogGroupXXXXXXXX": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "RetentionInDays": 731 - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/restLogGroup/Resource" - } - }, - "resttestXXXXXXXX": { - "Type": "AWS::ApiGateway::RestApi", - "Properties": { - "Name": "rest-test" - }, - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/Resource" - } - }, - "resttestCloudWatchRoleXXXXXXXX": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "apigateway.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/CloudWatchRole/Resource" - } - }, - "resttestAccountXXXXXXXX": { - "Type": "AWS::ApiGateway::Account", - "Properties": { - "CloudWatchRoleArn": { - "Fn::GetAtt": [ - "resttestCloudWatchRoleXXXXXXXX", - "Arn" - ] - } - }, - "DependsOn": [ - "resttestXXXXXXXX" - ], - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain", - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/Account" - } - }, - "resttestDeploymentXXXXXXXX": { - "Type": "AWS::ApiGateway::Deployment", - "Properties": { - "Description": "Automatically created by the RestApi construct", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "DependsOn": [ - "resttestproxyANYXXXXXXXX", - "resttestproxyXXXXXXXX", - "resttestANYXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/Deployment/Resource" - } - }, - "resttestDeploymentStageprodXXXXXXXX": { - "Type": "AWS::ApiGateway::Stage", - "Properties": { - "AccessLogSetting": { - "DestinationArn": { - "Fn::GetAtt": [ - "restLogGroupXXXXXXXX", - "Arn" - ] - }, - "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] \"$context.httpMethod $context.resourcePath $context.protocol\" $context.status $context.responseLength $context.requestId" - }, - "DeploymentId": { - "Ref": "resttestDeploymentXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - }, - "StageName": "prod" - }, - "DependsOn": [ - "resttestAccountXXXXXXXX" - ], - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/DeploymentStage.prod/Resource" - } - }, - "resttestproxyXXXXXXXX": { - "Type": "AWS::ApiGateway::Resource", - "Properties": { - "ParentId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "PathPart": "{proxy+}", - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/Default/{proxy+}/Resource" - } - }, - "resttestproxyANYApiPermissionlambdasingletonfunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "SingletonLambdab55587fe69854c28ab514d0edb1ba8a1E1AFAB02", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.lambdasingletonfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestproxyANYApiPermissionTestlambdasingletonfunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "SingletonLambdab55587fe69854c28ab514d0edb1ba8a1E1AFAB02", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/*" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/Default/{proxy+}/ANY/ApiPermission.Test.lambdasingletonfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestproxyANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "SingletonLambdab55587fe69854c28ab514d0edb1ba8a1E1AFAB02", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Ref": "resttestproxyXXXXXXXX" - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/Default/{proxy+}/ANY/Resource" - } - }, - "resttestANYApiPermissionlambdasingletonfunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "SingletonLambdab55587fe69854c28ab514d0edb1ba8a1E1AFAB02", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/Default/ANY/ApiPermission.lambdasingletonfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestANYApiPermissionTestlambdasingletonfunctionstackresttestXXXXXXXXANYXXXXXXXX": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "SingletonLambdab55587fe69854c28ab514d0edb1ba8a1E1AFAB02", - "Arn" - ] - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":execute-api:sa-east-1:601427279990:", - { - "Ref": "resttestXXXXXXXX" - }, - "/test-invoke-stage/*/" - ] - ] - } - }, - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/Default/ANY/ApiPermission.Test.lambdasingletonfunctionstackresttestXXXXXXXXANYXXXXXXXX" - } - }, - "resttestANYXXXXXXXX": { - "Type": "AWS::ApiGateway::Method", - "Properties": { - "AuthorizationType": "NONE", - "HttpMethod": "ANY", - "Integration": { - "IntegrationHttpMethod": "POST", - "Type": "AWS_PROXY", - "Uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":apigateway:sa-east-1:lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "SingletonLambdab55587fe69854c28ab514d0edb1ba8a1E1AFAB02", - "Arn" - ] - }, - "/invocations" - ] - ] - } - }, - "ResourceId": { - "Fn::GetAtt": [ - "resttestXXXXXXXX", - "RootResourceId" - ] - }, - "RestApiId": { - "Ref": "resttestXXXXXXXX" - } - }, - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/rest-test/Default/ANY/Resource" - } - }, - "CDKMetadata": { - "Type": "AWS::CDK::Metadata", - "Properties": { - "Analytics": "vX:XXXXXX:XXXXXX" - }, - "Metadata": { - "aws:cdk:path": "lambda-singleton-function-stack/CDKMetadata/Default" - } - } - }, - "Outputs": { - "resttestEndpointXXXXXXXX": { - "Value": { - "Fn::Join": [ - "", - [ - "https://", - { - "Ref": "resttestXXXXXXXX" - }, - ".execute-api.sa-east-1.", - { - "Ref": "AWS::URLSuffix" - }, - "/", - { - "Ref": "resttestDeploymentStageprodXXXXXXXX" - }, - "/" - ] - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/integration_tests/snapshots/test-lambda_python_stack-snapshot.json b/integration_tests/snapshots/test-lambda_python_stack-snapshot.json deleted file mode 100644 index 43478b354..000000000 --- a/integration_tests/snapshots/test-lambda_python_stack-snapshot.json +++ /dev/null @@ -1,692 +0,0 @@ -{ - "Resources": { - "hellonodeServiceRole01BB45E0": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "LambdaPythonStack/hello-node/ServiceRole/Resource" - } - }, - "hellonode2FDD99B8": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "serverless/dd-cdk-construct-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-cdk-construct-integration-test.zip" - }, - "Environment": { - "Variables": { - "DD_LAMBDA_HANDLER": "hello.lambda_handler", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "true", - "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234", - "DD_TAGS": "git.commit.sha:XXXXXXXX,git.repository_url:github.com/DataDog/datadog-cdk-constructs" - } - }, - "Handler": "/opt/nodejs/node_modules/datadog-lambda-js/handler.handler", - "Layers": [ - { - "Fn::Join": [ - "", - [ - "arn:aws:lambda:", - { - "Ref": "AWS::Region" - }, - ":464622532012:layer:Datadog-Node20-x:107" - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:aws:lambda:", - { - "Ref": "AWS::Region" - }, - ":464622532012:layer:Datadog-Extension:55" - ] - ] - } - ], - "MemorySize": 256, - "Role": { - "Fn::GetAtt": [ - "hellonodeServiceRole01BB45E0", - "Arn" - ] - }, - "Runtime": "nodejs20.x", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ], - "Timeout": 10 - }, - "DependsOn": [ - "hellonodeServiceRole01BB45E0" - ], - "Metadata": { - "aws:cdk:path": "LambdaPythonStack/hello-node/Resource", - "aws:asset:path": "asset.XXXXXXXXXXXXX", - "aws:asset:is-bundled": true, - "aws:asset:property": "Code" - } - }, - "hellopythonServiceRoleEBA89F44": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "LambdaPythonStack/hello-python/ServiceRole/Resource" - } - }, - "hellopython5270C3B7": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "serverless/dd-cdk-construct-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-cdk-construct-integration-test.zip" - }, - "Environment": { - "Variables": { - "DD_LAMBDA_HANDLER": "hello.lambda_handler", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "true", - "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234", - "DD_TAGS": "git.commit.sha:XXXXXXXX,git.repository_url:github.com/DataDog/datadog-cdk-constructs" - } - }, - "Handler": "datadog_lambda.handler.handler", - "Layers": [ - { - "Fn::Join": [ - "", - [ - "arn:aws:lambda:", - { - "Ref": "AWS::Region" - }, - ":464622532012:layer:Datadog-Python311:89" - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:aws:lambda:", - { - "Ref": "AWS::Region" - }, - ":464622532012:layer:Datadog-Extension:55" - ] - ] - } - ], - "MemorySize": 256, - "Role": { - "Fn::GetAtt": [ - "hellopythonServiceRoleEBA89F44", - "Arn" - ] - }, - "Runtime": "python3.11", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ], - "Timeout": 10 - }, - "DependsOn": [ - "hellopythonServiceRoleEBA89F44" - ], - "Metadata": { - "aws:cdk:path": "LambdaPythonStack/hello-python/Resource", - "aws:asset:path": "asset.XXXXXXXXXXXXX", - "aws:asset:is-bundled": true, - "aws:asset:property": "Code" - } - }, - "hellogoServiceRole55E8052E": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "LambdaPythonStack/hello-go/ServiceRole/Resource" - } - }, - "hellogoC49842C1": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "serverless/dd-cdk-construct-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-cdk-construct-integration-test.zip" - }, - "Environment": { - "Variables": { - "DD_LAMBDA_HANDLER": "bootstrap", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "true", - "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234", - "DD_TAGS": "git.commit.sha:XXXXXXXX,git.repository_url:github.com/DataDog/datadog-cdk-constructs" - } - }, - "Handler": "bootstrap", - "Layers": [ - { - "Fn::Join": [ - "", - [ - "arn:aws:lambda:", - { - "Ref": "AWS::Region" - }, - ":464622532012:layer:Datadog-Extension:55" - ] - ] - } - ], - "Role": { - "Fn::GetAtt": [ - "hellogoServiceRole55E8052E", - "Arn" - ] - }, - "Runtime": "provided.al2", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ], - "Timeout": 10 - }, - "DependsOn": [ - "hellogoServiceRole55E8052E" - ], - "Metadata": { - "aws:cdk:path": "LambdaPythonStack/hello-go/Resource", - "aws:asset:path": "asset.XXXXXXXXXXXXX", - "aws:asset:is-bundled": true, - "aws:asset:property": "Code" - } - }, - "hellodotnetServiceRoleECADFA84": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "Metadata": { - "aws:cdk:path": "LambdaPythonStack/hello-dotnet/ServiceRole/Resource" - } - }, - "hellodotnet2DAF2A64": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "serverless/dd-cdk-construct-integration-test/dev/XXXXXXXXXXXXX-XXXX-XX-XXXXX:XX:XX.XXXX/dd-cdk-construct-integration-test.zip" - }, - "Environment": { - "Variables": { - "AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper", - "DD_TRACE_ENABLED": "true", - "DD_SERVERLESS_APPSEC_ENABLED": "true", - "DD_MERGE_XRAY_TRACES": "false", - "DD_LOGS_INJECTION": "false", - "DD_SERVERLESS_LOGS_ENABLED": "true", - "DD_CAPTURE_LAMBDA_PAYLOAD": "false", - "DD_FLUSH_TO_LOG": "false", - "DD_SITE": "datadoghq.com", - "DD_API_KEY": "1234", - "DD_TAGS": "git.commit.sha:XXXXXXXX,git.repository_url:github.com/DataDog/datadog-cdk-constructs" - } - }, - "Handler": "HelloWorld::HelloWorld.Handler::SayHi", - "Layers": [ - { - "Fn::Join": [ - "", - [ - "arn:aws:lambda:", - { - "Ref": "AWS::Region" - }, - ":464622532012:layer:dd-trace-dotnet:15" - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:aws:lambda:", - { - "Ref": "AWS::Region" - }, - ":464622532012:layer:Datadog-Extension:55" - ] - ] - } - ], - "MemorySize": 256, - "Role": { - "Fn::GetAtt": [ - "hellodotnetServiceRoleECADFA84", - "Arn" - ] - }, - "Runtime": "dotnet8", - "Tags": [ - { - "Key": "dd_cdk_construct", - "Value": "vX.XX.X" - } - ], - "Timeout": 10 - }, - "DependsOn": [ - "hellodotnetServiceRoleECADFA84" - ], - "Metadata": { - "aws:cdk:path": "LambdaPythonStack/hello-dotnet/Resource", - "aws:asset:path": "asset.XXXXXXXXXXXXX", - "aws:asset:is-bundled": true, - "aws:asset:property": "Code" - } - }, - "CDKMetadata": { - "Type": "AWS::CDK::Metadata", - "Properties": { - "Analytics": "vX:XXXXXX:XXXXXX" - }, - "Metadata": { - "aws:cdk:path": "LambdaPythonStack/CDKMetadata/Default" - }, - "Condition": "CDKMetadataAvailable" - } - }, - "Conditions": { - "CDKMetadataAvailable": { - "Fn::Or": [ - { - "Fn::Or": [ - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "af-south-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "ap-east-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "ap-northeast-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "ap-northeast-2" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "ap-south-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "ap-southeast-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "ap-southeast-2" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "ca-central-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "cn-north-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "cn-northwest-1" - ] - } - ] - }, - { - "Fn::Or": [ - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "eu-central-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "eu-north-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "eu-south-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "eu-west-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "eu-west-2" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "eu-west-3" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "il-central-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "me-central-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "me-south-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "sa-east-1" - ] - } - ] - }, - { - "Fn::Or": [ - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "us-east-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "us-east-2" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "us-west-1" - ] - }, - { - "Fn::Equals": [ - { - "Ref": "AWS::Region" - }, - "us-west-2" - ] - } - ] - } - ] - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file