Ensure you have Python 3 and the Pulumi CLI.
We will be deploying to Google Cloud Platform (GCP), so you will need an account. If you don't have an account, sign up for free here. In either case, follow the instructions here to connect Pulumi to your GCP account.
This example assumes that you have GCP's gcloud
CLI on your path. This is installed as part of the
GCP SDK.
Wordpress image base on bitnami wordpress-nginx
After cloning this repo, cd
into it and run these commands.
-
Setup instructions
Setup instructions
gcloud auth configure-docker \ us-central1-docker.pkg.dev
-
Create a new stack, which is an isolated deployment target for this example:
$ pulumi stack init dev
-
Set the required configuration variables for this program:
$ pulumi config set gcp:project <your-gcp-project> $ pulumi config set gcp:region <gcp-region> # Cloud SQL Disk $ pulumi config set wordpress:disk_size <disk size> # Cloud SQL instance type $ pulumi config set wordpress:tier <cloud sql instance tier> # Cloud SQL User for wordpress $ pulumi config set wordpress:user <user> # Cloud SQL Database for wordpress $ pulumi config set wordpress:db <db> # Cloud SQL password for wordpress $ pulumi config set --secret wordpress:dbPassword [your-database-password-here] # bitnami wordpress version $ pulumi config set wordpress:tag <tag>
cloud sql instance type ref: instance type
-
Deploy everything with the
pulumi up
command.$ pulumi up
Note: you must disable deletion protection before removing the resource (e.g., via pulumi destroy), or the instance cannot be deleted and the provider run will not complete successfully.