[stable-2.9] aws_s3 - wait for the bucket before setting ACLs (#61735) (#61768)

* [stable-2.9] aws_s3 - wait for the bucket before setting ACLs (#61735)

* Wait for the bucket to become available if possible before setting ACLs
(cherry picked from commit 91ccb03552)

Co-authored-by: Sloane Hertel <shertel@redhat.com>

* s3 - improve waiting for the bucket (#61802)

(cherry picked from commit ff05991265)
pull/61818/head
Sam Doran 5 years ago committed by Toshio Kuratomi
parent 9ff8d8d898
commit 23a79ecc77

@ -0,0 +1,2 @@
bugfixes:
- aws_s3 - Try to wait for the bucket to exist before setting the access control list.

@ -389,6 +389,9 @@ def create_bucket(module, s3, bucket, location=None):
s3.create_bucket(Bucket=bucket, CreateBucketConfiguration=configuration)
else:
s3.create_bucket(Bucket=bucket)
if module.params.get('permission'):
# Wait for the bucket to exist before setting ACLs
s3.get_waiter('bucket_exists').wait(Bucket=bucket)
for acl in module.params.get('permission'):
s3.put_bucket_acl(ACL=acl, Bucket=bucket)
except botocore.exceptions.ClientError as e:

Loading…
Cancel
Save