Pulumi Template
This project serves as a template for creating new Pulumi projects.
Repo Contents
The lib
directory and __main__.py
file are written generically to facilitate dynamic range requirements.
Custom bash, powershell, and cloud-config scripts can be stored in the config
directory.
The stack_vars
directory contains three template yaml files for storing stack specific variables, which will be referenced by the __main__.py
file.
Getting Started
Prerequisites
In order to utilize this template, you will need to setup the following:
- Python 3.6+ - https://www.python.org/downloads/
- Openstack CLI 6.0.0+ - https://docs.openstack.org/python-openstackclient/latest/user/index.html
- Pulumi CLI - 3.44.3+ https://www.pulumi.com/docs/get-started/install/
- Valid Openstack Project RC file
Example Usage
# Clone the repo
git clone https://git.cybbh.space/vta/pulumi-template.git my-project
cd my-project
export PULUMI_CONFIG_PASSPHRASE=${YOUR_PASSPHRASE}
pulumi login file://${PWD}
# --- Update lines 1-2 of Pulumi.yaml with your project name and description
# The following command will create a new stack yaml file called Pulumi.${YOUR_STACK_NAME}.yaml and a corresponding .pulumi directory
pulumi stack init ${YOUR_STACK_NAME}
pulumi stack select ${YOUR_STACK_NAME}
mv stack_vars/template stack_vars/${YOUR_STACK_NAME}
# At the top of each yaml file in the stack_vars/${YOUR_STACK_NAME} directory, update the top line to match ${YOUR_STACK_NAME}
# --- Update the variables in the stack_vars/${YOUR_STACK_NAME} directory to match your desired configuration
# --- You can reference the .demo_stack_vars directory for a simple example
# Source your Openstack project rc file
source ${PATH_TO_YOUR_OPENSTACK_PROJECT_RC_FILE}
# If everything is configured correctly, the following command will create your infrastructure
pulumi up # select yes to proceed if there are no errors