Search code examples
google-cloud-platformrolesgoogle-cloud-resource-manager

What the difference these formats of identifying a resource on gcp when running certain commands


I was trying to list the grantable roles for a project of mine on google cloud platform, and I came across these two formats for identifying the resource and running the command against.

The formats were:

  • //cloudresourcemanager.googleapis.com/projects/PROJECT_ID, and
  • https://cloudresourcemanager.googleapis.com/v3/projects/PROJECT_ID

How come the second uses the v3 in the URI identifier. Both did give the expected results but need to know why the difference.


Solution

  • TLDR: use the first one.

    The 'v3' in the second identifier (with the https URI), tells you that it was retrieved using the 3.x API version.

    Right now (as march 2022), both URIs will work but in the future, the second one might not.

    Why? because google could deprecate that API version in the next years.

    (probably they will remove that 'v3' internally, but who knows).