-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.regressionPertains to a degraded workflow resulting from an upstream patch or internal enhancement.Pertains to a degraded workflow resulting from an upstream patch or internal enhancement.service/ec2Issues and PRs that pertain to the ec2 service.Issues and PRs that pertain to the ec2 service.
Milestone
Description
Terraform and AWS Provider Version
Terraform v1.13.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v6.16.0Affected Resource(s) or Data Source(s)
- aws_launch_template
Expected Behavior
Apply sucessfully even if kms_key_id is set to an empty string, as most of other arguments of this resource
Actual Behavior
Give the following error:
Error: "block_device_mappings.0.ebs.0.kms_key_id" cannot be shorter than 1 character
Relevant Error/Panic Output
No response
Sample Terraform Configuration
Click to expand configuration
provider "aws" {
region = "us-east-1"
}
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "6.16.0"
}
}
}
data "aws_ssm_parameter" "this" {
name = "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-ebs"
}
resource "aws_launch_template" "this" {
name = "failling_asg"
image_id = data.aws_ssm_parameter.this.value
instance_type = "t3.small"
block_device_mappings {
device_name = "/dev/xvda"
ebs {
delete_on_termination = true
kms_key_id = ""
}
}
}
Steps to Reproduce
- apply
- get the error
Debug Logging
n/a
GenAI / LLM Assisted Development
n/a
Important Facts and References
This code perfectly run with 6.15.0, I guess this is related to the this PR #44505
The current workaround is to change kms_key_id to null instead of empty string. This isn't consistent with most of resources
Would you like to implement a fix?
No
cschindlbeck
Metadata
Metadata
Assignees
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.regressionPertains to a degraded workflow resulting from an upstream patch or internal enhancement.Pertains to a degraded workflow resulting from an upstream patch or internal enhancement.service/ec2Issues and PRs that pertain to the ec2 service.Issues and PRs that pertain to the ec2 service.