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:
.. code:: console
$ pip install aws-bucket-creator
Demonstration
Example
Getting help
.. code:: console
$ 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.
.. code:: console
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
.. code:: console
[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.19.tar.gz
(11.9 kB
view details)
Built Distribution
File details
Details for the file aws_bucket_creator-0.0.19.tar.gz
.
File metadata
- Download URL: aws_bucket_creator-0.0.19.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea0afb7fba14f2a51223aa654bb2f577682b7d1d477457db91d1eba8af08ff98 |
|
MD5 | d7bc33a62d6f5068fc80c2a18593a1b6 |
|
BLAKE2b-256 | bdcadaef479665bb9e30f44865e1c4a5d0e965ef56e397fff5602a62392e7324 |
File details
Details for the file aws_bucket_creator-0.0.19-py2-none-any.whl
.
File metadata
- Download URL: aws_bucket_creator-0.0.19-py2-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 440c06fd9507237841efb634dcff7a371d30e4b2242f69ebbf740628ca216cfb |
|
MD5 | 91fba49a714dd31b299e84290ef39f77 |
|
BLAKE2b-256 | 216661e43af6c3f3d767db6856958ddd81c1d3a4a68b858c83f0f3b0d337cf50 |