[PROPOSAL] Explicitly ignore resources when planning / applying.

1,726 views
Skip to first unread message

Marcos NiLs

unread,
Aug 10, 2015, 6:56:15 PM8/10/15
to Terraform
Here's my use case scenario: 


I try to use terraform to handle all my infrastructure but sometimes I need to make modifications manually (bypassing terraform) to try some specific things. However, after making these manual changes and trying to apply or plan some other stuff through terraform, it just wants to override my previous manual configurations because it wasn't documented using the tool (which makes sense). 

The first thing that came into my mind upon this situation was to try look for a flag in the apply / plan commands to ignore some specific resources (either by type or name) but unfortunately I couldn't any. What I ended up doing was manually modifying my terraform files with temporary stuff so it doesn't override what I manually changed.

I thought about implementing an -ignore flag to the plan / apply but I wanted to hear your opinion first about it. Maybe there's something I'm doing wrong and my situation can be improved  by doing something else. 

Thoughts?

Marcos.

Andrew Langhorn

unread,
Aug 10, 2015, 7:06:32 PM8/10/15
to terrafo...@googlegroups.com
Can you describe a situation in which you'd need to edit your instance's configuration outside of Terraform because the tool doesn't let you do what you need?

Thanks.
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/42fd5d3b-68c3-4487-b249-4a09f0f2fee3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Marcos NiLs

unread,
Aug 10, 2015, 7:26:44 PM8/10/15
to Terraform
Andrew, 

I'm not saying that the tool doesn't allow me to do what I need, it's just that I want to do it directly in my infrastructure because maybe doing it by terraform involves changing a more stuff that I just don't want do to. 

In my case for example I wanted to create a new AWS ELB with some custom testing configuration and then changing one of my ASGS to point to that loadbalancer and I wanted to do it through the aws console because it's faster and I knew that it wasn't a permanent change. Then, when modifying some other terraform stuff and trying to apply terraform was asking to roll back my changes. 

I don't know, the idea that once you create a resource with terraform you should necessarily use it to make any changes to it (even though it's for testing purpose) is somehow restrictive. That's why I was looking for some option which allowed me to explicitly ignore some resources so I can move on without making any modifications to my current terraform file.

I believe my experience could have been much easier if either terraform provided: 

a) A way to ignore some resources to be applied
b) Allowed me to apply changes only to some specified resources and not every resource in my .tf files.


El lunes, 10 de agosto de 2015, 20:06:32 (UTC-3), Andrew Langhorn escribió:
Can you describe a situation in which you'd need to edit your instance's configuration outside of Terraform because the tool doesn't let you do what you need?

Thanks.

On Monday, 10 August 2015, Marcos NiLs <marco...@gmail.com> wrote:
Here's my use case scenario: 


I try to use terraform to handle all my infrastructure but sometimes I need to make modifications manually (bypassing terraform) to try some specific things. However, after making these manual changes and trying to apply or plan some other stuff through terraform, it just wants to override my previous manual configurations because it wasn't documented using the tool (which makes sense). 

The first thing that came into my mind upon this situation was to try look for a flag in the apply / plan commands to ignore some specific resources (either by type or name) but unfortunately I couldn't any. What I ended up doing was manually modifying my terraform files with temporary stuff so it doesn't override what I manually changed.

I thought about implementing an -ignore flag to the plan / apply but I wanted to hear your opinion first about it. Maybe there's something I'm doing wrong and my situation can be improved  by doing something else. 

Thoughts?

Marcos.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.


--

Paul Hinze

unread,
Aug 11, 2015, 5:11:24 PM8/11/15
to terrafo...@googlegroups.com
Hi Marcos,

Good discussion here so far - selectively ignoring / avoiding changes is definitely a use case that we want Terraform to support.

a) A way to ignore some resources to be applied

The thread to track here is the proposed "ignore_changes" meta-parameter: https://github.com/hashicorp/terraform/issues/2018

b) Allowed me to apply changes only to some specified resources and not every resource in my .tf files.

Terraform can do this today! Both `terraform plan` and `terraform apply` accept one or more `-target` flags to scope down the action to just targeted resources.

See:


Hope this helps!

Paul


Thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.


--

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/23f4c847-0270-4310-979b-01a4abc4ac2c%40googlegroups.com.

Ryan Kelley

unread,
Aug 21, 2015, 9:04:11 PM8/21/15
to Terraform
i may be off here but wouldn't this be a simple way for terraform to manage existing resources ? i have an in place VPC and yes i understand there are hacks to get this into the state file . i worried about a bug or an update downline the line taking it out , if i could just say ignore the VPC for now and then at a later time when in place resources are fully supported , seems like it might work. 
Reply all
Reply to author
Forward
0 new messages