Search code examples
sqldeploymentterraformgoogle-deployment-managerinfrastructure-as-code

Is it necessary to create users and database instances sequentially while using Infrastructure as Code?


I was seeing this Deployment Manager template on Google Foundation Toolkit on Github

I am not able to get it what this line is for. Github Repo


Solution

  • That is a reference to another function within the template (line 184). The reason this does it sequentially is that the API call to add a user to the DB only handles adding a single user at a time. The act of adding a user to CloudSQL through API cannot be done in a batch. Since DM creates all these resources through API call, the sequential calls are required