Im coming from AWS not sure how to do this with gcp.
In AWS I can create an EC2 instance, Lambda, ECS, etc service role. I attach policies to that role to give it the access it needs. Then I attach the role to an EC2 instance, lambda, etc. No static keys being used, no secrets being passed around.
How do I do this with gcp? How do I attach a role (or maybe gcp service account?) to a gce instance, cloud function, gke deployment/service, etc?
GCP has "service accounts" and something it calls roles and something called "scopes" but it is not clear to me how to attach them and Grant access to reasources implicitly (without passing around secrets/keys).