Skip to content

Pulumi template that deploys a DynamoDB automatically configured to replicate onto S3

Notifications You must be signed in to change notification settings

nuage-studio/pulumi-dynamodb-stream-to-s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy

Overview

The purpose of this bucket is to set up best practices for quickly developing Pulumi projects in Python.

Directory structure

.
├── Makefile
├── Pulumi.yaml
├── README.md
├── handler.py
├── pulumi
│   ├── __main__.py
│   ├── component.py
│   ├── compute.py
│   ├── dynamic_providers
│   │   ├── __init__.py
│   │   └── github
│   │       ├── __init__.py
│   │       └── label.py
│   ├── label.py
│   ├── stacks
│   │   └── Pulumi.dev.yaml
│   ├── storage.py
│   └── utils.py
└── requirements
    ├── dynamic_providers.txt
    ├── global.txt
    └── lambda.txt

Note that each Pulumi resource is separated by category (ex: compute, storage...) main.py merely contains import statements.

Dynamic Provider

Pulumi Dynamic Providers allows you to easily code in Python a provising logic for resources that do not yet have a Terraform provider.

The boilerplate is inspired upon the Github example in the documentation.

The dynamic provider itself is in pulumi/dynamic_providers/github but the resource declaration has been moved to pulumi/label.py.

Since most dynamic providers will require SDKs, we've created a separate requirements file for that purpose.

Lambda

The Makefile contains basic boilerplate for packaging a Lambda (which you may or may not need depending on your project).

In order to notify Pulumi wether the Lambda needs to be updated, we're using a hashing mechanism (see utils.py that checks the packages zip file : everytime you make a new zip, Pulumi detects the change and performs the update of the function during the next pulumi up.

Lambda also has its own requirements file in order to limit the package size : we only put in requirements/lambda.txt what is actually needed for the Lambda to run. If your Lambda doesn't require extra pip packages then you can simply ignore the Layer part of the Makefile and in compute.py.

Getting started

A good place to start with Pulumi is the Documentation.

Most of the AWS-related documentation in Pulumi is somewhat lacking, so the best place to get info regarding AWS is to look at the Terraform counterpart (since Pulumi is merely a wrapper around it).

Ultimately, the best documentation for Pulumi is its source code available on Github.

About

Pulumi template that deploys a DynamoDB automatically configured to replicate onto S3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published