-
Notifications
You must be signed in to change notification settings - Fork 342
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
Provide support for AWS S3 Public Access Blocking #144
Comments
Files identified in the description: If these files are inaccurate, please update the |
@sky-amoncadot I've hit the same problem with blocking public access. I'll try to prepare a merge request soon. |
So I have a working prototype:) - hosts: localhost
gather_facts: false
tasks:
- amazon.aws.s3_bucket:
name: "<bucket_name>"
state: present
public_access:
BlockPublicAcls: true
# IgnorePublicAcls: false
# BlockPublicPolicy: false
# RestrictPublicBuckets: false
register: module_result
- debug:
var: module_result
ansible-playbook -i ../inventory/ s3-bucket-testing.yml
PLAY [localhost] **************************************************************************************************************************
TASK [amazon.aws.s3_bucket] ***************************************************************************************************************
changed: [localhost]
TASK [debug] ******************************************************************************************************************************
ok: [localhost] =>
module_result:
changed: true
failed: false
name: <bucket_name>
policy: null
public_access_block:
BlockPublicAcls: true
BlockPublicPolicy: false
IgnorePublicAcls: false
RestrictPublicBuckets: false
requester_pays: false
tags: {}
versioning:
MfaDelete: Disabled
Versioning: Disabled
PLAY RECAP ********************************************************************************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 aws s3api get-public-access-block --bucket <bucket_name>
{
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": true,
"IgnorePublicAcls": false,
"BlockPublicPolicy": false,
"RestrictPublicBuckets": false
}
}
I'll do few more tests & prepare merge request. |
@sky-amoncadot another 'related' pull request:) - ansible-collections/community.aws#260 |
* Provide support for AWS S3 Public Access Blocking * Documentation * Execute get_bucket_public_access only if required * changelog * Add missing version_added entries to doc Resolves issue #144
…sible-collections#144) This commit was initially merged in https://github.com/ansible-collections/community.aws -- 336 -- See: ansible-collections/community.aws@92bebdd
SUMMARY
Support public access blocking on S3 buckets.
ISSUE TYPE
COMPONENT NAME
aws_s3.py and/or s3_bucket.py
ADDITIONAL INFORMATION
Original feature request here.
AWS release info.
Public access blocking is a new AWS S3 capability that ensures a bucket is much more private than even the default and that the bucket cannot subsequently be configured to have some public capabilities.
This is detached from S3 bucket policies or permissions as it is a separate API entirely. Its part of S3Control in botocore if I recall. An example of what is being requested as a native feature in Ansible:
(Above snippet taken from here.)
The text was updated successfully, but these errors were encountered: