ANS-C01 Question 320
Single answerYour team is tasked with deploying a multi-region VPC architecture using Infrastructure as Code (IaC). The solution must enforce consistent configuration across regions, allow for parameterization, and be easily maintainable over time. Which IaC approach would best meet these requirements?
- A
Write custom Python scripts to deploy the VPCs using the AWS SDK (Boto3).
- B
Use AWS CloudFormation with nested stacks and parameter files for VPC deployment.
- C
Leverage the AWS CLI to create VPCs and manually apply configurations across regions.
- D
Use the AWS CDK to define VPC infrastructure in code and deploy it to multiple regions.
Show answer and explanation
Correct answer: D
Explanation
The AWS CDK is the most appropriate choice for deploying a multi-region VPC architecture when considering consistency, maintainability, and ease of use. It enables you to define infrastructure in a programming language, supports parameterization, and integrates seamlessly with AWS CloudFormation for deployment. While other options like AWS CloudFormation can work, the AWS CDK provides a more modern and developer-friendly way to manage complex infrastructure across regions.
- A. Incorrect.
While Python scripts using the AWS SDK (Boto3) can automate tasks, they require significant custom logic for parameterization and enforcing consistent configurations, making this approach less maintainable and error-prone.
- B. Incorrect.
AWS CloudFormation with nested stacks and parameter files is a valid approach for managing multi-region deployments, but it can become complex and less developer-friendly when compared to AWS CDK’s programmatic approach.
- C. Incorrect.
Using the AWS CLI for creating VPCs is not an efficient or scalable IaC solution, as it requires manual intervention and lacks the structure needed for consistent configuration enforcement.
- D. Correct.
The AWS CDK allows you to define VPC infrastructure in code using familiar programming languages, supports parameterization, and is highly maintainable. It is well-suited for multi-region deployments.