hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.83k stars 9.19k forks source link

[Bug]: `aws_dynamodb_table_item`s created in a Global Table have spurious attributes added #30690

Open gdavison opened 1 year ago

gdavison commented 1 year ago

Terraform Core Version

N/A

AWS Provider Version

4.62.0

Affected Resource(s)

aws_dynamodb_table_item

Expected Behavior

When there are no changes to an aws_dynamodb_table_item in a Global Table, there should be no diff reported

Actual Behavior

When using "Legacy" (v2017.11.29) Global Tables, the replication engine adds the following attributes to each item (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables_HowItWorks.html):

These attributes should be ignored by the provider.

The provider reports a diff like the following:

  ~ resource "aws_dynamodb_table_item" "item" {
       id         = "doormat-configuration|key||ssh_sign_ttl_config|"
     ~ item       = jsonencode(
         ~ {
             - aws:rep:deleting     = {
                 - BOOL = false
               } -> null
             - aws:rep:updateregion = {
                  - S = "us-east-1"
                } -> null
              - aws:rep:updatetime   = {
                  - N = "1678818915.260001"
                } -> null
                # (1 unchanged element hidden)
            }
        )
        # (2 unchanged attributes hidden)
    }

Confirm that "Current" (v2019.11.21) Global Tables do not have a similar problem.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

N/A

Steps to Reproduce

N/A

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

dpowley commented 1 year ago

also seeing that this is a problem for global tables on v2017.11.29 and is not a problem for global tables on version v2019.11.21