Created
November 16, 2015 23:05
-
-
Save jackl0phty/b86ed1d9fbde1bbb6ed0 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