作者:Rac__hel黄蓉 | 来源:互联网 | 2024-10-11 13:58
Hi there,
Terraform Version
1 2
| Terraform v0.10.6
provider.aws: version = "~> 1.3" |
Affected Resource(s)
Terraform Configuration Files
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| hcl
resource "aws_ebs_volume" "ebs_master-eu-west-1a" {
availability_zone = "eu-west-1a"
size = 100
type = "gp2"
encrypted = false
tags {
Name = "ebs_master-eu-west-1a"
}
}
resource "aws_volume_attachment" "ebs_master-eu-west-1a" {
device_name = "/dev/sdc"
skip_destroy = true
volume_id = "${aws_ebs_volume.ebs_master-eu-west-1a.id}"
instance_id = "${aws_instance.master-eu-west-1a.id}"
} |
Expected Behavior
If you use the 'block_device' mapping within the aws_instance resource definition you can prevent it from being destroyed upon termination:
https://www.terraform.io/docs/providers/aws/r/instance.html#delete_on_termination-1
But this does option not appear in the ebs_volume resource:
https://www.terraform.io/docs/providers/aws/r/ebs_volume.html
Please can this flag also be added to the
resource?
Actual Behavior
Volume is destroyed/deleted
Steps to Reproduce
该提问来源于开源项目:hashicorp/terraform-provider-aws
Totally agree with .
Extremely necessary.