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? (Choose the best answer.)
Click on the arrows to vote for the correct answer
A. B. C. D.D.
In this scenario, the Terraform script failed to create a new database instance with the error message "Service error: NotAuthorizedOrNotFound. shape VM.Standard2.4 not found. http status code: 404". After investigating the issue, it was discovered that the resource quotas assigned to the compartment do not allow the use of VM.Standard2.4 instance shapes available in the tenancy.
To resolve this issue, the Terraform script was edited, replacing the shape with VM.Standard2.2, which is allowed within the resource quotas assigned to the compartment.
To re-run the Terraform command with the updated script and provision the required OCI resources, the best option would be to use the "terraform apply" command with the "target" parameter specifying the resource that needs to be updated.
Option A ("terraform plan" with "target" parameter) would only show the changes that need to be made without actually applying them. This would not provision the required OCI resources.
Option B ("terraform apply" with "auto-approve" parameter) would apply all the changes in the Terraform script, including the ones that were previously applied successfully. This would take more effort and time to complete and might cause unexpected changes to the infrastructure.
Option C ("terraform refresh" with "target" parameter) only refreshes the state of the specified resource without making any changes to the infrastructure. This would not provision the required OCI resources.
Option D ("terraform apply" with "target" parameter) would apply only the changes to the specified resource, in this case, the database instance. This would provision the required OCI resources with the least effort and time. Therefore, the correct option is D.