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
Example Ini file
[environment]
region = us-east-1
profile = myprofile
[tags]
ResourceOwner = no_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.14.tar.gz
(10.4 kB
view hashes)
Built Distribution
Close
Hashes for aws_bucket_creator-0.0.14.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aa4ff5b3d28fa1b1cc2de52e4de715cc00c33bbef6369c985c4baeffc42cf29 |
|
MD5 | 59bcf15756bde5b6fe8b58f3d5d417f7 |
|
BLAKE2b-256 | 3145d9e52beff236f4cfee59aa633f8c59d69788eaa46e918873b4c2942ed34a |
Close
Hashes for aws_bucket_creator-0.0.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ac3eebb45a7158b5edcb00df20a915ed20809bf8c0b506d1366d6850239bb8b |
|
MD5 | 3d60e8a4138ebe9f49137b5747872efd |
|
BLAKE2b-256 | 9a546eb60b5f095d299412824552b7285f3ea26a3b95a7d9363266096f352a69 |