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

Update return block - s3_bucket, s3_bucket_info, s3_object #2135

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- Update return block in the module documentation for s3_bucket, s3_bucket_info, s3_object modules (https://github.com/ansible-collections/amazon.aws/pull/2135).
82 changes: 62 additions & 20 deletions plugins/modules/s3_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,25 +290,26 @@

RETURN = r"""
encryption:
description:
- Server-side encryption of the objects in the S3 bucket.
type: str
returned: I(state=present)
sample: ''
description: Server-side encryption of the objects in the S3 bucket.
type: dict
returned: when O(state=present)
sample: {
"SSEAlgorithm": "AES256"
}
name:
description: Name of the S3 bucket.
description: Bucket name.
returned: when O(state=present)
type: str
returned: I(state=present)
sample: "2d3ce10a8210d36d6b4d23b822892074complex"
sample: "a-testing-bucket-name"
object_ownership:
description: S3 bucket's ownership controls.
type: str
returned: I(state=present)
returned: when O(state=present)
sample: "BucketOwnerPreferred"
policy:
description: S3 bucket's policy.
type: dict
returned: I(state=present)
returned: when O(state=present)
sample: {
"Statement": [
{
Expand All @@ -322,32 +323,74 @@
"Version": "2012-10-17"
}
requester_pays:
description:
- Indicates that the requester was successfully charged for the request.
type: str
returned: I(state=present)
sample: ''
description: Indicates that the requester was successfully charged for the request.
type: bool
returned: when O(state=present)
sample: true
tags:
description: S3 bucket's tags.
type: dict
returned: I(state=present)
returned: when O(state=present)
sample: {
"Tag1": "tag1",
"Tag2": "tag2"
}
versioning:
description: S3 bucket's versioning configuration.
type: dict
returned: I(state=present)
returned: when O(state=present)
sample: {
"MfaDelete": "Disabled",
"Versioning": "Enabled"
}
contains:
MfaDelete:
description: Specifies whether MFA delete is enabled in the bucket versioning configuration.
returned: when O(state=presnet) and MfaDelete configured on bucket.
type: str
Versioning:
mandar242 marked this conversation as resolved.
Show resolved Hide resolved
description: The versioning state of the bucket.
type: str
returned: always
acl:
description: S3 bucket's canned ACL.
type: dict
returned: I(state=present)
sample: 'public-read'
returned: when O(state=present).
sample: "public-read"
object_lock_enabled:
description: Whether S3 Object Lock is enabled.
type: bool
returned: when O(state=present)
sample: false
public_access_block:
description: Bucket public access block configuration.
returned: when O(state=present)
type: dict
sample: {
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": true,
"BlockPublicPolicy": true,
"IgnorePublicAcls": true,
"RestrictPublicBuckets": true
}
}
contains:
PublicAccessBlockConfiguration:
description: The PublicAccessBlock configuration currently in effect for this Amazon S3 bucket.
type: dict
contains:
BlockPublicAcls:
description: Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket.
type: bool
BlockPublicPolicy:
description: Specifies whether Amazon S3 should block public bucket policies for this bucket.
type: bool
IgnorePublicAcls:
description: Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.
type: bool
RestrictPublicBuckets:
description: Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
type: bool
"""

import json
Expand Down Expand Up @@ -469,7 +512,6 @@ def handle_bucket_requester_pays(s3_client, module: AnsibleAWSModule, name: str)
put_bucket_request_payment(s3_client, name, payer)
requester_pays_status = wait_payer_is_applied(module, s3_client, name, payer, should_fail=True)
requester_pays_changed = True

return requester_pays_changed, requester_pays


Expand Down
Loading
Loading