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
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.17.tar.gz
(10.6 kB
view hashes)
Built Distribution
Close
Hashes for aws_bucket_creator-0.0.17.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8904ddad0f9d98eaf69d8af6847257a3dfca8a145147b6355899f4773a43d1e2 |
|
MD5 | 687e3bcc8dbac228f685036889385819 |
|
BLAKE2b-256 | daf02ae33a7a5cb6d21910fddef1568916a714ae63c0d6791399c6fecb2a2686 |
Close
Hashes for aws_bucket_creator-0.0.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2adf6690aa3b24810302fddac9c36f7f5fab8ab8761c154c19c597ce2a12a28 |
|
MD5 | 8aa64e6c403a6ade67c0e5315bc12090 |
|
BLAKE2b-256 | 2f290e22fd2651cc3d134f6391c906d09f8b47e6fecf48d19908e14d53a39d0e |