ExamQuestions.com

Register
Login
AWS Certified DevOps Engineer Professional Exam Questions

Amazon

AWS Certified DevOps Engineer Professional

158 / 500

Question 158:

A CloudFormation stack has included several AWS resources including EC2 instances. Previously, it used a mapping table to manage AMI IDs for different regions and instance types. During the creation of the EC2 resource, the AMI ID is received from the function of "Fn::FindInMap". However, you have to correct the mapping table for this approach whenever there is a new AMI ID available. You are looking at other better approaches to fetch the updated AMIs automatically. A Lambda function is already deployed by you to get the latest AMI with the region and instance type as the input. What is the best way to use the Lambda function to achieve this requirement?

Answer options:

A.Before updating/creating the CloudFormation stack, use a shell script to run the Lambda function to get the correct AMI ID. Use the ID as a parameter for the CloudFormation template.
B.Create a Custom resource in the CloudFormation template. Associate the Lambda with the Custom resource by specifying the Amazon Resource Name (ARN) of the Lambda function for the ServiceToken property.
C.Create a Custom resource in the CloudFormation template. In its RequestId property, specify the name of Lambda function to associate it with the Custom resource.
D.Manually trigger the Lambda function and store its output in the Systems Manager Parameter Store. Modify the CloudFormation template to get the latest AMI ID from Parameter store.