Building a Nested Infrastructure for AWS DevOps: Best Practices

Best Practices for Designing a CloudFormation Template

Prev Question Next Question

Question

You are working as an AWS DevOps admins for your company.

You are in charge of building a nested infrastructure for the company's development teams using CloudFormation.

The template will include building the VPC and networking components installing a LAMP stack and securing the created resources.

As per the AWS best practices, what is the best way to design this template?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - D.

Creating multiple cloudformation templates is an example of using nested stacks.

The advantage of using nested stacks is given below as per the AWS documentation.

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::Stack resource in your template to reference other templates.

For more information on Cloudformation best practices, please refer to the below link:

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

As an AWS DevOps Admin, when building a nested infrastructure for the company's development teams using CloudFormation, it is important to consider the AWS best practices. The best way to design this template would be to create multiple CloudFormation templates for each set of logical resources.

Option A: Create a single CloudFormation template to create all the resources since it would be easier from the maintenance perspective.

This approach is not recommended as it can make the CloudFormation template too complex and difficult to maintain. A single CloudFormation template may contain too many resources, making it challenging to debug, test, and modify specific sections. It can also create a single point of failure, meaning that if the template fails, it can cause the entire infrastructure to crash.

Option B: Create multiple CloudFormation templates based on the number of VPC's in the environment.

This approach is also not recommended as it creates multiple templates, each for different VPCs. It can lead to inconsistency in the design, making it challenging to manage and troubleshoot. It can also lead to duplication of effort, where the same resources may be created in multiple templates, leading to additional maintenance work.

Option C: Create multiple CloudFormation templates based on the number of development groups in the environment.

This approach is not recommended as it creates multiple templates for each development group, which can lead to inconsistency in the design. It can also make it challenging to manage and troubleshoot, as the resources for different groups are distributed across multiple templates.

Option D: Create multiple CloudFormation templates for each set of logical resources, one for networking, the other for LAMP stack creation.

This approach is the recommended way to design the CloudFormation template. It involves creating multiple templates, each for a specific set of resources, such as networking or LAMP stack creation. It allows for the logical separation of resources, making it easier to manage and troubleshoot the infrastructure. It also provides better scalability, as new resources can be added or removed independently, without affecting the rest of the infrastructure.

In summary, when building a nested infrastructure for the company's development teams using CloudFormation, the best way to design the template is to create multiple CloudFormation templates for each set of logical resources, such as networking or LAMP stack creation. This approach provides better scalability, logical separation of resources, and easier management and troubleshooting of the infrastructure.