ANS-C01 Question 319
Single answerYour team is tasked with deploying a highly available application across multiple AWS regions using infrastructure as code (IaC). You want to ensure that the deployment is automated, repeatable, and includes the configuration of necessary networking resources such as VPCs, subnets, and security groups. Which of the following approaches would be the most appropriate to achieve this?
- A
Use AWS Management Console to manually create the resources in each region and document the process for future reference.
- B
Write a CloudFormation template to define the infrastructure, and use StackSets to deploy it across multiple regions.
- C
Use the AWS CLI to create the resources in one region and replicate the commands manually in other regions.
- D
Develop a Python script using the AWS SDK (Boto3) to create and configure the necessary resources programmatically in each region.
Show answer and explanation
Correct answer: B
Explanation
AWS CloudFormation with StackSets is the best choice for deploying infrastructure as code (IaC) across multiple regions. It allows you to define your desired infrastructure in a declarative template and deploy it consistently across multiple AWS regions using automation. This approach aligns with best practices for multi-region deployments and ensures repeatability, reliability, and scalability.
- A. Incorrect.
This approach does not utilize infrastructure as code (IaC) and is prone to human error. It also lacks repeatability and automation, which are key principles of IaC.
- B. Correct.
Using AWS CloudFormation with StackSets allows you to define infrastructure as code and deploy the same stack across multiple AWS regions automatically. This ensures consistency, repeatability, and high availability.
- C. Incorrect.
While the AWS CLI can provision resources, manually replicating commands in other regions is error-prone and not automated. It does not provide the repeatable and consistent deployment that IaC tools are designed for.
- D. Incorrect.
Using the AWS SDK (Boto3) could automate resource creation, but it requires custom scripting and lacks the declarative, templated approach that CloudFormation provides. This increases development complexity and operational overhead.