When I configure google cloud cli with my credentials, it is able to create a new project and create resources inside it.
But, for automation purpose in a pipeline, not able to use with my credentials as it will open a webpage and generate a code at runtime.
So, created a service account and when I ran the terraform templates(which worked earlier with my credentials), it is giving forbidden error.
Error 403: You don't have permission to get the role at organizations/6********405/roles/newProjectCreated
the below roles description command gave output.
gcloud iam roles describe roles/resourcemanager.projectIamAdmin
description: Access and administer a project IAM policies.
etag: AA==
includedPermissions:
- resourcemanager.projects.get
- resourcemanager.projects.getIamPolicy
- resourcemanager.projects.setIamPolicy
name: roles/resourcemanager.projectIamAdmin
stage: GA
title: Project IAM Admin
Please suggest what is missing and what need to be added to service account.