nerdexam
HashiCorp

TA-002-P · Question #383

As a member of an operations team that uses infrastructure as code (laC) practices, you are tasked with making a change to an infrastructure stack running in a public cloud. Which pattern would…

The correct answer is C. Submit a pull request and wait for an approved merge of the proposed changes. IaC best practices for changing infrastructure involve using version control workflows, such as submitting a pull request, to ensure changes are reviewed, approved, and tracked.

Understand infrastructure as code (IaC) concepts

Question

As a member of an operations team that uses infrastructure as code (laC) practices, you are tasked with making a change to an infrastructure stack running in a public cloud. Which pattern would follow laC best practices for making a change?

Options

  • AMake the change via the public cloud API endpoint
  • BMake the change programmatically via the public cloud CLI
  • CSubmit a pull request and wait for an approved merge of the proposed changes
  • DUse the public cloud console to make the change after a database record has been approved
  • EClone the repository containing your infrastructure code and then run the code

How the community answered

(43 responses)
  • A
    2% (1)
  • B
    5% (2)
  • C
    91% (39)
  • E
    2% (1)

Why each option

IaC best practices for changing infrastructure involve using version control workflows, such as submitting a pull request, to ensure changes are reviewed, approved, and tracked.

AMake the change via the public cloud API endpoint

Making changes directly via the API endpoint bypasses the IaC code and version control, leading to configuration drift.

BMake the change programmatically via the public cloud CLI

Making changes directly via the CLI bypasses the IaC code and version control, leading to configuration drift.

CSubmit a pull request and wait for an approved merge of the proposed changesCorrect

Submitting a pull request for proposed infrastructure changes ensures that modifications are reviewed by peers, approved for correctness and adherence to standards, and tracked within a version control system, aligning perfectly with IaC principles of collaboration, auditing, and traceability. This prevents direct, unreviewed changes to the infrastructure definition.

DUse the public cloud console to make the change after a database record has been approved

While involving an approval process, directly using the cloud console or a database record still bypasses the IaC code management and version control system.

EClone the repository containing your infrastructure code and then run the code

While cloning the repository and running the code is part of the process, the best practice for making changes involves a review and approval step, which a pull request facilitates, before the code is actually run against the infrastructure. Simply running it immediately upon cloning does not guarantee best practices without a review loop.

Concept tested: IaC change management best practices

Source: https://developer.hashicorp.com/terraform/intro/use-cases/infrastructure-as-code

Topics

#IaC best practices#Version control#Change management#Code review

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice