-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11795 from camlow325/retry_put_bucket_encryption_…
…for_409_conflict resource/aws_s3_bucket: Retry on PutBucketEncryption 409 Errors
- Loading branch information
Showing
6 changed files
with
55 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:enhancement | ||
resource/aws_s3_bucket: Retry on `PutBucketEncryption` HTTP 409 errors due to eventual consistency | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package s3 | ||
|
||
import ( | ||
"github.com/aws/aws-sdk-go/service/s3" | ||
) | ||
|
||
// These should be defined in the AWS SDK for Go. There is an open issue https://github.com/aws/aws-sdk-go/issues/2683 | ||
const ( | ||
BucketCannedACLAwsExecRead = "aws-exec-read" | ||
BucketCannedACLLogDeliveryWrite = "log-delivery-write" | ||
) | ||
|
||
func BucketCannedACL_Values() []string { | ||
result := s3.BucketCannedACL_Values() | ||
result = appendUniqueString(result, BucketCannedACLAwsExecRead) | ||
result = appendUniqueString(result, BucketCannedACLLogDeliveryWrite) | ||
return result | ||
} | ||
|
||
func appendUniqueString(slice []string, elem string) []string { | ||
for _, e := range slice { | ||
if e == elem { | ||
return slice | ||
} | ||
} | ||
return append(slice, elem) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters