Forked from jackl0phty/aws-s3-policy-minimum-privs.txt
Created
October 27, 2017 10:52
-
-
Save actionjack/c04ff9719d099d78babe0ad7fa09fd47 to your computer and use it in GitHub Desktop.
How to Create an AWS S3 Bucket, tag it, Specify Region, & Enable Versioning Using Ansible.
This file contains hidden or 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "statement1", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:Put*", | |
"s3:Get*", | |
"s3:List*", | |
"s3:CreateBucket" | |
], | |
"Resource": [ | |
"arn:aws:s3:::*" | |
] | |
} | |
] | |
} |
This file contains hidden or 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
--- | |
- hosts: localhost | |
connection: local | |
gather_facts: no | |
tasks: | |
- name: Create S3 test bucket. | |
local_action: | |
module: s3 | |
bucket: 'mybucket-foo' | |
mode: create | |
region: 'us-east-1' | |
mode: create | |
- name: Set tags to S3 test bucket. | |
local_action: | |
module: s3_bucket | |
name: 'mybucket-foo' | |
region: 'us-east-1' | |
versioning: yes | |
tags: | |
Name: mybucket-foo | |
env: prod | |
created_by: Ansible |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment