-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Tag not applied to Elasticache Redis Clusters #5021
Comments
Interestingly, if I manually apply the tags, Terraform just rolls with it. Won't delete them, nor will it bark about them. It's as if it's blind to the tags after an arbitrary point. |
Are folks running into this using a provider that assumes an IAM role cross-account? e.g. using the provider configuration provider "aws" {
# ... other configuration ...
assume_role {
role_arn = "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME"
session_name = "SESSION_NAME"
external_id = "EXTERNAL_ID"
}
} It could be that the account ID saved into the provider during initialization is the source account ID and not the target account ID as defined by the IAM role ARN. |
@bflad We do not assume role in the provider block, but we do assume role before invoking terraform itself. Off to read the links provided. |
@zapman449 is that role in a different AWS account? |
yes. IAM user is in AWS account A, assumes into |
@zapman449 that will definitely be fixed by PR #5060 - we have confirmed it with a patched version of Terraform in use in our CI pipeline at Ticketmaster. |
@potto007 Excellent. Thank you. |
Running into this as well without role assumption, our provider settings:
Tag we want to add applies, and is visible in the statefile, however in AWS it does not show up. Any tweaks in the console, and then re-running a tf plan are also ignored. Like zapman said above, it's as if after running the apply, nothing happens and then terraform is "blind" to the tags. Just wanted to say we're dealing with it as well but unlike @bflad we aren't assuming a role or doing anything cross-account related with the provider. |
Hi folks 👋 For issues related to any cross-account weirdness, using version 1.31.0 of the AWS provider work should hopefully work better in those cases. If you're continuing to still have trouble on that version, it would be great if we could get a Gist with debug logging enabled so we can further troubleshoot. If you are worried about any sensitive data, it can be encrypted with the HashiCorp GPG Key. Thanks! |
I have a similar issue when creating a new aws_elasticache_replication_group tf version 0.11.8 Deploying with a tags block I get:
When I remove the tags it doesn't error and deploys. |
Here is the encrypted Gist @bflad |
@sepulworld that error was returned by the Elasticache API and seems like potentially an Elasticache service issue, but sometimes the AWS APIs don't return the most correct errors. Does that error still occur if you create a new replication group with tags? For others, are you still having the original issue? @zapman449? |
It seems to be resolved @bflad |
Okay, thanks! Let's close this out then. If you're still having problems on recent versions of the AWS provider, please open a new issue with all the details so we can troubleshoot further. 👍 |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
A brief test with v0.11.7 didn't indicate that it would help.
Affected Resource(s)
Terraform Configuration Files
Debug Output
(will provide if requested)
Expected Behavior
The tags get applied to the elasticache instance(s) in question.
Actual Behavior
In AWS, in a few cases, the first 2-3 tags get applied, but not all of them. In a few other cases, no tags get applied.
The Statefile shows the resources as having the tags applied, but when you get them from the AWS API or console, they are not present
We always include
-refresh=true
in our terraform plan runs, and those plans, nor later applies indicate that the tags are wrong.Steps to Reproduce
When I throw together a toy example to reproduce this, I can't. The toy works as expected.
Important Factoids
N/A
References
N/A
The text was updated successfully, but these errors were encountered: