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 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
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.16.tar.gz
(10.6 kB
view hashes)
Built Distribution
Close
Hashes for aws_bucket_creator-0.0.16.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9777a2cb2ed9530f11404639e41459335c7301882252615aad1db33ec3a27897 |
|
MD5 | a284e6fc0606b2a8e7ec7ad60b1eb803 |
|
BLAKE2b-256 | e35bbd6a501bbb4e41095221195f4de422ea70c8c270f3e1be3e6a078a364d8f |
Close
Hashes for aws_bucket_creator-0.0.16-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a524327db0fc51cdb942b2f8bc364db92333a132ac3a2694c8dec1bd5030f9b4 |
|
MD5 | acc5ed13cb531fd86fdfb03e2125a913 |
|
BLAKE2b-256 | 4b869e422992d05e38f3183fc2b0adb1fd1bd393efc034936362d14403f41334 |