With pulumi up
, creates a local docker image & starts a container that:
- Is based from the official Pulumi Docker image
- Installs ESC
- Adds any env vars from the ESC environment named
my-runner
pulumi preview
s the Pulumi program underrunner/proj
which outputs:- the value of an environment variable injected via ESC
- the value of a stack config variable injected via ESC
- No secrets (aside from the PAT you control) need to be stored locally!
To deploy your infrastructure, follow the steps below.
- Install Pulumi
- Install Docker and have it running
- A valid Pulumi Access Token in the
PULUMI_ACCESS_TOKEN
environment variable - ESC environment named
my-runner
(add this before running)
values:
environmentVariables:
MY_RUNNER_ENV_SETTING: 'env from ESC'
pulumiConfig:
configFromEsc: 'config from ESC'
-
Install prerequisites:
$ pulumi install
-
Create a new stack:
$ pulumi stack init dev
-
Preview and deploy the app via
pulumi up
. The preview may take a few minutes, as it builds a Docker container. A total of 4 resources are created.$ pulumi up
Updating (dev) View in Browser (Ctrl+O): https://app.pulumi.com/<your org>/docker-ecs/dev/updates/1 Type Name Status Info + pulumi:pulumi:Stack docker-ecs created (6s) + ├─ command:local:Command pinstall created (1s) + ├─ docker:index:Image demo-image created (2s) 1 message + └─ docker:index:Container demo-container created (0.56s) Diagnostics: docker:index:Image (demo-image): Building your image for linux/arm64 architecture. To ensure you are building for the correct platform, consider explicitly setting the `platform` field on ImageBuildOptions. Outputs: imageName: "demoorg/demo-image:main" Resources: + 4 created Duration: 7s
-
Check the docker container's log:
Logging in using access token from PULUMI_ACCESS_TOKEN Previewing update (dev) View Live: https://app.pulumi.com/<your org>/runner/dev/previews/<guid> @ Previewing update.... + pulumi:pulumi:Stack runner-dev create @ Previewing update..... + pulumi:pulumi:Stack runner-dev create From ESC env: env from ESC + pulumi:pulumi:Stack runner-dev create From ESC config: config from ESC + pulumi:pulumi:Stack runner-dev create 2 messages Diagnostics: pulumi:pulumi:Stack (runner-dev): From ESC env: env from ESC From ESC config: config from ESC Resources: + 1 to create
-
Note the "From ESC env" and "From ESC config" contain config values from ESC
- Change the values in the ESC environment and re-run the container. Note the new values are output.
- When the Pulumi Service Provider supports it, create a short-lived access token to use with the container.
- Do something more useful with the "runner" project!
To clean up resources, run pulumi destroy
and answer the confirmation question at the prompt.