AWS CloudFormation Best Practices for Continuous Delivery | DOP-C01 Exam Answer

Not Best Practice for CloudFormation in Continuous Delivery Environment

Prev Question Next Question

Question

Your team wants to begin practicing continuous delivery using CloudFormation, to enable automated builds and deployments of the whole, versioned stacks or stack layers.

You have a 3-tier, mission-critical system.

Which of the following is NOT the best practice for using CloudFormation in a continuous delivery environment?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - B.

Some of the best practices for Cloudformation are.

Created Nested stacks.

As your infrastructure grows, common patterns can emerge in which you declare the same components in each of your templates.

You can separate out these common components and create dedicated templates for them.

That way, you can mix and match different templates but use nested stacks to create a single, unified stack.

Nested stacks are stacks that create other stacks.

To create nested stacks, use the AWS::CloudFormation::Stackresource in your template to reference other templates.

Reuse Templates.

After you have your stacks and resources set up, you can reuse your templates to replicate your infrastructure in multiple environments.

For example, you can create environments for development, testing, and production so that you can test changes before implementing them into production.

To make templates reusable, use the parameters, mappings, and conditions sections so that you can customize your stacks when you create them.

For example, you can specify a lower-cost instance type for your development environments compared to your production environment.

But all other configurations and settings remain the same.

For more information on Cloudformation best practices, please visit the below URL:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/best-practices.html

Continuous delivery is an essential DevOps practice that automates the software delivery process. Amazon Web Services (AWS) CloudFormation is a service that allows you to model and provision AWS infrastructure resources using templates. To use CloudFormation in a continuous delivery environment, you should follow some best practices.

Let's analyze the options provided in the question and determine which one is NOT the best practice for using CloudFormation in a continuous delivery environment.

Option A: Use the AWS CloudFormation ValidateTemplate call before publishing changes to AWS. This option is a best practice for using CloudFormation in a continuous delivery environment. Before publishing any changes to AWS, it is crucial to validate the CloudFormation template using the ValidateTemplate API call. This call checks the syntax of the template and confirms whether the template is valid or not. If there is an error in the template, it prevents the deployment of the stack.

Option B: Model your stack in one template, so you can leverage CloudFormation's state management and dependency resolution to propagate all changes. This option is also a best practice for using CloudFormation in a continuous delivery environment. Modeling your stack in one template is essential because it allows CloudFormation to manage the state of your infrastructure resources. The state management feature ensures that your infrastructure is in the desired state, and CloudFormation deploys changes in the correct order based on the resource dependencies.

Option C: Save CloudFormation templates in a source control system such as GitHub so that the scripts can be version controlled. This option is a best practice for using CloudFormation in a continuous delivery environment. Version control is an essential aspect of continuous delivery, and saving your CloudFormation templates in a source control system such as GitHub ensures that you can track changes and roll back if necessary. Version control also makes it easier for multiple team members to collaborate on the same template.

Option D: Parametrize the template and use Mappings to ensure your template works in multiple Regions. This option is also a best practice for using CloudFormation in a continuous delivery environment. Parametrizing your template ensures that you can create multiple stacks from the same template with different parameters, such as region or environment. Mappings are a feature of CloudFormation that allows you to define a set of named values that can be used in your template. This feature is useful for defining resources that are region-specific, such as Amazon Machine Images (AMIs).

In conclusion, all the options listed in the question are best practices for using CloudFormation in a continuous delivery environment. Therefore, there is no answer to the question as stated.