nerdexam
Oracle

1Z0-1067 · Question #18

Your company recently adopted a hybrid cloud architecture which requires them to migrate some of their on-premises web applications to Oracle Cloud Infrastructure OCI). You created a Terraform…

The correct answer is C. terraform apply -auto-approve. Command: refresh The terraform refresh command is used to reconcile the state Terraform knows about (via its state file) with the real-world infrastructure. This can be used to detect any drift from the last-known state, and to update the state file. This does not modify…

Implement OCI Tagging and Governance

Question

Your company recently adopted a hybrid cloud architecture which requires them to migrate some of their on-premises web applications to Oracle Cloud Infrastructure OCI). You created a Terraform template which automatically provisions OCI resources such as compute instances, load balancer, and a database instance. After running the stack using the terraform apply command, it successfully launched the compute Instances and the load balancer, but it failed to create a new database Instance with the following error:

Service error:NotAuthorizedOrNotFound. shape VM.Standard2.4 not found, http status code:

404 You discovered that the resource quotas assigned to your compartment prevent you from using VM.Standard2.4 instance shapes available in your tenancy. You edit the Terraform script and replace the shape with VM.Standard2.2. Which option would you recommend to re-run the terraform command to have required OCI resources provisioned with the least effort?

Options

  • Aterraform apply -target=ocl_database_db_system.db_system
  • Bterraform refresh -target=oci_database_db_system.db_system
  • Cterraform apply -auto-approve
  • Dterraform plan -target=oci_database_db_system.db_system

How the community answered

(38 responses)
  • A
    11% (4)
  • B
    5% (2)
  • C
    82% (31)
  • D
    3% (1)

Explanation

Command: refresh The terraform refresh command is used to reconcile the state Terraform knows about (via its state file) with the real-world infrastructure. This can be used to detect any drift from the last-known state, and to update the state file. This does not modify infrastructure, but does modify the state file. If the state is changed, this may cause changes to occur during the next plan or apply. The terraform plan command is used to create an execution plan. Terraform performs a refresh, unless explicitly disabled, and then determines what actions are necessary to achieve the desired state specified in the configuration files. This command is a convenient way to check whether the execution plan for a set of changes matches your expectations without making any changes to real resources or to the state The terraform apply command is used to apply the changes required to reach the desired state of the configuration, or the pre-determined set of actions generated by a terraform plan execution plan. Adding the -auto-approve option avoids having to type 'yes' at a confirmation prompt Note: Terraform will automatically refresh the state before running a command that would rely on it (such as plan, apply, destroy)

Topics

#Terraform apply#OCI Resource Manager#database provisioning#error remediation

Community Discussion

No community discussion yet for this question.

Full 1Z0-1067 Practice