awscli S3 bucket-policy plugin
Project description
aws-plugin-bucket-policy
AWS CLI plugin - bucket policy admin tool
Installation
-
Dependencies: python3-minimal python3-pip mandoc groff-base optionally: python3-venv
-
Optionally start virtualenv:
python3 -m venv venv; . venv/bin/activate
-
pip install --upgrade pip setuptools awscli aws-plugin-bucket-policy
Configuration
- aws config
.aws/config
:
[plugins]
s3bucket-policy = aws_plugin_bucket_policy
- S3 credentials:
.aws/credentials
:
[default]
aws_access_key_id = ***
aws_secret_access_key = ***
or using environment variables: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY \
Help
- For help run
aws s3bucket-policy help
oraws s3bucket-policy SUBCOMMAND help
- Plugin commands manual on GitHub
Examples:
aws s3bucket-policy --profile PROFILE_NAME get-policy --bucket BUCKET_NAME
aws s3bucket-policy --profile PROFILE_NAME new-policy --bucket BUCKET_NAME --newpol-type share-w-user --newpol-spec tenant=TENANT_NAME,user=USER_NAME,action=rw
aws s3bucket-policy --profile PROFILE_NAME new-policy --bucket BUCKET_NAME --newpol-type share-w-tenant --newpol-spec tenant=TENANT_NAME,action=ro
aws s3bucket-policy --profile PROFILE_NAME new-policy --bucket BUCKET_NAME --newpol-type ro-public
aws s3bucket-policy --profile PROFILE_NAME put-policy --bucket BUCKET_NAME --policy POLICY_FILE.json
aws s3bucket-policy --profile PROFILE_NAME delete-policy --bucket BUCKET_NAME
Docker way:
Dockerfile
based on ubuntu:jammy- S3 credentials should be defined in
S3_env
as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables: (seeS3_env.template
file)
AWS_ACCESS_KEY_ID=***
AWS_SECRET_ACCESS_KEY=***
- Usage examples:
docker build -t s3bucket-policy .
docker run -it --rm -u awscli --env-file=S3_env --name s3bucket-policy s3bucket-policy --endpoint ENDPOINT_URL get-policy --bucket BUCKET_NAME
docker run -it --rm -u awscli --env-file=S3_env --name s3bucket-policy s3bucket-policy --endpoint ENDPOINT_URL help
docker run -it --rm -u awscli --env-file=S3_env --name s3bucket-policy s3bucket-policy --endpoint ENDPOINT_URL new-policy help
docker run -it --rm -u awscli --env-file=S3_env --name s3bucket-policy s3bucket-policy --endpoint ENDPOINT_URL new-policy --bucket BUCKET_NAME --newpol-type share-w-tenant --newpol-spec tenant=TENANT_NAME,action=ro
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
Built Distribution
File details
Details for the file aws_plugin_bucket_policy-1.0.1.tar.gz
.
File metadata
- Download URL: aws_plugin_bucket_policy-1.0.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 708e6a6ddae5f65b33b71a5c4f910b9a8c0d8b55b0c5747c5b18cda8493b7078 |
|
MD5 | 8f07d53bcfd70c0bdc7f302039d3274b |
|
BLAKE2b-256 | e1bdb692e9bf4f54985bf058635033e88c94deae20c3cc3548cf76aaf997565d |
File details
Details for the file aws_plugin_bucket_policy-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: aws_plugin_bucket_policy-1.0.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d67b4eb52ddd7deb2789b6b52c910791ce3b2500eb7f4d8b017ac6c7d52cea14 |
|
MD5 | 6f1cff206adea56344fc098b3ee160bc |
|
BLAKE2b-256 | b896cd5c7f92d371bcc46d2d5e0e38a73b3cfb0bad1b51751032537dd1181b5c |