Skip to content
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

Provider produced inconsistent final plan - aws_s3_bucket_replication_configuration #23690

Closed
barakseri1 opened this issue Mar 15, 2022 · 6 comments · Fixed by #23703
Closed
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.

Comments

@barakseri1
Copy link

barakseri1 commented Mar 15, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform version: 1.0.5
aws provider version: 4.5.0

Affected Resource(s)

  • aws_s3_bucket_replication_configuration

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

.
.
.
resource "aws_s3_bucket" "source" {
    provider = aws.source
    bucket = "${var.source_bucket_name}-${var.source_region}"
    tags = var.tags
}

resource "aws_s3_bucket" "destination" {
    bucket = "${var.source_bucket_name}-${var.dc}"
    tags = var.tags
}
.
.
.
resource "aws_s3_bucket_replication_configuration" "replication" {
  depends_on = [aws_s3_bucket_versioning.source]
  provider = aws.source
  role   = aws_iam_role.replication.arn
  bucket = aws_s3_bucket.source.id


  rule {
    filter {}
    status = "Enabled"
    priority = 1
    delete_marker_replication {
      status = "Enabled"
    }

    destination {
      bucket        = aws_s3_bucket.destination.arn
    }
  }
}

Debug Output

https://gist.github.com/barakseri1/53b2a8d3f3887ebc363d7a84c4f6d277

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

First apply creates the resources as expected.
Following applies result in the error provided

  1. terraform apply

Important Factoids

References

  • #0000
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/s3 Issues and PRs that pertain to the s3 service. labels Mar 15, 2022
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 15, 2022
@anGie44
Copy link
Contributor

anGie44 commented Mar 15, 2022

Likely related to #23487

@anGie44
Copy link
Contributor

anGie44 commented Mar 15, 2022

Hi @barakseri1 , thank you for raising this issue. Are you running the first apply with v4.4.0 of the provider and then upgrading to v4.5.0 and running an apply again? Or the steps above are all done with v4.5.0 of the provider? The former is the case in the issue i've linked to above but wanted to double check as I do see a persistent non-empty plan when using the config you've provided but I'm not getting a inconsistent final plan when i solely use v4.5.0 of the provider.

@anGie44 anGie44 added the waiting-response Maintainers are waiting on response from community or contributor. label Mar 15, 2022
@anGie44
Copy link
Contributor

anGie44 commented Mar 15, 2022

One way to work around this for the time being is to provide an id for the rule at creation time so that the upstream AWS API doesn't calculate one for you and thus prevent a diff in terraform

@barakseri1
Copy link
Author

Thanks @anGie44 , sorry for missing that duplicate issue.
Indeed the first apply was with v4.3.0 and the consequent with 4.5.0.

I will try to delete the replication and try again both with 4.5.0, and also will try the workaround you suggested

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Mar 16, 2022
@anGie44
Copy link
Contributor

anGie44 commented Mar 16, 2022

No worries @barakseri1 ! this one brings to light the bug with the id parameter which wasn't seen in the previous issue.

Yes please reach out if you're seeing any additional unexpected behaviors even with the workaround, ty!

@github-actions
Copy link

github-actions bot commented May 9, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
3 participants