This page contains code samples for Identity and Access Management. To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.
View in documentation
Add a principal to a role binding
Demonstrates adding a principal to an existing role binding in an IAM policy.
View in documentation
View in documentation
Create a token for workload identity federation with AWS
Creates a token that IAM workload identity federation can verify without revealing the AWS secret access key.
View in documentation
View in documentation
View in documentation
View in documentation
View in documentation
View in documentation
Query testable permissions
Demonstrates listing the permissions that are valid for a resource.
View in documentation
Remove a member from a role binding
Demonstrates removing a member from a role binding in an IAM policy.
View in documentation
View in documentation
Test permissions
Demonstrates testing whether the caller has specified permissions.
View in documentation
View in documentation