-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
terraform destroy should ignore output variables #522
Comments
+1 to this. I've also run into this when "terraform apply" fails, leaving only some resources created. It gets even messier when using modules. I have a template that uses an input variable that references a resource created in a module, but if that resource doesn't exist in the state file, then I can't destroy the infrastructure. In this case, it's not a simple matter of commenting out an output variable, because the reference is used in other resources. My only alternative when this happens is to hunt and delete everything in the web console. |
Unless |
This might actually be fixed in master, I just haven't had a chance to check yet. But we did fix a lot of issues around this. |
Ah, I didn't realise it's also used with modules already, I haven't got to modularise my code yet.
Sounds like 0.3.6 is in to come out any day now? |
@errordeveloper Yeah I'm cutting the release now, but depending on internet speeds might not make it to release until tomorrow since I have to step out of the office soon. (Matters if the upload finishes before I get out or not) |
This doesn't appear to have made it into 0.3.6 |
This problem still exists in the very latest version ( provider "aws" {
region = "eu-west-1"
}
resource "aws_vpc" "default" {
cidr_block = "10.12.0.0/16"
}
resource "aws_internet_gateway" "default" {
vpc_id = "${aws_vpc.default.id}"
}
resource "aws_subnet" "public" {
vpc_id = "${aws_vpc.default.id}"
cidr_block = "10.12.0.0/24"
availability_zone = "eu-west-1a"
}
resource "aws_instance" "nat" {
ami = "ami-14913f63"
availability_zone = "eu-west-1a"
instance_type = "t2.micro"
key_name = "coreos-test"
subnet_id = "${aws_subnet.public.id}"
associate_public_ip_address = true
}
output "instance_id" {
value = "${aws_instance.nat.id}"
} The example above will fail as mentioned in #497 so as long as #497 persists, it helps reproducing this issue too.
|
With #1010 this no longer happens. Note @radeksimko that #497 still exists. |
Agreed, this is now fixed. |
…destroy` + Fixed with hashicorp/terraform#522 [#94846602] Signed-off-by: Kristie-Lynne Koss <kkoss@pivotal.io>
Why is this still happening? It's been marked as "fixed" in a couple of different PRs. Why are we looking at the output, when taking action such as |
We're also seeing this with TF version 0.11.7:
|
yes i can confirm this is still happening, specially when my terraform project contains modules and i am running a terraform apply on a destroy it complains when it cant find the resources. |
I confirm the issue is still there, I'm using Terraform v0.11.8 :( |
Still getting the issue with Terraform v0.11.8 while executing
|
with v0.11.9 the same issue |
with v0.11.10 the same issue
|
@mitchellh are you guys looking into this issue? It's still happening on the latest version of terraform |
Guys, if you run terraform with this environment variable, it will change the hard errors for outputs into warnings:
|
@Jamie-BitFlight wonderful. Exactly what I needed. Put it into my It didn't come up in my searches: https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md#0111-november-30-2017 See above ^^^. Looks like it's still "undocumented" from google search. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
For example, I have something like this:
If
terraform destroy
removes the ELB but fails at the VPC (related: #497), I cannot get it to run another time unless I remove the output variable (since the resource it references is gone). I get an error like:After removing the output variable,
terraform destroy
completes successfully.(Using version 0.3.1 on OSX)
The text was updated successfully, but these errors were encountered: