-
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
Perpetual diffs / Objects have changed outside of Terraform (v3.70.0+) #23288
Comments
hashicorp/terraform-plugin-sdk#882, available in the next Terraform Plugin SDK v2 release, should offer a way forward on some of these. |
I can confirm that I am still seeing issues with diffs on aws_iam_role assume_role_policy principals with provider 3.74.0. |
I can confirm that I am still seeing issues with diffs on aws_iam_role assume_role_policy principals with provider v4.5.0 |
I can confirm that I am still seeing issues with diffs on aws_iam_role assume_role_policy principals with provider v4.7.0. |
Echoing @jhancock93 with an example:
It detects this as drift that happened outside of terraform:
|
Terraform 1.1.7 Provider AWS 4.8.0 We still have order problem for aws We also have the this one which is not listed:
|
Also seeing this with
Empty strings are empty because they are redacted Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_codeartifact_domain_permissions_policy.main[0] will be updated in-place
~ resource "aws_codeartifact_domain_permissions_policy" "main" {
id = "arn:aws:codeartifact:us-west-2:312851193143:domain/default"
~ policy_document = jsonencode(
~ {
~ Statement = [
~ {
~ Principal = {
~ AWS = [
- "",
- "",
- "",
- "",
- "",
+ "",
"",
- "",
+ "",
+ "",
+ "",
+ "",
"",
+ "",
+ "",
+ "",
"",
- "",
- "",
] |
I have perpetual diff for Environment:
Example output:
|
I am seeing a similar issue with tags on IAM role and policy resources. Is that the same thing being discussed here or should I open a new issue? Example:
If I explicitly set Provider: v4.21.0 |
Seeing related issue with change detection:
Some information redacted. I just added a blank line in code and this update plan will be generated among a lot other similar ones, and apply them won't make any actual change. Add another blank line will trigger the same plan. |
I have the problem with empty
All my roles and policies are detecting this false drift with the tags property. Terraform -v 1.3.2 |
We will close this issue soon after doing more work and research. This way we can determine how much of an issue this continues to be. |
Thank you for your comments!At this point we have fixed many of these issues. However, with a big issue like this, crossing services, it's difficult to assess what's fixed and what still remains as time passes. Because of the quantity of issues fixed, and tests to back the fixes up, we feel confident closing this issue in order to then be able to focus on what remains. In other words, if you have perpetual diffs / |
I don't know the project code well, but I wonder why users have to report such things. The project has integration tests, so it seems to me that after each "apply" in the tests, you can introduce a subtest that will check whether the plan is clean. Many of the cases reported here are quite basic use cases. The tests look like they have a similar structure, so you can either modify some core element from the test framework, or make a bulk refactor and add such a subtest. |
This functionality has been released in v4.50.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
@ad-m-ss I too would think this was easily tested. Unfortunately, though we run 1000s of tests, and specifically re-apply over and over to check this very thing, we don't run across the same problems. There may be other variables like age of accounts or regions at play but since we have a difficult time reproducing the problem despite heavy testing, we also have difficulty pinpointing a fix. |
@YakDriver thanks for additional context here. I appreciate all efforts to development of AWS terraform provider. Overall very good jobs and very helpful in my job. 🐈 |
Yes, seconded. I've been waiting a long time for this to be resolved. You have shown great fortitude through your hard work and we appreciate it. 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. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Only reports after v3.70.0
Many of these issues were fixed with a collection of changes shown in #21968, v3.70.0. The purpose of this issue is to separate the older reports that may or may not be fixed from problems seen in v3.70.0+.
Unfortunately, these differences can be caused by a variety of problems. To have any chance of tackling them, we need to organize exactly what's still a problem, and what exactly the problems are. The causes are nuanced so we need specificity.
Main Causes
computed
that should benil
is interpretted as an empty string or vice versaAffected Services and Resources
aws_backup_plan
-rule
withoutschedule
aws_backup_region_settings
-not_resources
,resources
,condition
aws_codeartifact_domain_permissions_policy
- Principals orderaws_codeartifact_repository_permissions_policy
- Principals orderaws_dms_endpoint
-extra_connection_attributes
conflicting withs3_settings
aws_iam_policy
- Emptytags
(also)aws_iam_role
- Order inassume_role_policy
principalsaws_iam_role
- Emptytags
(also)aws_iam_role
- Emptyinline_policy
aws_mq_configuration
-data
XML argumentaws_s3_bucket_policy
- principals in policyaws_sqs_queue
- order inpolicy
aws_ssoadmin_permission_set_inline_policy
- this seems different than many of the others because of actual substantive changesaws_wafv2_web_acl
-AWSManagedRulesAmazonIpReputationList
Provider References (Open)
Provider References (Closed)
aws_iam_policy_document
when applied to S3 buckets, iam roles, kms keys, etc #11801values
array of length 1 #20456Other References
The text was updated successfully, but these errors were encountered: