
Answer-first summary for fast verification
Answer: Develop a handler function within the AWS CDK application for resource management using AWS SDK, and utilize a CDK custom resource to deploy and trigger a Lambda function for this task during deployment.
Option B is the correct answer. This approach integrates directly into the existing AWS CDK deployment process, making it seamless and requiring the least configuration. By writing a handler function in the AWS CDK application and using AWS SDK calls to check for and delete unused resources, the developer leverages the AWS CDK custom resource to deploy and invoke the Lambda function when the deployment stack runs. This method ensures efficiency by keeping everything within the CDK ecosystem without needing additional external configurations.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company seeks to automate the identification and deletion of unused resources from previous deployments, using a central AWS CDK-managed application across multiple accounts. What is the most seamless and minimally configured solution for this automation?
A
Create a handler function in the AWS CDK application using AWS SDK for resource checks and deletions, then generate a CloudFormation template from a JSON file to deploy a Lambda function for this process during stack updates.
B
Develop a handler function within the AWS CDK application for resource management using AWS SDK, and utilize a CDK custom resource to deploy and trigger a Lambda function for this task during deployment.
C
Write a handler function in the AWS CDK application for checking and removing unused resources with AWS SDK, then establish an AWS Amplify API to deploy a Lambda function for executing this task during stack updates.
D
Compose a handler function in the Lambda console for resource checks and deletions using AWS SDK, and use a CDK custom resource to incorporate this Lambda into the stack, ensuring it runs during deployment.