Skip to content

Latest commit

 

History

History

aws-classic-py-dynamodb

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

AWS Dynamodb Table in Python

Creates an aws dynamodb table in python with pulumi## Deploying and running the program

  1. Create a new stack:

    pulumi stack init dev
  2. Set the AWS region:

    pulumi config set aws:region us-east-2
  3. Create a Python virtualenv, activate it, and install dependencies:

    This installs the dependent packages needed for our Pulumi program.

    python3 -m venv venv
    source venv/bin/activate
    pip3 install -r requirements.txt
  4. Run pulumi up to preview and deploy changes. After the preview is shown you will be prompted if you want to continue or not.

    pulumi up

    Result:

    Updating (dev)
    
    View Live: https://app.pulumi.com/myuser/aws-py-dynamodb/dev/updates/5
    
        Type                   Name                 Status      
    +   pulumi:pulumi:Stack    aws-py-dynamodb-dev  created     
    +   └─ aws:dynamodb:Table  dev-test-table       created     
    
    Outputs:
        dynamodb_billing_mode          : "PROVISIONED"
        dynamodb_hash_key              : "databaseName"
        dynamodb_name                  : "dev-test-table"
        dynamodb_point_in_time_recovery: {
            enabled: false
        }
        dynamodb_read_capacity         : 1
        dynamodb_write_capacity        : 1
    
    Resources:
        + 2 created
    
    Duration: 11s
    
  5. To see the resources that were created, run pulumi stack output:

    pulumi stack output

    Result

    Current stack outputs (6):
        OUTPUT                           VALUE
        dynamodb_billing_mode            PROVISIONED
        dynamodb_hash_key                databaseName
        dynamodb_name                    dev-test-table
        dynamodb_point_in_time_recovery  {"enabled":false}
        dynamodb_read_capacity           1
        dynamodb_write_capacity          1
  6. To clean up resources, run pulumi destroy

    pulumi destroy -y