terraform-provider-aws: Breaking change for several resources from 2.51.0 β 2.52.0
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 Versions
terraform -v
Terraform v0.12.23
+ provider.aws v2.51.0
+ provider.kubernetes v1.11.1
+ provider.template v2.1.2
to
terraform -v
Terraform v0.12.23
+ provider.aws v2.52.0
+ provider.kubernetes v1.11.1
+ provider.template v2.1.2
Relevant bit: provider.aws v2.51.0 β 2.52.0.
Affected Resource(s)
- aws_iam_policy_document
- aws_iam_policy
- aws_s3_bucket
Terraform Configuration Files
data "aws_iam_policy_document" "XXX" {
statement {
actions = ...
resources = [
...
]
}
}
resource "aws_iam_policy" "XXX" {
name = "XXX"
path = "/"
policy = data.aws_iam_policy_document.XXX.json
}
resource "aws_s3_bucket" "XXX" {
bucket = ...
acl = "private"
region = "us-east-1"
tags = {
Name = ...
}
}
Expected Behavior
No changes. Infrastructure is up-to-date.
Actual Behavior
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
<= read (data resources)
Terraform will perform the following actions:
# module.XXX.data.aws_iam_policy_document.XXX will be read during apply
# (config refers to values not yet known)
<= data "aws_iam_policy_document" "deployment" {
+ id = (known after apply)
+ json = (known after apply)
+ statement {
+ actions = [
+ ...
]
+ resources = [
+ ...
]
}
}
# module.services.aws_iam_policy.deployment will be updated in-place
~ resource "aws_iam_policy" "XXX" {
...
~ policy = jsonencode(
{
...
}
) -> (known after apply)
}
# module.XXX.aws_s3_bucket.XXX will be updated in-place
~ resource "aws_s3_bucket" "XXX" {
...
- grant {
...
}
...
}
Plan: 0 to add, 7 to change, 0 to destroy.
------------------------------------------------------------------------
Steps to Reproduce
- Bump AWS Provider from 2.51.0 to 2.52.0 and run a plan.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 37
- Comments: 15 (3 by maintainers)
Hi,
Iβm also seeing an issue with how
grantis calculated for the plan. Tested on 2.63.Create a bucket with grant:
terraform apply.terraform planyields an in-place update to add the grant.Output of
terraform planAt this point I could
terraform applyforever, it will always see a change.This is the bucket in the backend state
@ewbankkit I think Iβve seen in the past where terraform can manage something but hasnβt actually been managing it where the provider will silently ignore the diff but maybe thatβs a false memory.
Still, this kind of change feels odd for a minor version bump since I would expect those to be non-breaking.
still having the same issue with provider.aws ~> 2.69 and terraform 0.12.25
Itβs the fact that terraform wants to remove a grant which is created by default whenever a bucket is created that I find confusing - IMO if the grants block isnβt specified then it should leave the default grant alone.
Generated plan