provider/aws: Make it possible to remove S3 bucket policy #8915
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Due to a bug introduced in #8615 it is impossible to remove a policy as the
policy
field is marked asComputed
and"existing-policy" => ""
is always a no-op if the field isComputed
.There's actually already an acceptance test covering this and it was failing for the past 15 days after merging #8615 , just returning a slightly misleading error message - so I fixed that too in this PR.
I understand the reason for making this field
Computed
was:aws_s3_bucket_policy
after refreshaws_s3_bucket
from deleting the policy which was set in the context ofaws_s3_bucket_policy
- i.e. prevent those resources from fighting with each other(2) can be still achieved without
Computed
- see my third commit.(3) can be still achieved without
Computed
- see my last commit of this PRI remember @stack72 and I discussed recently that there may be some plans in regards to overlapping/nested resources like these - but I don't know what these are - if there are any.
Either way this is now broken, so I think it needs fixing.
Test plan