Skip to content

Commit

Permalink
snapshots for aws-lambda log-retention integ test
Browse files Browse the repository at this point in the history
Signed-off-by: Francis <colifran@amazon.com>
  • Loading branch information
colifran committed Jul 22, 2023
1 parent b963f0c commit 2013faf
Show file tree
Hide file tree
Showing 8 changed files with 32,412 additions and 48 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
}
},
"9ae8c4b45bebf20d67ad67d5914bc6ad29db158779984055a9c97d316df88513": {
"aec79e601835356e7fe0a6346e358aeb3d79fca4c06b2b5d4302490ecbb92172": {
"source": {
"path": "aws-cdk-lambda-log-retention.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "9ae8c4b45bebf20d67ad67d5914bc6ad29db158779984055a9c97d316df88513.json",
"objectKey": "aec79e601835356e7fe0a6346e358aeb3d79fca4c06b2b5d4302490ecbb92172.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
"Code": {
"ZipFile": "exports.handler = (event) => console.log(JSON.stringify(event));"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"OneWeekServiceRole05A6F9F8",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs14.x"
},
"DependsOn": [
Expand All @@ -70,29 +70,6 @@
]
]
},
"LogGroupArn": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":logs:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":log-group:/aws/lambda/",
{
"Ref": "OneWeekFE56F6A4"
}
]
]
},
"RetentionInDays": 7
}
},
Expand Down Expand Up @@ -285,14 +262,14 @@
"Code": {
"ZipFile": "exports.handler = (event) => console.log(JSON.stringify(event));"
},
"FunctionName": "OneMonthFunction",
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"OneMonthServiceRoleFBD1064F",
"Arn"
]
},
"FunctionName": "OneMonthFunction",
"Handler": "index.handler",
"Runtime": "nodejs14.x",
"Tags": [
{
Expand Down Expand Up @@ -329,6 +306,8 @@
]
]
},
"RetentionInDays": 30,
"PropagateTags": true,
"LogGroupArn": {
"Fn::Join": [
"",
Expand All @@ -352,9 +331,11 @@
]
]
},
"RetentionInDays": 30,
"PropagateTags": true,
"Tags": [
{
"Key": "dept",
"Value": "sales"
},
{
"Key": "env",
"Value": "prod"
Expand Down Expand Up @@ -395,6 +376,10 @@
{
"Key": "dept",
"Value": "eng"
},
{
"Key": "env",
"Value": "gamma"
}
]
}
Expand All @@ -405,19 +390,23 @@
"Code": {
"ZipFile": "exports.handler = (event) => console.log(JSON.stringify(event));"
},
"FunctionName": "OneYearFunction",
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"OneYearServiceRole24D47762",
"Arn"
]
},
"FunctionName": "OneYearFunction",
"Handler": "index.handler",
"Runtime": "nodejs14.x",
"Tags": [
{
"Key": "dept",
"Value": "eng"
},
{
"Key": "env",
"Value": "gamma"
}
]
},
Expand Down Expand Up @@ -445,6 +434,8 @@
]
]
},
"RetentionInDays": 365,
"PropagateTags": true,
"LogGroupArn": {
"Fn::Join": [
"",
Expand All @@ -468,8 +459,6 @@
]
]
},
"RetentionInDays": 365,
"PropagateTags": true,
"Tags": [
{
"Key": "dept",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "32.0.0",
"files": {
"f60471a7e85ebae9c2d317b383218cc3ebc6ef967337fd62cd5105a0cdeab396": {
"source": {
"path": "asset.f60471a7e85ebae9c2d317b383218cc3ebc6ef967337fd62cd5105a0cdeab396.bundle",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "f60471a7e85ebae9c2d317b383218cc3ebc6ef967337fd62cd5105a0cdeab396.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"4a02815f85b828552bfbc5840ecdd41f1904422fb75b070611102c6f0fb4e652": {
"source": {
"path": "awscdkinteglambdalogretentionDefaultTestDeployAssertD83F96C9.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "4a02815f85b828552bfbc5840ecdd41f1904422fb75b070611102c6f0fb4e652.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
{
"Resources": {
"AwsApiCallCloudWatchLogslistTagsLogGroup8ed0ac90ccd4fa87bd5c62a8329b3725": {
"Type": "Custom::DeployAssert@SdkCallCloudWatchLogslistTagsLogGroup",
"Properties": {
"ServiceToken": {
"Fn::GetAtt": [
"SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F",
"Arn"
]
},
"service": "CloudWatchLogs",
"api": "listTagsLogGroup",
"expected": "{\"$ObjectLike\":{\"tags\":{\"env\":\"prod\",\"dept\":\"sales\"}}}",
"parameters": {
"logGroupName": "\"/aws/lambda/OneMonthFunction\""
},
"flattenResponse": "false",
"salt": "1689991612223"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
}
}
]
},
"ManagedPolicyArns": [
{
"Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
}
],
"Policies": [
{
"PolicyName": "Inline",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"logs:ListTagsLogGroup"
],
"Effect": "Allow",
"Resource": [
"*"
]
},
{
"Action": [
"logs:ListTagsLogGroup"
],
"Effect": "Allow",
"Resource": [
"*"
]
}
]
}
}
]
}
},
"SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Runtime": "nodejs18.x",
"Code": {
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "f60471a7e85ebae9c2d317b383218cc3ebc6ef967337fd62cd5105a0cdeab396.zip"
},
"Timeout": 120,
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73",
"Arn"
]
}
}
},
"AwsApiCallCloudWatchLogslistTagsLogGroup14d9a178044977ae7c394809f52b8df9": {
"Type": "Custom::DeployAssert@SdkCallCloudWatchLogslistTagsLogGroup",
"Properties": {
"ServiceToken": {
"Fn::GetAtt": [
"SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F",
"Arn"
]
},
"service": "CloudWatchLogs",
"api": "listTagsLogGroup",
"expected": "{\"$ObjectLike\":{\"tags\":{\"dept\":\"eng\"}}}",
"parameters": {
"logGroupName": "\"/aws/lambda/OneYearFunction\""
},
"flattenResponse": "false",
"salt": "1689991612224"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
}
},
"Outputs": {
"AssertionResultsAwsApiCallCloudWatchLogslistTagsLogGroup8ed0ac90ccd4fa87bd5c62a8329b3725": {
"Value": {
"Fn::GetAtt": [
"AwsApiCallCloudWatchLogslistTagsLogGroup8ed0ac90ccd4fa87bd5c62a8329b3725",
"assertion"
]
}
},
"AssertionResultsAwsApiCallCloudWatchLogslistTagsLogGroup14d9a178044977ae7c394809f52b8df9": {
"Value": {
"Fn::GetAtt": [
"AwsApiCallCloudWatchLogslistTagsLogGroup14d9a178044977ae7c394809f52b8df9",
"assertion"
]
}
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"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."
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"version": "32.0.0",
"testCases": {
"integ.log-retention": {
"aws-cdk-integ-lambda-log-retention/DefaultTest": {
"stacks": [
"aws-cdk-lambda-log-retention"
],
"diffAssets": false,
"stackUpdateWorkflow": true
"assertionStack": "aws-cdk-integ-lambda-log-retention/DefaultTest/DeployAssert",
"assertionStackName": "awscdkinteglambdalogretentionDefaultTestDeployAssertD83F96C9"
}
},
"synthContext": {},
"enableLookups": false
}
}
Loading

0 comments on commit 2013faf

Please sign in to comment.