Code Monkey home page Code Monkey logo

aws-cdk-python's Introduction

AWS-CDK-Python

Source of Non official base image (here) for working with AWS CDK in Python

Tags

  • cdk1.100-py3.7:
    • Node: v14
    • Python: v3.7
    • AWS CDK: v1.1
    • AWS CLI: v2

How to use

Create custom image

Here we need to create some files. The sample is located in how-to-use/ .

At first, create Dockerfile as:

FROM tokusumi/aws-cdk-python:cdk1.100-py3.7

ADD ./requirements.txt /app/requirements.txt
RUN python3 -m pip install --no-cache-dir -r /app/requirements.txt

CMD ["/bin/bash"]

Create requirements.txt and write CDK library for your usecase. For example:

aws-cdk.aws-lambda==1.100.0
aws-cdk.aws-dynamodb==1.100.0
aws-cdk.aws-events-targets==1.100.0
aws-cdk.aws_lambda_event_sources==1.100.0
boto3

Create .env file for AWS configurations (See details at AWS Userguid). docker-compose read this automatically:

AWS_ACCESS_KEY_ID=<get access key id in AWS console>
AWS_SECRET_ACCESS_KEY=<get secret access key in AWS console>
AWS_DEFAULT_REGION=<set default region. e.g.: ap-northeast-1>

Create docker-compose.yml to use above custom image as:

version: "3"
services:
    aws-cdk-py:
        command: /bin/bash
        build: .
        volumes:
            - ./app:/root/app
        environment: 
            - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
            - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
            - AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
        tty: true

Build custom docker image:

docker-compose build

Use it

Run bash:

$ docker-compose run --rm aws-cdk-py /bin/bash
๐Ÿณ 6bd6b289c89e:~ # nodejs -v
v14.17.4
๐Ÿณ 6bd6b289c89e:~ # python3 -V
Python 3.7.6
๐Ÿณ 6bd6b289c89e:~ # aws --version
aws-cli/2.2.28 Python/3.8.8 Linux/4.19.128-microsoft-standard exe/x86_64.debian.9 prompt/off
๐Ÿณ 6bd6b289c89e:~ # cdk --version
1.118.0 (build a4f0418)

Or you can run AWS CDK command directly:

$ docker-compose run --rm aws-cdk-py cdk --version
1.118.0 (build a4f0418)

aws-cdk-python's People

Contributors

tokusumi 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.