Open
Description
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.
Description
google_compute_instance_template is missing a parameter for the attached_disk block. The GCP API for compute instances attach_disk supports the autoDelete flag. This flag causes the disk to be automatically deleted when the instance is deleted. This is useful for situations where the instances might be deleted manually, or via processes not using Terraform.
New or Affected Resource(s)
- google_compute_instance
Potential Terraform Configuration
resource "google_compute_instance" "my-vm-1" {
name = "my-vm-1"
machine_type = "n1-standard-1"
.....
attached_disk {
source = "my-second-disk"
device_name = "disk2"
auto_delete = true
}
....
}