This example will deploy all its resources into the project defined by the project_id variable. Please note that we assume this project already exists.
However, if you provide the appropriate values to the project_create variable, the project will be created as part of the deployment.
If project_create is left to null, the identity performing the deployment needs the owner role on the project defined by the project_id variable.
Otherwise, the identity performing the deployment needs resourcemanager.projectCreator on the resource hierarchy node specified by project_create.parent and billing.user on the billing account specified by project_create.billing_account_id.
Time to complete: About 10 minutes
Click the Start button to move to the next step.
- If you want to change your admin password later on, please note that you can only do so via the Wordpress user interface.
- If you have the domain restriction org. policy on your organization, you have to edit the cloud_run_invoker variable and give it a value that will be accepted in accordance to your policy.
- Run the prerequisites script to enable APIs and set Cloud Build permissions.
sh prereq.sh- Run the Cloud Build Job
gcloud builds submit . --config ./build/cloudbuild.yaml*** You might get the following error (or a similar one): ***
Error: resource is in failed state "Ready:False", message: Revision '...' is not ready and cannot serve traffic.
In case this happens, manually run the following command to run the installation again
gcloud builds submit . --config build/cloudbuild.yamlNext we are going to test the architecture and finally clean up your environment.
Upon completion, you will see the output with the values for the Cloud Run service and the user and password to access the /admin part of the website. You can also view it later with:
terraform outputor for the concrete variable:
terraform output cloud_run_serviceWhen clicking on the Wordpress link, it will immediately prompt you to register as an administrator.
The password will be pre-filled and can be changed after registration.
The easiest way to remove all deployed resources is to run the following command in Cloud Shell:
gcloud builds submit . --config build/cloudbuild_destroy.yamlThe above command will delete the associated resources so there will be no billable charges made afterwards.
For full information on variables and outputs please refer to the README file
You’re all set!