Closed tomer-ds closed 5 months ago
@tomer-ds Thanks for raising this issue 👏.
The Version
argument in the DescribeLaunchTemplates
API call is actually the (EC2) API version, not the launch template version.
It looks like the underlying problem is the incorrect AWS Region setting.
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!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v1.1.9 on windows_amd64
Affected Resource(s)
Terraform Configuration Files
AWS Access and Secret keys in this instance are passed using environment variables
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
https://gist.github.com/tomer-ds/de40b167efc6cb56bfaa1104f6d8c33e
Panic Output
Expected Behavior
The existing launch template would be found and imported successfully
Actual Behavior
Import failed on non-existent remote object even though it does exist in the given account and region
Steps to Reproduce
terraform workspace select <relevant workspace>
terraform init
terraform import aws_launch_template.lt_agents lt-0e9390657d61a7312
Important Factoids
AWS Credentials are set using env vars but have also tested by configuring default shell credentials as well as aws cli credentials and region.
The output of
aws ec2 describe-launch-templates
with only shell and AWS cli credentials and defaults configuredAdding a configuration for a aws_launch_template data source and an output for the ID results in successful output of the existing LT ID
output "lt_agent_lt_id" { value = data.aws_launch_template.default.id }
will result in the output
References
0000