gcloud iam workload-identity-pools create-cred-config AUDIENCE --output-file=OUTPUT_FILE (--aws | --azure | --credential-cert-path=CREDENTIAL_CERT_PATH | --credential-source-file=CREDENTIAL_SOURCE_FILE | --credential-source-url=CREDENTIAL_SOURCE_URL | --executable-command=EXECUTABLE_COMMAND) [--app-id-uri=APP_ID_URI] [--credential-source-field-name=CREDENTIAL_SOURCE_FIELD_NAME] [--credential-source-headers=[key=value,…]] [--credential-source-type=CREDENTIAL_SOURCE_TYPE] [--enable-imdsv2] [--sts-location=STS_LOCATION] [--subject-token-type=SUBJECT_TOKEN_TYPE] [--credential-cert-private-key-path=CREDENTIAL_CERT_PRIVATE_KEY_PATH : --credential-cert-configuration-output-file=CREDENTIAL_CERT_CONFIGURATION_OUTPUT_FILE --credential-cert-trust-chain-path=CREDENTIAL_CERT_TRUST_CHAIN_PATH] [--executable-output-file=EXECUTABLE_OUTPUT_FILE --executable-timeout-millis=EXECUTABLE_TIMEOUT_MILLIS] [--service-account=SERVICE_ACCOUNT : --service-account-token-lifetime-seconds=SERVICE_ACCOUNT_TOKEN_LIFETIME_SECONDS] [GCLOUD_WIDE_FLAG …]
gcloud iam workload-identity-pools create-cred-config projects/$PROJECT_NUMBER/locations/$REGION/workloadIdentityPools/$WORKLOAD_POOL_ID/providers/$PROVIDER_ID --service-account=$EMAIL --credential-source-file=$PATH_TO_OIDC_ID_TOKEN --output-file=credentials.jsonTo create a URL-sourced credential configuration for your project, run:
gcloud iam workload-identity-pools create-cred-config projects/$PROJECT_NUMBER/locations/$REGION/workloadIdentityPools/$WORKLOAD_POOL_ID/providers/$PROVIDER_ID --service-account=$EMAIL --credential-source-url=$URL_FOR_OIDC_TOKEN --credential-source-headers=Key=Value --output-file=credentials.jsonTo create an executable-source credential configuration for your project, run the following command:
gcloud iam workload-identity-pools create-cred-config locations/$REGION/workforcePools/$WORKFORCE_POOL_ID/providers/$PROVIDER_ID --executable-command=$EXECUTABLE_COMMAND --executable-timeout-millis=30000 --executable-output-file=$CACHE_FILE --output-file=credentials.jsonTo create an AWS-based credential configuration for your project, run:
gcloud iam workload-identity-pools create-cred-config projects/$PROJECT_NUMBER/locations/$REGION/workloadIdentityPools/$WORKLOAD_POOL_ID/providers/$PROVIDER_ID --service-account=$EMAIL --aws --enable-imdsv2 --output-file=credentials.jsonTo create an Azure-based credential configuration for your project, run:
gcloud iam workload-identity-pools create-cred-config projects/$PROJECT_NUMBER/locations/$REGION/workloadIdentityPools/$WORKLOAD_POOL_ID/providers/$PROVIDER_ID --service-account=$EMAIL --azure --app-id-uri=$URI_FOR_AZURE_APP_ID --output-file=credentials.jsonTo create an X.509 certificate-based credential configuration for your project, run:
gcloud iam workload-identity-pools create-cred-config projects/$PROJECT_NUMBER/locations/$REGION/workloadIdentityPools/$WORKLOAD_POOL_ID/providers/$PROVIDER_ID --service-account=$EMAIL --credential-cert-path=$PATH_TO_CERTIFICATE_FILE --credential-cert-private-key-path=$PATH_TO_PRIVATE_KEY_FILE --output-file=credentials.jsonAUDIENCE--output-file=OUTPUT_FILE--aws--azure--credential-cert-path=CREDENTIAL_CERT_PATH--credential-source-file=CREDENTIAL_SOURCE_FILE--credential-source-url=CREDENTIAL_SOURCE_URL--executable-command=EXECUTABLE_COMMAND--app-id-uri=APP_ID_URI--credential-source-field-name=CREDENTIAL_SOURCE_FIELD_NAME--credential-source-headers=[key=value,…]--credential-source-type=CREDENTIAL_SOURCE_TYPE--enable-imdsv2--sts-location=STS_LOCATIONus-central1 will configure the client to use the
regional endpoint sts.us-central1.rep.googleapis.com. If not
specified, the global endpoint sts.googleapis.com is used.
--subject-token-type=SUBJECT_TOKEN_TYPE--credential-cert-private-key-path=CREDENTIAL_CERT_PRIVATE_KEY_PATH--credential-cert-configuration-output-file=CREDENTIAL_CERT_CONFIGURATION_OUTPUT_FILE--credential-cert-trust-chain-path=CREDENTIAL_CERT_TRUST_CHAIN_PATH--executable-output-file=EXECUTABLE_OUTPUT_FILE--executable-timeout-millis=EXECUTABLE_TIMEOUT_MILLIS--service-account=SERVICE_ACCOUNT--service-account-token-lifetime-seconds=SERVICE_ACCOUNT_TOKEN_LIFETIME_SECONDSconstraints/iam.allowServiceAccountCredentialLifetimeExtension
constraint.
--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
gcloud alpha iam workload-identity-pools create-cred-configgcloud beta iam workload-identity-pools create-cred-config
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.