release_tracks: [ALPHA]
command_type: CONFIG_EXPORT
help_text:
  brief: Export the configuration for a Iam service account.
  description: |
    *{command}* exports the configuration for a Iam service account.

    Service account configurations can be exported in
    Kubernetes Resource Model (krm) or Terraform HCL formats. The
    default format is `krm`.

    Specifying `--all` allows you to export the configurations for all
    service accounts within the project.

    Specifying `--path` allows you to export the configuration(s) to
    a local directory.
  examples: |
    To export the configuration for a service account, run:

      $ {command} my-service-account

    To export the configuration for a service account to a file, run:

      $ {command} my-service-account --path=/path/to/dir/

    To export the configuration for a service account in Terraform
    HCL format, run:

      $ {command} my-service-account --resource-format=terraform

    To export the configurations for all service accounts within a
    project, run:

      $ {command} --all
arguments:
  resource:
    help_text: Service account to export the configuration for.
    spec: !REF googlecloudsdk.command_lib.iam.resources:service_account
