What command will d...
 
Notifications
Clear all

What command will do this?

1 Posts
1 Users
0 Likes
217 Views
(@soquirandolph)
Noble Member
Joined: 2 years ago
Posts: 729
Topic starter  

Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not visible in the attributes of a resource.

What command will do this?

  • A . terraform taint
  • B . terraform apply
  • C . terraform graph
  • D . terraform refresh

Show Answer Hide Answer

Suggested Answer: A

Explanation:

The terraform taint command manually marks a Terraform-managed resource as tainted, forcing it to be destroyed and recreated on the next apply.

This command will not modify infrastructure, but does modify the state file in order to mark a resource as tainted. Once a resource is marked as tainted, the next plan will show that the resource will be destroyed and recreated and the next apply will implement this change. Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not visible in the attributes of a resource. For example: re-running provisioners will cause the node to be different or rebooting the machine from a base image will cause new startup scripts to run.

Note that tainting a resource for recreation may affect resources that depend on the newly tainted resource. For example, a DNS resource that uses the IP address of a server may need to be modified to reflect the potentially new IP address of a tainted server. The plan command will show this if this is the case.

This example will taint a single resource:

$ terraform taint aws_security_group.allow_all

The resource aws_security_group.allow_all in the module root has been marked as tainted. https://www.terraform.io/docs/commands/taint.html

   
Quote

Latest HashiCorp TA-002-P Dumps Valid Version

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Share: