Autoscaled pool of dockerized EC2 VMs, leasable via an authenticated Lambda broker. Pulumi state is self-hosted in S3.
- macOS with Homebrew
- a GitHub repo to push this to
Everything else (AWS CLI + auth, Pulumi CLI, Node, pnpm, gh CLI + auth) is installed and configured by setup.sh.
./setup.shThis bootstraps everything needed to deploy. You will only be prompted to manually provide:
aws loginif not already logged in.- GitHub CLI browser sign-in, if not already logged in
- a Pulumi passphrase of your choice
# refresh AWS credentials if needed.
aws sts get-caller-identity >/dev/null 2>&1 || aws login
# get Pulumi passphrase used to encrypt state in S3.
export PULUMI_CONFIG_PASSPHRASE=$(cat .pulumi-passphrase)
# deploy.
pulumi up --refreshurl=$(pulumi stack output brokerUrl)
key=$(pulumi config get apiKey)
resp=$(curl -sX POST "${url}lease" -H "x-api-key: ${key}")
# -> { "instanceId": "i-...", "publicIp": "...", "sshKey": "..." }
# export SSH key into file.
key_file=$(mktemp)
echo "$resp" | jq -r .sshKey > "$key_file"
chmod 600 "$key_file"
# SSH into your leased instance using SSH key + instance public IP.
ssh -i "$key_file" "ec2-user@$(echo "$resp" | jq -r .publicIp)"Release when done:
curl -sX POST "${url}release" -H "x-api-key: ${key}" -d "{\"instanceId\": \"$(echo "$resp" | jq -r .instanceId)\"}"The workload container listens on port 8080 (curl http://<publicIp>:8080).
pulumi destroy