Topic 1 Question 466
A company has created an AWS CloudFormation template that consists of the AWS::EC2::Instance resource and a custom CloudFormation resource. The custom CloudFormation resource is an AWS Lambda function that attempts to run automation on the Amazon EC2 instance.
During testing, the Lambda function fails because the Lambda function tries to run before the EC2 instance is launched.
Which solution will resolve this issue?
Add a DependsOn attribute to the custom resource. Specify the EC2 instance in the DependsOn attribute.
Update the custom resource's service token to point to a valid Lambda function.
Update the Lambda function to use the cfn-response module to send a response to the custom resource.
Use the Fn::If intrinsic function to check for the EC2 instance before the custom resource runs.
ユーザの投票
コメント(3)
- 正解だと思う選択肢: A
option A for sure..
👍 2Aamee2024/10/27 ChatGPT states Depends On>>answer is A
👍 1numark2024/11/19- 正解だと思う選択肢: A
The DependsOn attribute in an AWS CloudFormation template specifies that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, CloudFormation ensures that the resource specified in the DependsOn attribute is created before the resource that declares the DependsOn. Therefore, by adding a DependsOn attribute to the custom CloudFormation resource and specifying the EC2 instance in it, CloudFormation will not attempt to create the custom resource until the EC2 instance has been successfully created and launched.
👍 1numark2024/12/07
シャッフルモード