GithubHelp home page GithubHelp logo

aws-python's Introduction

aws-python

Simple Docker container that providers workspace to run aws commandline tools in python.

Available Scripts

Delete Untagged ECR Images

When a docker image is tagged as "latest" in ECR, the previous version tagged "latest" still exists but is no longer tagged. That container is cached for possible later re-use. This script will remove all untagged containers from the repo to conserve space for a given REGISTRY_ID and REPOSITORY_NAME (image name).

docker run --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION \
    jdeskins/aws-python \
    cleanup-docker-images.py [REGISTRY_ID] [REPOSITORY_NAME]

List ECR Images using local credentials file

docker run --rm -v ~/.aws:/root/.aws jdeskins/aws-python aws ecr list-images \
    --repository-name=[REPOSITORY_NAME] \
    --profile=[PROFILE_NAME]

List Object Version Data from S3

Uses AWS environment variables to authenticate and get version data of all objects in the bucket matching the prefix.

docker run --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION \
    jdeskins/aws-python \
    list-versions.py -b bucket_name -p path_prefix

Other Examples

Get AWS ECR login string for docker

You can run the helper script:

./samples/get-docker-login.sh

This script can be called from GoCD server after the build.sh script has built the new image. It uses AWS environment variables to authenticate. The container launches, runs the script, then exists.

Or you can run the docker command directly:

docker run --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION \
    jdeskins/aws-python aws ecr get-login

To automatically execute the docker login for ECR, run:

$(docker run --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION \
      jdeskins/aws-python aws ecr get-login)

aws-python's People

Contributors

jdeskins avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.