Solve the Chicken and Egg problem: create infrastructure for an AWS self-managed backend for Pulumi (and with Pulumi)
For more details refer to this post: https://justedagain.com/posts/2022/pulumi-backend-bootstrap/
- Install Pulumi
- Install Python 3.7+
- Configure AWS Credentials with access to AWS S3 / KMS services.
# use local filesystem as backend
pulumi login --local
# initialize stack
pulumi stack init dev
# set AWS region
pulumi config set aws:region eu-central-1
# deploy stack
pulumi up
Note: when using a self-managed backend with multiple Pulumi projects / stacks, it's a good practice to ensure that the stack names are unique and always namespaced with the project name: pulumi stack init <project-name>.<stack-name>
. See this issue for more details.
# Specify the outputs from the bootstraped deployment
export PULUMI_BACKEND_URL="<PULUMI_BACKEND_URL>"
export PULUMI_SECRETS_PROVIDER="<PULUMI_SECRETS_PROVIDER>"
pulumi stack init --secrets-provider="<PULUMI_SECRETS_PROVIDER>" <project-name>.<stack-name>