Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tlinhart/pulumi-aws-python

Sample Pulumi program for deploying dockerized app to AWS EC2
https://github.com/tlinhart/pulumi-aws-python

Last synced: 18 days ago
JSON representation

Sample Pulumi program for deploying dockerized app to AWS EC2

Awesome Lists containing this project

README

        

Build and push Docker image
---------------------------

.. code-block:: bash

echo | docker login ghcr.io -u tlinhart --password-stdin
docker build -t ghcr.io/tlinhart/pulumi-aws-python .
docker push ghcr.io/tlinhart/pulumi-aws-python:latest

Create Pulumi project and stack
-------------------------------

.. code-block:: bash

export AWS_PROFILE=pasmen
pulumi login --cloud-url s3://pulumi.linhart.tech
pulumi new aws-python --dir infra

Provide these values:

- *project name*: pulumi-aws-python
- *project description*: Sample AWS Python Pulumi program
- *stack name*: pulumi-aws-python-prod
- *passphrase*:
- *aws:region*: eu-central-1

.. code-block:: bash

export PULUMI_CONFIG_PASSPHRASE=
cd infra
pulumi config set aws:profile pasmen
pulumi config set ghcr-token --secret

Manage the stack
----------------

- ``pulumi up`` - Create or update the resources in a stack
- ``pulumi stack output []`` - Show a stack's output properties
- ``pulumi destroy`` - Destroy an existing stack and its resources
- ``pulumi stack rm []`` - Remove a stack and its configuration

Access the web server
---------------------

.. code-block:: bash

curl $(pulumi stack output public_ip):5000

Resources
---------

- https://www.pulumi.com/docs/get-started/aws/
- https://github.com/pulumi/examples/tree/master/aws-py-webserver
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-shell-scripts
- https://stackoverflow.com/a/9766919/5832540