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.
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)- A2% (1)
- B5% (2)
- C91% (39)
- E2% (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.
Making changes directly via the API endpoint bypasses the IaC code and version control, leading to configuration drift.
Making changes directly via the CLI bypasses the IaC code and version control, leading to configuration drift.
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.
While involving an approval process, directly using the cloud console or a database record still bypasses the IaC code management and version control system.
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
Community Discussion
No community discussion yet for this question.