Open in4mer opened 5 years ago
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
This kind of thing is one of the reasons I've stopped submitting bugs for hashicorp products
I don't believe this is still the case. After specifying no_device in one of my launch templates, I was able to confirm that the EC2 instance(s) that are part of the Auto Scaling Group do not have that EBS volume attached.
Hi @kylehodgetts,
I'm running into exactly the same issue with AWS provider 4.58.0. Can you please share a configuration to show the usage of no_device
? Appreciate the help.
Thanks.
resource "aws_launch_template" > no_device doesnt work for me, whether proper bool or string true/"true". Using hashicorp/aws v5.17.0 Terraform v1.5.7 on windows_amd64
Here's a workaround. When var is disabled, Launch Template still has a block device listed but but size and type are empty in AWS console. And new instances wont have the extra volume.
block_device_mappings {
device_name = "xvdf"
no_device = var.extra_windows_data_drive_enabled ? false : true # does nothing
ebs {
volume_size = var.extra_windows_data_drive_enabled ? "200" : null
volume_type = var.extra_windows_data_drive_enabled ? "gp3" : null
}
}
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Here's a section out of the
terraform show
after the LCT's been created:Panic Output
no panic
Expected Behavior
According to the documentation of aws_launch_template, block_device_mappings supports no_device, which should not cause an EBS volume to be created at auto-scaling time.
Actual Behavior
auto-scaling time causes an instance with an EBS device to be created & attached to the instance.
Steps to Reproduce
Put a similarly configured launch template into an ASG and scale it up to a single instance, or take an existing auto-scaling group and toss a similar block_device_mappings block in it. Observe.
terraform apply
Important Factoids
The
terraform show
output is from one launch_template that has eight block_device_mappings blocks, with the first ebs{} device no_device set tofalse
. The other three are set totrue
. The state output reflects the actual inputs to the ebs blocks, yes.Results? Four EBS devices created and attached to the instance.
References
6434