Skip to main content

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

Example Ini file

[environment]
region = us-east-1
profile = myprofile

[tags]
ResourceOwner = no_me
Project = some project
DeployedBy = me


[parameters]
bucket_name = test-bucket
principals = arn:aws:iam::123456789:root
acl = bucket-owner-full-control
public_write_access = True
days_to_glacier = 365
days_to_standard_ia = 30
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


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.7.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

aws_bucket_creator-0.0.7-py2-none-any.whl (9.2 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page