1Z0-1067-25 Question 23
Single answerYou are responsible for deploying a three-tier web application across multiple environments (development, testing, and production) in Oracle Cloud Infrastructure (OCI). You want to ensure that each environment remains closely aligned with the others and that future updates are managed consistently. Which approach will best help you create replicable stacks and track changes over time using Infrastructure as Code?
- A
Hard-code environment-specific values directly into a single Terraform configuration file for all environments.
- B
Utilize Terraform modules with variable files for each environment and store configurations in a version-controlled repository.
- C
Use the Oracle Cloud Console to manually replicate components for each environment without automation.
- D
Run separate Terraform projects per environment and keep all state files locally on each administrator� machine.
Show answer and explanation
Correct answer: B
Explanation
Using Infrastructure as Code (IaC) in OCI involves creating Terraform configurations (or using Oracle Resource Manager) that can be reused and tracked in source control. Leveraging modules and environment-specific variables is a best practice to enable consistency across environments. Refer to Oracle� documentation on using Terraform with Oracle Resource Manager (https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/resourcemanager.htm) for guidance on structuring your configurations, versioning them, and maintaining centralized state.
- A. Incorrect.
Incorrect. Hard-coding environment-specific values in a single file makes updates complex and error-prone, as changes and environment-specific configurations are not cleanly separated.
- B. Correct.
Correct. By leveraging modules and variable files, you can maintain consistent configurations across environments. Storing these configurations in version control (e.g., Git) enables easier change tracking and collaboration.
- C. Incorrect.
Incorrect. Manually replicating resources via the Console bypasses Infrastructure as Code principles, increasing the risk of drift and inconsistent deployments.
- D. Incorrect.
Incorrect. Storing separate Terraform projects locally for each environment creates coordination challenges and makes it difficult to ensure consistency across multiple environments.