Closed nicon89 closed 2 years ago
That error is coming from AWS, and not terraform-aws-ec2-instance
or the AWS provider. Unfortunately, I believe me-central-1
is still a half baked region, and doesn't have full support of a lot of options.
This is more with the terraform-provider-aws
provider, as it will try to set MetadataOptions.InstanceMetadataTags
to disabled
when instantiating an instance by default. However, if you set MetadataOptions.HttpEndpoint
to disabled
, it should not try to set the InstanceMetadataTags
setting. I don't think this will allow you to use the instance metadata service at all, unfortunately, and I don't have a way to test this.
If you need more, though, you'll probably have to open an issue with the terraform-provider-aws
repo. But I don't think there's a way to not set instance_metadata_tags
in the aws_instance
resource and still have the http metadata. If you try to set it to null, it will still set to disabled
when making the AWS API call.
For terraform-aws-ec2-instance
module, setting:
metadata_options = {
http_endpoint = "disabled"
}
will make the provider not set the instance_metadata_tags
option. But again, will probably break the http metadata access from the instance.
If you want, you can see the API options being sent by using:
β― TF_LOG_PROVIDER=DEBUG && TF_LOG_PATH=/tmp/terraform.log && terraform apply
β― grep -i Action=RunInstances /tmp/terraform.log
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
This issue was automatically closed because of stale in 10 days
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.
Description
I'm unable to create a new EC2 instance in me-central-1 region. It's failing on an error:
Versions
Module version [Required]: 4.1.4
Terraform version: 1.2.8
Provider version(s):
provider registry.terraform.io/hashicorp/aws v4.28.0
provider registry.terraform.io/hashicorp/local v2.0.0
Reproduction Code [Required]
Steps to reproduce the behavior:
no
yes
n/a
Expected behavior
It should allow to unset instance metadata tags.
Actual behavior
It fails on creation of EC2 instance in me-central-1 region.
Terminal Output Screenshot(s)