Combine Multiple Authentication Providers in One Environment

A single authentication block can now combine several providers. Pair aws_oidc, azure_oidc and gcp_oidc with each other, and with any number of custom blocks. Pipelines will use OIDC to generate credentials from each cloud and merge them for Terragrunt runs and hooks.

environment "prod" {
  filter {
    paths = ["prod/*"]
  }

  authentication {
    aws_oidc {
      account_id         = "123456789012"
      plan_iam_role_arn  = "arn:aws:iam::123456789012:role/pipelines-plan"
      apply_iam_role_arn = "arn:aws:iam::123456789012:role/pipelines-apply"
    }

    azure_oidc {
      tenant_id       = "a-tenant-id"
      subscription_id = "a-subscription-id"
      plan_client_id  = "plan-client-id"
      apply_client_id = "apply-client-id"
    }

    custom {
      auth_provider_cmd = "./scripts/pagerduty-auth.sh"
    }

    custom {
      auth_provider_cmd = "./scripts/kube-auth.sh"
    }
  }
}

Enable it by setting PIPELINES_FEATURE_EXPERIMENT_MULTIPLE_AUTHENTICATION_PROVIDERS to "true". Available as of GitHub v4.35.0 and GitLab v2.30.0. See the docs for details.