Deploy App Engine using deployment manager?

62 views
Skip to first unread message

Mapperkids Li

unread,
Jul 11, 2019, 5:35:33 AM7/11/19
to Google App Engine
Hi,

I'm planning to use the deployment manager to deploy a new project for each of our client.

 I'm just wondering can I do the following using the deployment manager or put into script/YAML, so it deploys all components all at once through the command shell?

1. create a new GCP project
2. create a VPC for the client with custom subnet assigned
3. create a VM  and set the network to the custom VPC/subnet
4. create an app engine with different services using the yaml file
5. create storage buckets
6. create cloud Postgres SQL instance

What I tried so far, I can deploy the VM only through the deployment manager, I can do them individually using the command line, but not using the deployment manager in one single step.

Thanks for your help.

Patrick (Cloud Platform Support)

unread,
Jul 12, 2019, 11:21:01 AM7/12/19
to Google App Engine
Deployment Manager should work perfectly for this type of setup. There are a few minor caveats though. 

1. You need to have a project in place where you can run deployment manager from
2. You will need to provide the deployment manager service account all the required permissions before creating the deployment (such as project creator at the org level). The service account is [PROJECT_ID]@cloudservices.gserviceaccount.com

Next, you will want to call each of the resources individually in your deployment manager manifest:

**All following resources should make a reference [1] to this resource to create a dependancy so that DM does not try to create them before the project exists... which would result in a failure

** This includes adding GKE clusters at the end and a VPC peering you won't need, but it demonstrates the creation of a VPC, subnets, firewall rules and a VM




As long as your overall config is less than 1 MB, you can place all these resources into a single config. 
If you are new to DM, I recommend trying each of these resources individually to make sure that you have the syntax correct. Trying to debug syntax errors with multiple resources is much more difficult.

I also recommend using the --preview flag [2] before creating or updating resources so that you can make sure that your configurations or changes will come into effect the way you planned

Mapperkids Li

unread,
Jul 12, 2019, 2:20:53 PM7/12/19
to Google App Engine
Thank you very much for the help, nice to know it is possible to put build all resource in on single config file, but in what format json or jinja2 format?

The API documentation is all about in the JSON format and still need to think how to put all together in a single file then just run it from the command shell.

Patrick (Cloud Platform Support)

unread,
Jul 15, 2019, 12:07:12 PM7/15/19
to Google App Engine
You can use Jinja or python2 for a template. However, the base config file must use yaml (you can use a json to yaml converter like this [1]) 
Keep in mind though that the syntax is going to be slightly different from the Json, but on the whole, the fields will be the same

Reply all
Reply to author
Forward
0 new messages