-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find Target Groups by ARN pulled from 0.12 state file #9034
Comments
Hi @npc-adrian 👋 Thanks for submitting this and sorry you are running into trouble here. At first glance, I'm curious if you are utilizing provider configurations across multiple regions for your overall configuration and if maybe the selected provider for this particular resource inside a module changed during the switch to Terraform 0.12 (unrelated to any configuration changes). Would you be able to provide a brief overview of your overall configuration outlining places where For example, I'm able to coerce
|
Hi @bflad. Thanks for getting back to me. All good questions. We supply our AWS settings through environment variables as follows and the region is set to $ env | grep AWS
AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxx
AWS_SECRET_ACCESS_KEY=yyyyyyyyyyyyyyyyyyyyyyyy
AWS_DEFAULT_REGION=eu-west-1
AWS_PROFILE=zzzzz I have also confirmed I can describe the target group using the command you supplied... $ aws --region eu-west-1 elbv2 describe-target-groups --target-group-arn arn:aws:elasticloadbalancing:eu-west-1: <my account>:targetgroup/dev-dev2-blog/a3f1958ff217c688
{
"TargetGroups": [
{
"TargetGroupArn": "arn:aws:elasticloadbalancing:eu-west-1:653789070130:targetgroup/dev-dev2-blog/a3f1958ff217c688",
"TargetGroupName": "dev-dev2-blog",
"Protocol": "HTTP",
"Port": 80,
"VpcId": "vpc-013c64c2fbb574ac2",
"HealthCheckProtocol": "HTTP",
"HealthCheckPort": "traffic-port",
"HealthCheckEnabled": true,
"HealthCheckIntervalSeconds": 30,
"HealthCheckTimeoutSeconds": 5,
"HealthyThresholdCount": 5,
"UnhealthyThresholdCount": 2,
"HealthCheckPath": "/",
"Matcher": {
"HttpCode": "200"
},
"LoadBalancerArns": [
"arn:aws:elasticloadbalancing:eu-west-1:653789070130:loadbalancer/app/dev-dev2/9e3252cff6a19475"
],
"TargetType": "instance"
}
]
} The code is in a module that needs a cloudfront cert from resource "aws_acm_certificate" "cloudfront" {
provider = aws.us_east_1
domain_name = local.site_cdn_fqdn
validation_method = "DNS"
} So we declared 2 providers in the module... provider "aws" {
version = "~> 2.15"
}
provider "aws" {
alias = "us_east_1"
} The former isn't strictly needed but I found I had to We define the providers in the calling HCL... provider "aws" {
# Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
# in your environment to configure user
region = "eu-west-1"
version = "~> 2.15.0"
}
provider "aws" {
alias = "us_east_1"
region = "us-east-1"
version = "~> 2.15.0"
} |
Hi. Has there been any progress on this? It's blocking my 0.12 upgrade. Thanks |
hi even I am receiving the same error when upgrading from 0.11.3 to 0.12.29
looking forward to having any solution for this |
I am seeing this randomly as well, but it's not related to pulling data from the state file (unless the state file was updated on the fly while building infrastructure). I'm using the latest version of terraform (0.14.6), and I'm creating the target group. Even more concerning is that somehow it gets the ARN from the newly created target group, but somehow fails to consider it as valid.
Another TG was created a few lines after I started create the above TG, and this is the relevant logs lines from that run.
It sure smells like some weird race condition in the AWS provider code. |
My issue may be more closely related to #16860 |
While upgrading an AWS load Balancer from terraform 0.11 to terraform 0.12, I am getting an error when I try to run
terraform plan
against 0.12 for the first time.Everything appears to be in order - the resources exist, the state files are not corrupted etc. Details below.
I originally raised this issue against Terraform core but the team asked me to move it to here instead.
Community Note
Terraform Version
Affected Resource(s)
2 ALB Target groups from the upgraded state cannot be found using the ARNs pulled from the newly upgraded state even though the ARNs are valid.
Terraform Configuration Files
Debug Output
Full debug trace here
Panic Output
N/A
Expected Behavior
The plan should succeed.
Actual Behavior
The plan failed.
Steps to Reproduce
terraform plan
using 0.12Important Factoids
I followed the instructions to upgrade from 0.11 to 0.12. It has worked for other terraform projects so I'm pretty sure I did everything right.
The plan fails to find 2 AWS Load Balancer target groups but they are definitely correct when I look in the console. Here are the entries from the state file...
and
I confirmed I could look them up using the AWS CLI. Here's one example.
I also checked that when I can re-initialize and run
terraform plan
against 0.11 sucessfully and that it does not find any changes to be made. Here are the original entries from the 0.11 state.References
I originally raised this issue against Terraform core but the team asked me to move it to here instead.
The text was updated successfully, but these errors were encountered: