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

Race condition renaming public access blocks #10587

Closed
acdha opened this issue Oct 21, 2019 · 3 comments · Fixed by #18537
Closed

Race condition renaming public access blocks #10587

acdha opened this issue Oct 21, 2019 · 3 comments · Fixed by #18537
Assignees
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.
Milestone

Comments

@acdha
Copy link
Contributor

acdha commented Oct 21, 2019

If you rename a aws_s3_bucket_public_access_block it will probably get an error on apply. Running the command multiple times will resolve it as presumably would doing a terraform state mv first if you remembered.

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 "me too" comments, 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 Version

Terraform v0.12.12

  • provider.aws v2.33.0
  • provider.external v1.2.0
  • provider.null v2.1.2

Affected Resource(s)

  • aws_s3_bucket_public_access_block

Terraform Configuration Files

resource "aws_s3_bucket_public_access_block" "deployment" {
…
}

Expected Behavior

  • The updated configuration would be deployed

Actual Behavior

Error: Provider produced inconsistent result after apply

When applying changes to aws_s3_bucket_public_access_block.uploads, provider
"aws" produced an unexpected new value for was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

or

Error: error creating public access block policy for S3 bucket (…): OperationAborted: A conflicting conditional operation is currently in progress against this resource. Please try again.
	status code: 409, request id: … host id: …

Steps to Reproduce

  1. terraform apply
@ghost ghost added the service/s3 Issues and PRs that pertain to the s3 service. label Oct 21, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 21, 2019
@acdha
Copy link
Contributor Author

acdha commented Oct 23, 2019

This also affects the ability to destroy resources under some conditions

@bflad bflad added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 30, 2021
@bflad bflad self-assigned this Mar 30, 2021
bflad added a commit that referenced this issue Apr 1, 2021
Reference: #10587
Reference: #16796

Output from acceptance testing:

```
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_basic (38.97s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_removed (56.16s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_updateBasic (87.68s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Empty (12.16s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_MultipleTags (60.16s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Prefix (60.97s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_PrefixAndTags (60.97s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Remove (61.00s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_SingleTag (60.97s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Default (39.98s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Empty (12.14s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Full (39.60s)

--- PASS: TestAccAWSS3BucketInventory_basic (26.27s)
--- PASS: TestAccAWSS3BucketInventory_encryptWithSSES3 (26.34s)
--- PASS: TestAccAWSS3BucketInventory_encryptWithSSEKMS (26.45s)

--- PASS: TestAccAWSS3BucketMetric_basic (26.21s)
--- PASS: TestAccAWSS3BucketMetric_WithEmptyFilter (2.25s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterMultipleTags (46.71s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterPrefix (45.51s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterPrefixAndMultipleTags (46.55s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterPrefixAndSingleTag (45.88s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterSingleTag (46.49s)

--- PASS: TestAccAWSS3BucketNotification_LambdaFunction (45.26s)
--- PASS: TestAccAWSS3BucketNotification_LambdaFunction_LambdaFunctionArn_Alias (40.24s)
--- PASS: TestAccAWSS3BucketNotification_Queue (27.96s)
--- PASS: TestAccAWSS3BucketNotification_Topic (28.53s)
--- PASS: TestAccAWSS3BucketNotification_Topic_Multiple (29.23s)
--- PASS: TestAccAWSS3BucketNotification_update (49.26s)

--- PASS: TestAccAWSS3BucketPublicAccessBlock_basic (29.52s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_BlockPublicAcls (68.84s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_BlockPublicPolicy (68.21s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_disappears (26.48s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_disappears_Bucket (18.16s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_IgnorePublicAcls (68.18s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_RestrictPublicBuckets (68.83s)
```
bflad added a commit that referenced this issue Apr 2, 2021
…18537)

* service/s3: Add d.IsNewResource checks and standardize retry logic

Reference: #10587
Reference: #16796

Output from acceptance testing:

```
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_basic (38.97s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_removed (56.16s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_updateBasic (87.68s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Empty (12.16s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_MultipleTags (60.16s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Prefix (60.97s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_PrefixAndTags (60.97s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Remove (61.00s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_SingleTag (60.97s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Default (39.98s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Empty (12.14s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Full (39.60s)

--- PASS: TestAccAWSS3BucketInventory_basic (26.27s)
--- PASS: TestAccAWSS3BucketInventory_encryptWithSSES3 (26.34s)
--- PASS: TestAccAWSS3BucketInventory_encryptWithSSEKMS (26.45s)

--- PASS: TestAccAWSS3BucketMetric_basic (26.21s)
--- PASS: TestAccAWSS3BucketMetric_WithEmptyFilter (2.25s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterMultipleTags (46.71s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterPrefix (45.51s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterPrefixAndMultipleTags (46.55s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterPrefixAndSingleTag (45.88s)
--- PASS: TestAccAWSS3BucketMetric_WithFilterSingleTag (46.49s)

--- PASS: TestAccAWSS3BucketNotification_LambdaFunction (45.26s)
--- PASS: TestAccAWSS3BucketNotification_LambdaFunction_LambdaFunctionArn_Alias (40.24s)
--- PASS: TestAccAWSS3BucketNotification_Queue (27.96s)
--- PASS: TestAccAWSS3BucketNotification_Topic (28.53s)
--- PASS: TestAccAWSS3BucketNotification_Topic_Multiple (29.23s)
--- PASS: TestAccAWSS3BucketNotification_update (49.26s)

--- PASS: TestAccAWSS3BucketPublicAccessBlock_basic (29.52s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_BlockPublicAcls (68.84s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_BlockPublicPolicy (68.21s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_disappears (26.48s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_disappears_Bucket (18.16s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_IgnorePublicAcls (68.18s)
--- PASS: TestAccAWSS3BucketPublicAccessBlock_RestrictPublicBuckets (68.83s)
```

* resource/aws_s3_bucket_metric: Standardize on S3 Bucket Metrics Configuration friendly name in logging and errors
@github-actions github-actions bot added this to the v3.36.0 milestone Apr 2, 2021
@ghost
Copy link

ghost commented Apr 9, 2021

This has been released in version 3.36.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 for triage. Thanks!

@ghost
Copy link

ghost commented May 2, 2021

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators May 2, 2021
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
Development

Successfully merging a pull request may close this issue.

2 participants