HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //usr/lib/google-cloud-sdk/lib/surface/projects/set_iam_policy.yaml
- release_tracks: [ALPHA]

  help_text:
    brief: Set IAM policy for a project.
    description: |
      Sets the IAM policy for a project, given a project ID and a file encoded
      in JSON or YAML that contains the IAM policy.

    examples: |
      The following command reads an IAM policy defined in a JSON file
      `policy.json` and sets it for a project with the ID
      `example-project-id-1`:

      $ {command} example-project-id-1 policy.json

      See https://cloud.google.com/iam/docs/managing-policies for details of the
      policy file format and contents.
  request:
    collection: cloudresourcemanager.projects
    use_relative_name: false
    modify_request_hooks:
    - googlecloudsdk.command_lib.projects.util:SetIamPolicyFromFileHook
    - googlecloudsdk.command_lib.iam.hooks:UseMaxRequestedPolicyVersion:api_field=setIamPolicyRequest.policy.version
  arguments:
    resource:
      help_text: The project to set the IAM policy for.
      spec: !REF googlecloudsdk.command_lib.projects.resources:project