Skip to content

Commit a67d85f

Browse files
authored
chore(s3): add auto-generated description to custom resource provider for better recognition of the s3 auto-delete lambda functions in AWS console (#13277)
When having a huge amount of lambda functions it's always nice to have a populated description for better determining the "prurpose-at-a-glance" of what this function is doing (in case you cannot deduce that information from lambda's name). Depends on #13275. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 39ab806 commit a67d85f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

packages/@aws-cdk/aws-s3/lib/bucket.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,7 @@ export class Bucket extends BucketBase {
18301830
const provider = CustomResourceProvider.getOrCreateProvider(this, AUTO_DELETE_OBJECTS_RESOURCE_TYPE, {
18311831
codeDirectory: path.join(__dirname, 'auto-delete-objects-handler'),
18321832
runtime: CustomResourceProviderRuntime.NODEJS_12,
1833+
description: `Lambda function for auto-deleting objects in ${this.bucketName} S3 bucket.`,
18331834
});
18341835

18351836
// Use a bucket policy to allow the custom resource to delete

packages/@aws-cdk/aws-s3/test/integ.bucket-auto-delete-objects.expected.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,19 @@
148148
"Arn"
149149
]
150150
},
151-
"Runtime": "nodejs12.x"
151+
"Runtime": "nodejs12.x",
152+
"Description": {
153+
"Fn::Join": [
154+
"",
155+
[
156+
"Lambda function for auto-deleting objects in ",
157+
{
158+
"Ref": "Bucket83908E77"
159+
},
160+
" S3 bucket."
161+
]
162+
]
163+
}
152164
},
153165
"DependsOn": [
154166
"CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092"

0 commit comments

Comments
 (0)