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 upsert [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 upsert -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
notification_prefix = input/
notification_suffix = .jpg
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.18.tar.gz
(11.2 kB
view hashes)
Built Distribution
Close
Hashes for aws_bucket_creator-0.0.18.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3021e8e0af6046c19ae9fc4cf88d7b4fa01b8df89e95d995a8ae6c29ba726b53 |
|
MD5 | 38873d789988da262bc374d92fff7b6c |
|
BLAKE2b-256 | 70a4a66307ddd0b2de7b8cac1f1f506f1b179aa53cf4f6d4bd8072669e0c4d62 |
Close
Hashes for aws_bucket_creator-0.0.18-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d21d59c38b15c9881f72704847c8b87599e77f98022c4833fffd946b0b7054ab |
|
MD5 | a496fe687728c9fefe426053a223538e |
|
BLAKE2b-256 | 0c910a8a4963128fda91b48ed7464b8f46bf3afe8a8f6f6c17f2abfecb42008d |