CLF-C02 Question 136
Single answerA company is setting up a new AWS environment and needs to deploy resources efficiently while ensuring consistency across multiple environments. The team wants to automate resource creation and management while reducing the risk of manual errors. Which is the most suitable method for achieving these goals?
- A
Use the AWS Management Console to manually create resources in each environment.
- B
Use the AWS CLI to create resources by running commands individually for each environment.
- C
Write Infrastructure as Code (IaC) templates using a service like AWS CloudFormation or Terraform.
- D
Use AWS APIs or SDKs to programmatically create resources in real time for each environment.
Show answer and explanation
Correct answer: C
Explanation
Infrastructure as Code (IaC) is the best choice for scenarios where consistency, automation, and scalability are key requirements. IaC tools like AWS CloudFormation or Terraform allow you to define resources as code, making it easy to deploy, version control, and replicate environments. This reduces the risks associated with manual tasks and improves efficiency, aligning with the goals stated in the scenario.
- A. Incorrect.
Using the AWS Management Console involves manually creating resources, which can lead to inconsistencies and is not scalable for managing multiple environments.
- B. Incorrect.
While the AWS CLI allows programmatic access, running individual commands for each environment can still be error-prone and lacks the efficiency and repeatability of Infrastructure as Code.
- C. Correct.
Infrastructure as Code (IaC) allows you to define resources in code templates, which ensures consistency, reduces manual errors, and supports automation across multiple environments. This is the most suitable option for the given scenario.
- D. Incorrect.
Using AWS APIs or SDKs provides programmatic access but requires custom coding for resource creation and does not inherently ensure consistency or simplicity compared to IaC solutions.