CloudFormation Flashcards
You are looking at implementing automatic deployment of an application as part of a CI/CD process.
The application uses two CloudFormation stacks,
one which creates a VPC and associated resources
and the other which creates the application resources such as EC2 and RDS.
The VPC and Application resources have separate
lifecycles. This generally means defining them in
two stacks. By using cross stack references you
can deploy application stacks which reference the
VPC stack & allow for many application stacks per
VPC stack.
Which product or features should you use
to ensure instances are configured in a certain way
when launched, don’t go into service until fully configured and can be updated using CFN in the future
cfn-hup, cfn-init & cfn-signal
A leading commercial bank discovered an issue with their online banking system that is hosted on their Auto Scaling group and scaled out to over 60 EC2 instances. The Auto Scaling group is taking multiple nodes offline at the same time whenever you update the Launch Configuration. To update the system, the development team decided to use AWS CloudFormation by changing a parameter to the latest version of the code.
What can you do to limit the impact on customers while the update is being performed?
In the CloudFormation template, add the UpdatePolicy attribute and then enable the WaitOnResourceSignals property. In the user data script, append a health check to signal CloudFormation that the update has been successfully completed.
NO DependsON and Wait condition
A SysOps Administrator has been instructed to handle the deployment of the cloud resources in a single AWS account using CloudFormation. The Administrator must develop a unified template that can be reused for multiple environments instead of manually copying and pasting the same configurations into the template. The dedicated template will be used and referenced from within other templates in the same AWS Region. If the template has been updated, any stack that is referencing it will automatically use the updated configuration.
How can the Administrator meet this requirement?
Nested stacks are stacks created as part of other stacks. You can create a nested stack within another stack by using the AWS::CloudFormation::Stack resource.
A SysOps Administrator needs to create a CloudFormation template that should automatically rollback in the event that the entire stack failed to launch. The application stack requires the pre-requisite packages to be installed first in order for it to run properly, which could take about an hour or so to complete.
What should the Administrator add in the template to accomplish this requirement?
In the ResourceSignal parameter of the CreationPolicy resource attribute, add a Timeout property with a value of 2 hours.
NOT DependsON
A company is heavily using AWS CloudFormation templates to automate the deployment of their cloud resources. The SysOps Administrator needs to write a template that will automatically copy objects from an existing S3 bucket into the new one.
Which of the following is the most suitable configuration for this scenario?
Set up an AWS Lambda function and configure it to perform the copy operation. Integrate the Lambda function to the Cloudformation template as a custom resource.
A multinational investment bank plans to adopt a hybrid cloud architecture. To migrate their on-premises applications to AWS Cloud, the SysOps Administrator should prepare a couple of CloudFormation templates that will automatically provision the required resources.
Which section is required when designing a template?
Resources section
NOT Parameters, as they are optional
A SysOps Administrator uses AWS CloudFormation to update the resources configuration. After updating the CloudFormation stack, they saw the status UPDATE_ROLLBACK_FAILED. To return the stack to its original state, they must fix the cause of the failure.
Which of the following options would you implement to satisfy the above requirement?
Manually fix the error that causes the update rollback to fail. Select stack actions and choose continue update rollback.
A financial company has recently developed a suite of web applications that should be deployed in AWS. You have been asked to create a CloudFormation template for each application that would automatically launch the required AWS resources. To make the deployments manageable, you need to configure the template so that values are based on the region in which the template is launched in.
Which of the following section in the template can help you accomplish this?
Mappings.
NOT Conditions