Skip to content

Commit

Permalink
chore(s3): add auto-generated description to custom resource provider…
Browse files Browse the repository at this point in the history
… 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*
  • Loading branch information
robertd authored Feb 25, 2021
1 parent 39ab806 commit a67d85f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-s3/lib/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,7 @@ export class Bucket extends BucketBase {
const provider = CustomResourceProvider.getOrCreateProvider(this, AUTO_DELETE_OBJECTS_RESOURCE_TYPE, {
codeDirectory: path.join(__dirname, 'auto-delete-objects-handler'),
runtime: CustomResourceProviderRuntime.NODEJS_12,
description: `Lambda function for auto-deleting objects in ${this.bucketName} S3 bucket.`,
});

// Use a bucket policy to allow the custom resource to delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,19 @@
"Arn"
]
},
"Runtime": "nodejs12.x"
"Runtime": "nodejs12.x",
"Description": {
"Fn::Join": [
"",
[
"Lambda function for auto-deleting objects in ",
{
"Ref": "Bucket83908E77"
},
" S3 bucket."
]
]
}
},
"DependsOn": [
"CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092"
Expand Down

0 comments on commit a67d85f

Please sign in to comment.