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

    Key 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
    keys within the project.

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

      $ {command} my-key

    To export the configuration for a key to a file, run:

      $ {command} my-key --path=/path/to/dir/

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

      $ {command} my-key --resource-format=terraform

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

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