ExamQuestions.com

Register
Login
AWS Certified SysOps Administrator Associate Exam Questions

Amazon

AWS Certified SysOps Administrator Associate

67 / 340

Question 67:

Your team uses a CloudFormation template to launch AWS resources for an application. The following script is used in the template to initialize files and install packages in EC2 instances:
UserData:
Fn::Base64:
!Sub |
#!/bin/bash -xe
yum update -y aws-cfn-bootstrap
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig --configsets packages_install --
region us-east-1
The CloudFormation template works well in the us-east-1 region. However, when you try to use the same template in the us-west-1 region, the cfn-init helper script reports an error. How would you modify the script so that the CloudFormation template is portable and can be used in different AWS regions?

Answer options:

A.Modify the cfn-init helper script to be:
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig --configsets packages_install 
--region us-east-1/us-west-1
B.Modify the cfn-init helper script to be:
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig 
--configsets packages_install --region ${AWS::Region}
C.Modify the cfn-init helper script to be:
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig 
--configsets packages_install --region *
D.Modify the cfn-init helper script to be:
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig 
--configsets packages_install --region { "Ref" : "Region" }