Skip to main content

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

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: (see S3_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws_plugin_bucket_policy-1.0.3.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aws_plugin_bucket_policy-1.0.3-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file aws_plugin_bucket_policy-1.0.3.tar.gz.

File metadata

File hashes

Hashes for aws_plugin_bucket_policy-1.0.3.tar.gz
Algorithm Hash digest
SHA256 b6f60a2937e710fc1cfd6499552ec978751ddd1616196faa266eb13b910bf7c2
MD5 184449303b67c3d550dadc5fc23bd064
BLAKE2b-256 c944403e4b9bb4604fb56ac0e8dd72238567eb3e06f1f9c5f753d67900728b5d

See more details on using hashes here.

File details

Details for the file aws_plugin_bucket_policy-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_plugin_bucket_policy-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e3a0585e8d4d42696ef5cc01b4adf6261a3151f58f7b86cb4820eff3077d4743
MD5 0b7e2d1d92a8aa8fdae67d2036ae4d36
BLAKE2b-256 fe1a5cdbe527b3108b0d5b0f64c010b803122e64ff696d98921cc83367522e18

See more details on using hashes here.

Supported by

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