Closed cn00 closed 3 weeks ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @cn00 👋 Thank you for taking the time to raise this! While the argument that you're setting within the aws_launch_template
argument is called kms_key_id
, an ARN is expected here (note: the naming of this matches the underlying API). With that in mind, using aws_kms_key.ebs.arn
as the value for that argument is the correct solution.
As far as the error that you received when using that value, the key detail is here:
# Termination Reason: Client.InvalidKMSKey.InvalidState:
# The KMS key provided is in an incorrect state
I found what seems to be a fairly helpful post in AWS' forums. Ultimately the error message points to an issue with the state of the KMS key (in all likelihood a configuration issue), rather than the aws_launch_template
resource itself. With that in mind, I'm going to close this issue. If you experience unexpected behavior with the provider in the future, please do let us know!
[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.
Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.
@justinretzolk Hi Justin, i have the same problem. The plan is showing me, the kms id and not the arn. The user is then inclined to use the kms id as parameter for the parameter kms_key_id, but then again the plan fails, because it is not an arn. This seems inconsistent. The state file shows the arn of kms.
I would suggest to either get the arn as kms_key_id from the plan or you can use the kms id as kms_key_id, but in this way, as it is currently, there seems no way to fix the terraform configuration without changing the resource.
Terraform Core Version
1.9.x
AWS Provider Version
5.50+
Affected Resource(s)
Expected Behavior
success launching a new EC2 instance
Actual Behavior
aws_launch_template.block_device_mapping.ebs.kms_key_id is not accept arn now, maybe this is due to the recent updates of aws
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Debug Output
No response
Panic Output
Important Factoids
No response
References
Would you like to implement a fix?
Yes