Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set log retention of all CDK-vended custom resources with CustomResourceConfig #31041

Merged
merged 57 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e2c647e
Added method addMetadata for singleton lambda construct tree
awslukeguan Aug 6, 2024
36efff7
Merge branch 'aws:main' into addmetadata
awslukeguan Aug 7, 2024
ca5feda
chore: added metadata option to singleton lambda
awslukeguan Aug 7, 2024
717e058
chore: updated classes.ts to build constructor with statementProps
awslukeguan Aug 7, 2024
8dc2d4e
chore: added internal _logRetention
awslukeguan Aug 7, 2024
eedbfdc
Merge branch 'aws:main' into addmetadata
awslukeguan Aug 8, 2024
24dada7
chore: added custom-resource-config aspects and tests
awslukeguan Aug 8, 2024
f977361
Merge branch 'aws:main' into addmetadata
awslukeguan Aug 8, 2024
0994e1c
Merge branch 'aws:main' into addmetadata
awslukeguan Aug 9, 2024
f5fd4e8
chore: updated classes.ts
awslukeguan Aug 9, 2024
74d4c7a
chore: updated custom-resource-config.ts
awslukeguan Aug 9, 2024
a5d0b95
chore: updated custom-resource-config.test.ts
awslukeguan Aug 9, 2024
33334b4
chore: moving folder
awslukeguan Aug 9, 2024
ae825fb
chore: updated integ test and README.md
awslukeguan Aug 9, 2024
05e675a
chore: updated README.md
awslukeguan Aug 9, 2024
6fc81bd
chore: updated classes.ts
awslukeguan Aug 9, 2024
23536b5
chore: commiting integ snapshot
awslukeguan Aug 9, 2024
8c616ff
Merge branch 'aws:main' into addmetadata
awslukeguan Aug 12, 2024
83bfe14
chore: resolving feedback
awslukeguan Aug 12, 2024
1a0d00c
chore: update integ tests
awslukeguan Aug 12, 2024
0f29ff3
chore: updated README.md
awslukeguan Aug 13, 2024
4cb17d6
chore: updated README.md
awslukeguan Aug 13, 2024
3315ec5
chore: adding metadata to newLogGroup
awslukeguan Aug 13, 2024
d38744a
chore: updated README.md
awslukeguan Aug 13, 2024
c056c58
Merge branch 'aws:main' into addmetadata
awslukeguan Aug 14, 2024
5177213
updated feedback
awslukeguan Aug 14, 2024
add62b9
chore: updated snapshot
awslukeguan Aug 14, 2024
d17f380
chore: customResourceConfig lambdaRuntime
awslukeguan Aug 14, 2024
68450fc
Merge branch 'aws:main' into addmetadata
awslukeguan Aug 14, 2024
1c4f0f3
updated feedback
awslukeguan Aug 14, 2024
4c26ee9
chore: updated snapshot
awslukeguan Aug 14, 2024
10e3e92
Merge branch 'aws:main' into lambdaruntime
awslukeguan Aug 14, 2024
9cf2e5c
chore: updated snapshot
awslukeguan Aug 14, 2024
8a25d12
chore: updated lambda
awslukeguan Aug 14, 2024
f9c8728
chore: working and spacing
awslukeguan Aug 14, 2024
3f146a2
chore: rewinding back lambda changes, leaving deletionPolicy
awslukeguan Aug 14, 2024
806b925
chore: rewinding back deletion policy, leaving logRetention
awslukeguan Aug 14, 2024
508a417
chore: updated README.md
awslukeguan Aug 14, 2024
e2d1e31
chore: fix eslint spacing
awslukeguan Aug 14, 2024
2734c7a
chore: removing integ deletionPolicy
awslukeguan Aug 14, 2024
249052b
updated README.md and unit test
awslukeguan Aug 14, 2024
a5bc8b6
minor adjustments
awslukeguan Aug 15, 2024
7b70151
updated the spacing
awslukeguan Aug 15, 2024
cf87123
Merge branch 'aws:main' into addmetadata
awslukeguan Aug 15, 2024
07d0c4d
update custom-resource-framework test due to modified classes.ts
awslukeguan Aug 15, 2024
976077d
referencing variables from config.ts
awslukeguan Aug 15, 2024
1b8b066
combining import on one line
awslukeguan Aug 15, 2024
dae936e
adding comments to explain
awslukeguan Aug 15, 2024
8d9e4fa
updating integ snapshots
awslukeguan Aug 15, 2024
ee54708
update README.md
awslukeguan Aug 16, 2024
26e3042
update README.md
awslukeguan Aug 16, 2024
e3fadc5
update README.md
awslukeguan Aug 16, 2024
3bd7295
Merge branch 'aws:main' into addmetadata
awslukeguan Aug 16, 2024
5bc66a1
updated test structure and minor changes
awslukeguan Aug 16, 2024
cb1b70e
updated tests
awslukeguan Aug 16, 2024
fbadca8
updated tests
awslukeguan Aug 16, 2024
50125b3
updated tests
awslukeguan Aug 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
{
"Resources": {
"WebsiteBucket75C24D94": {
"Type": "AWS::S3::Bucket",
"Properties": {
"Tags": [
{
"Key": "aws-cdk:cr-owned:156aa6de",
"Value": "true"
}
]
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"LogGroupF5B46931": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
"RetentionInDays": 3653
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"s3deployAwsCliLayerD0CD1E6B": {
"Type": "AWS::Lambda::LayerVersion",
"Properties": {
"Content": {
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "3322b7049fb0ed2b7cbb644a2ada8d1116ff80c32dca89e6ada846b5de26f961.zip"
},
"Description": "/opt/awscli/aws"
}
},
"s3deployCustomResourceDB97D82D": {
"Type": "Custom::CDKBucketDeployment",
"Properties": {
"ServiceToken": {
"Fn::GetAtt": [
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536",
"Arn"
]
},
"SourceBucketNames": [
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
}
],
"SourceObjectKeys": [
"561a8b95d6d62d87513e3607a2de271376251555ee83cf7b93534b0e85c500c8.zip"
],
"SourceMarkers": [
{}
],
"DestinationBucketName": {
"Ref": "WebsiteBucket75C24D94"
},
"Prune": true
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265": {
"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"
]
]
}
]
}
},
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": [
"s3:GetBucket*",
"s3:GetObject*",
"s3:List*"
],
"Effect": "Allow",
"Resource": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":s3:::",
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/*"
]
]
},
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":s3:::",
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
}
]
]
}
]
},
{
"Action": [
"s3:Abort*",
"s3:DeleteObject*",
"s3:GetBucket*",
"s3:GetObject*",
"s3:List*",
"s3:PutObject",
"s3:PutObjectLegalHold",
"s3:PutObjectRetention",
"s3:PutObjectTagging",
"s3:PutObjectVersionTagging"
],
"Effect": "Allow",
"Resource": [
{
"Fn::GetAtt": [
"WebsiteBucket75C24D94",
"Arn"
]
},
{
"Fn::Join": [
"",
[
{
"Fn::GetAtt": [
"WebsiteBucket75C24D94",
"Arn"
]
},
"/*"
]
]
}
]
}
],
"Version": "2012-10-17"
},
"PolicyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF",
"Roles": [
{
"Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265"
}
]
}
},
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C81C01536": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "0158f40002a8c211635388a87874fd4dcc3d68f525fe08a0fe0f014069ae539c.zip"
},
"Environment": {
"Variables": {
"AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem"
}
},
"Handler": "index.handler",
"Layers": [
{
"Ref": "s3deployAwsCliLayerD0CD1E6B"
}
],
"LoggingConfig": {
"LogGroup": {
"Ref": "LogGroupF5B46931"
}
},
"Role": {
"Fn::GetAtt": [
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265",
"Arn"
]
},
"Runtime": "python3.9",
"Timeout": 900
},
"DependsOn": [
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRoleDefaultPolicy88902FDF",
"CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756CServiceRole89A01265"
]
}
},
"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."
}
]
}
}
}
Loading