Creates S3 bucket, tags, policy and lifecycle policy via boto3.
Project description
AWS Bucket Creator
Features
aws-bucket-creator creates a bucket, sets tags, logging, encryption, lifecycle, and policy
Installation
aws-bucket-creator is on PyPI so all you need is:
$ pip install aws-bucket-creator
Example
Getting help
$ bucket-creator create --help
Usage: bucket-creator create [OPTIONS]
primary function for creating a bucket :return:
Options:
-i, --ini TEXT INI file with needed information [required]
-v, --version Print version and exit
--debug Turn on debugging
--help Show this message and exit.
bucket-creator create -i config/my.ini
Options
acl can be: ‘private’, ‘public-read’, ‘public-read-write’, ‘authenticated-read’, ‘aws-exec-read’, ‘bucket-owner-read’,’bucket-owner-full-control’
aes-256 encryption is turned-on by default, and can not be turned off for security reasons
public_read access can not be turned on for security reasons
default days before going to standard-ia is 30
default days before going to glacier is 365
Example Ini file
[environment]
region = us-east-1
profile = my_aws_profile
[tags]
ResourceOwner = not_me
Project = some project
DeployedBy = me
[parameters]
bucket_name = test-bucket
acl = bucket-owner-full-control
public_write_access = True
logging_enabled = True
days_to_glacier = 365
days_to_standard_ia = 30
event_lambda_arn = arn:aws:lambda:us-east-1:123456789:function:my-lambda
bucket_policy = {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowRoot",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::123456789:root"
]
},
"Action": ["s3:*"],
"Resource": [
"arn:aws:s3:::test-bucket/*",
"arn:aws:s3:::test-bucket"
]
},
{
"Sid": "IPAllow",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::test-bucket/*",
"arn:aws:s3:::test-bucket"
],
"Condition" : {
"IpAddress" : {
"aws:SourceIp": "192.128.1.1/32"
},
"NotIpAddress" : {
"aws:SourceIp": "192.168.1.1/32"
}
}
}
]
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aws_bucket_creator-0.0.15.tar.gz
(10.6 kB
view hashes)
Built Distribution
Close
Hashes for aws_bucket_creator-0.0.15.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab79647061ba427c3eb54ac8346691b73859aea38ef19d917d9b439db18ec00f |
|
MD5 | b55b6c158efd30f64e23922987474cb1 |
|
BLAKE2b-256 | 400b5f06f495903bab510c2dc520e110a7f5be0a4c3a3e2123a0440aefbd3aae |
Close
Hashes for aws_bucket_creator-0.0.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ead02b5dba068a0e3b8b947e143ec6186646b0a8e94a39bd328a679b1aa9b573 |
|
MD5 | 78cdcb935ff4d8b88104bc073682dea7 |
|
BLAKE2b-256 | afef7dc846b301e31a394feffd635ebbd4acde7ee1264f0892a17e17776e2f13 |