# Pulumi - Golang * https://medium.com/@williamwarley/deploying-popular-google-cloud-platform-services-with-pulumi-a-practical-guide-c9878d9865b0 ## Pulumi quick commands ### Start new stack ``` # Clone the repository git clone https://github.com/rajeshkio/pulumiInfraProxmox.git cd pulumiInfraProxmox # Install dependencies go mod download # Configure Pulumi stack pulumi stack init dev # Set environment variables export PROXMOX_VE_ENDPOINT="https://your-proxmox:8006/api2/json" export PROXMOX_VE_USERNAME="user@pam" export PROXMOX_VE_PASSWORD="your-password" export PROXMOX_VE_SSH_PRIVATE_KEY="$(cat ~/.ssh/id_rsa)" export SSH_PUBLIC_KEY="$(cat ~/.ssh/id_rsa.pub)" # Deploy infrastructure with feature flags pulumi up ``` ### Delete resources Remove out of sync resources from state (manually deleted, not using "pulumi state delete"). pulumi state delete --target-dependents Select resource to be deleted. This will remove dependents as well. ## Notes * Pulumi works like ansible: update code, rerun to fix where it stucks. * Resume from task like ansible is nice. * Should be a way to write config file (haproxy, nginx) other than bash and tee. * Pulumi must run on Bastion host having access to the resources. Use platform API as much as possible. Vscode remote workspace helps. * ## Troubleshooting ### Authentication error Secret config must be added with: pulumi config set --secret key value The secret must be encryted and stored in config file. Otherwise the error.