Skip to content
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

while running terraform destroy it deletes the EBS volume as well along with the instance, we do not want that for production. The EBS volume should just be detached and not destroyed/deleted #17889

Closed
ruchikhanuja opened this issue Apr 18, 2018 · 2 comments

Comments

@ruchikhanuja
Copy link

ruchikhanuja commented Apr 18, 2018

Terraform Version

Terraform v0.11.7

...

Terraform Configuration Files

resource "aws_ebs_volume" "storage" {
availability_zone = "${data.aws_subnet.this.availability_zone}"
type = "${var.ebs_storage_type}"
size = "${var.ebs_storage_size}"
}

resource "aws_volume_attachment" "ebs_assoc" {
depends_on = ["aws_ebs_volume.storage"]
device_name = "/xyz"
volume_id = "${aws_ebs_volume.storage.*.id[count.index]}"
instance_id = "${module.brokers.instance_ids[count.index]}"
skip_destroy = true
}

Debug Output

Crash Output

Expected Behavior

when do terraform destroy only the instance should be destroyed and not the EBS volume

Actual Behavior

with terraform destroy EBS volume is also getting deleted, though skip_destroy = true

Steps to Reproduce

Additional Context

References

@ruchikhanuja ruchikhanuja changed the title while running terraform destroy it destroys the EBS volume as well along with the instance, we do not want that for production. The EBS volume should just be detached and not destroyed while running terraform destroy it deletes the EBS volume as well along with the instance, we do not want that for production. The EBS volume should just be detached and not destroyed Apr 18, 2018
@ruchikhanuja ruchikhanuja changed the title while running terraform destroy it deletes the EBS volume as well along with the instance, we do not want that for production. The EBS volume should just be detached and not destroyed while running terraform destroy it deletes the EBS volume as well along with the instance, we do not want that for production. The EBS volume should just be detached and not destroyed/deleted Apr 18, 2018
@ghost
Copy link

ghost commented Apr 21, 2018

This issue has been automatically migrated to hashicorp/terraform-provider-aws#4293 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-aws#4293.

@ghost
Copy link

ghost commented Apr 3, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants