This program demonstrates how to use Automation API to run Pulumi programs remotely with Pulumi Deployments on Pulumi service hardware (api.pulumi.com). This example deploys the aws-ts-s3-folder project from the Pulumi examples repo.
To run this example you'll need a few pre-reqs:
- A Pulumi CLI installation (v3.45.0 or later), logged in to the Pulumi service via
pulumi login
. - AWS environment variables for AWS credentials (
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
, andAWS_SESSION_TOKEN
). Learn more.
Before running the program, set up a virtual environment:
-
$ python3 -m venv venv
-
$ venv/bin/python -m pip install --upgrade pip
-
$ venv/bin/pip install -r requirements.txt
To run the program, run:
$ venv/bin/python main.py <pulumi-username-or-organization>
This will kick-off the remote deployment using Pulumi Deployments.
To destroy the stack when you're done, invoke the program with an additional destroy
argument:
$ venv/bin/python main.py <pulumi-username-or-organization> destroy