1. Create a Google Cloud connection that enables access to multiple projects
First, create a Google Cloud connection if you don’t already have one. Unlike AWS connections, OpenOps doesn’t provide a built-in way to enable access to multiple Google Cloud projects from connection settings. How you enable multi-project access depends on the type of connection you use. If your connection uses a service account JSON key:- Create a service account in one of your Google Cloud projects.
- Create an OpenOps connection using that service account.
- In each additional project that you want OpenOps to access, grant the same service account appropriate IAM roles (for example, Viewer or Editor) in that project’s IAM settings.
gcloud session (the user or service account you are logged in as). Multi-project access works automatically if that identity already has IAM roles in multiple projects. If not, grant the same user or service account the necessary roles in each target project’s IAM settings.
2. Get the list of projects
In your workflow, add a Google Cloud CLI action. In the action’s properties, select the connection that enables access to multiple projects. Select any project in the Default Project dropdown. In the Command field, enter the following:
3. Iterate over projects
Add a Loop on Items step to your workflow. In the Items property, use the Data Selector view to select the entire output of the previous step:
4. Add a Google Cloud step inside the loop and inject the project ID into the command
Inside the loop, add a Google Cloud action that you want to perform for each project — for example, another Google Cloud CLI action. In the action’s properties, select the connection that enables access to multiple projects. Select any project in the Default Project dropdown. In the Command field, enter the command you want to run. For example, to list active Compute Engine instances in each project, enter:--project= flag. Use Data Selector to expand Loop on Items, then item, and click Insert next to the projectId property:


