aws_s3 - wait for the bucket before setting ACLs (#61735)
* Wait for the bucket to become available if possible before setting ACLs
This commit is contained in:
parent
531e0560cb
commit
91ccb03552
2 changed files with 5 additions and 0 deletions
|
@ -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') and not module.params.get('ignore_nonexistent_bucket'):
|
||||
# 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…
Reference in a new issue