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
[1]: https://www.json2yaml.com/ On Friday, July 12, 2019 at 2:20:53 PM UTC-4, Mapperkids Li wrote: > > 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. > > > On Friday, July 12, 2019 at 11:21:01 AM UTC-4, Patrick (Cloud Platform > Support) wrote: >> >> 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: >> >> 1. Projects: >> https://cloud.google.com/resource-manager/reference/rest/v1/projects to >> create the project >> **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 >> >> 2. VPC and VMs: use something like this >> https://github.com/Aahzymandius/deployment-manager/tree/master/working-env >> ** 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 >> >> 3. App Engine: >> https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions >> >> 4. GCS Bucket: https://cloud.google.com/storage/docs/json_api/v1/buckets >> >> 5: SQL instance: >> https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/instances >> >> 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 >> >> [1]: >> https://cloud.google.com/deployment-manager/docs/step-by-step-guide/using-references >> [2]: >> https://cloud.google.com/deployment-manager/docs/step-by-step-guide/updating-a-deployment#previewing_an_update >> >> On Thursday, July 11, 2019 at 5:35:33 AM UTC-4, Mapperkids Li wrote: >>> >>> 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. >>> >>> -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/1b9dce16-5df8-49c2-bfdb-f440d607851c%40googlegroups.com.
