Is it possible to remove a resource property in a terraform override configuration.

186 views
Skip to first unread message

Edgar Martinez

unread,
Dec 6, 2016, 7:09:33 PM12/6/16
to Terraform
I have a base configuration in terraform that has a property that I want to remove. In other words I have something that looks like this. 

resource "aws_instance" "web" {
    ami
= "ami-408c7f28"
    tags
= { Name = "hello World"}
}

I want to override it to this, without the tags property in my app_overrides.tf file 

resource "aws_instance" "web" {
    ami
= "ami-408c7f28"
}

Is this possible because right now I can override a configuration but only to add properties not to remove properties on a resource. 

David Adams

unread,
Dec 6, 2016, 7:19:12 PM12/6/16
to terrafo...@googlegroups.com
I've never used overrides, but can you respecify `tags` ?, eg:

    resource "aws_instance" "web" {
      ami = "ami-408c7f28"
      tags {}
    }

Or are submaps merged?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/238b772b-bde8-455b-b5d7-14fd64caaaaf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Edgar Martinez

unread,
Dec 6, 2016, 8:21:19 PM12/6/16
to Terraform
They are merged. I am working with a legacy setup and I don't want to rewrite a bunch of things in order to change one little property. 


On Tuesday, December 6, 2016 at 4:19:12 PM UTC-8, David Adams wrote:
I've never used overrides, but can you respecify `tags` ?, eg:

    resource "aws_instance" "web" {
      ami = "ami-408c7f28"
      tags {}
    }

Or are submaps merged?
On Tue, Dec 6, 2016 at 6:09 PM, Edgar Martinez <ed...@housecanary.com> wrote:
I have a base configuration in terraform that has a property that I want to remove. In other words I have something that looks like this. 

resource "aws_instance" "web" {
    ami
= "ami-408c7f28"
    tags
= { Name = "hello World"}
}

I want to override it to this, without the tags property in my app_overrides.tf file 

resource "aws_instance" "web" {
    ami
= "ami-408c7f28"
}

Is this possible because right now I can override a configuration but only to add properties not to remove properties on a resource. 

--
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.
Reply all
Reply to author
Forward
0 new messages