MLA-C01 Question 305
Select 2You are working on an AWS Machine Learning project and need to provision and manage the infrastructure for both development and production environments. The development environment requires rapid iteration with less focus on stability, while the production environment demands highly stable and repeatable deployments. Which combination of AWS Infrastructure as Code (IaC) options would best suit these requirements?
- A
Use AWS CloudFormation for both development and production environments to ensure consistency across deployments.
- B
Use AWS CDK for the development environment for flexibility and faster iteration, and AWS CloudFormation for the production environment for stability and repeatability.
- C
Use AWS CDK for the production environment to enable easier code-based modifications and AWS CloudFormation for development to ensure consistency during testing.
- D
Use AWS CloudFormation for the production environment to leverage declarative templates and AWS CDK for the development environment for a more programmatic approach.
Show answer and explanation
Correct answers: B, D
Explanation
AWS CDK and AWS CloudFormation serve different purposes in an Infrastructure as Code (IaC) workflow. AWS CDK provides a programmatic approach, making it ideal for development environments where rapid changes and iterations are required. On the other hand, AWS CloudFormation uses declarative templates, ensuring stable, repeatable, and predictable deployments, making it the preferred choice for production environments. Combining these two tools allows you to optimize for both flexibility during development and stability during production.
- A. Incorrect.
AWS CloudFormation is excellent for ensuring stability and repeatability but is not ideal for rapid iteration in the development environment. Using it for both environments may slow down development.
- B. Correct.
This is a valid combination. AWS CDK offers a programmatic approach and flexibility, ideal for rapid iteration during development, while AWS CloudFormation provides stability and repeatability, which are critical for production deployments.
- C. Incorrect.
Using AWS CDK for the production environment is not ideal because it introduces potential risks of instability due to its programmatic nature, which can lead to less predictable deployments.
- D. Correct.
This is a valid combination. AWS CloudFormation's declarative templates are well-suited for production environments requiring stability, while AWS CDK's programmatic approach is better for development environments where flexibility is needed.