DOP-C02 exam dumps

DOP-C02 practice question 83 of 411

AWS Certified DevOps Engineer - Professional. Professional level, Amazon Web Services. Free question with the correct answer and a full explanation.

DOP-C02 Question 83

Single answer

You are managing a multi-environment setup (development, staging, and production) using AWS CloudFormation. Each environment requires slightly different configuration values, such as instance types, database sizes, and environment-specific tags. You need to ensure these configurations are reusable, maintainable, and easily deployable across environments. Which approach should you choose to manage these environment-specific configurations effectively?

  1. A

    Use separate CloudFormation templates for each environment to define the specific configurations.

  2. B

    Embed environment-specific values directly into the CloudFormation template as hard-coded values.

  3. C

    Utilize CloudFormation parameters and pass environment-specific values during stack creation.

  4. D

    Use AWS CloudFormation StackSets to define environment-specific configurations within a single stack.

Show answer and explanation

Correct answer: C

Explanation

The best practice for managing environment-specific configurations in AWS CloudFormation is to use parameters. Parameters make your templates reusable and allow you to pass environment-specific values dynamically during stack creation. This approach minimizes duplication, simplifies maintenance, and adheres to infrastructure as code best practices.

  • A. Incorrect.

    This approach is not optimal because maintaining separate templates for each environment increases complexity and duplication, which violates best practices for infrastructure as code.

  • B. Incorrect.

    Hard-coding environment-specific values directly into the template makes it less reusable and harder to maintain across multiple environments, violating the principle of DRY (Don't Repeat Yourself).

  • C. Correct.

    This is the correct answer. Using CloudFormation parameters allows you to define reusable templates and provide environment-specific values dynamically at deployment time, ensuring flexibility and maintainability.

  • D. Incorrect.

    While StackSets are useful for managing stacks across multiple AWS accounts or regions, they are not designed for handling environment-specific configurations within the same account. This approach is not the best fit for the given scenario.

Timed practice exam

Take a DOP-C02 practice test under exam conditions

75 questions in 180 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam