Add an identity provider
Register an OIDC issuer, such as GitHub Actions or {{product}} CI, whose tokens a role's trust policy can then accept.
An identity provider is an issuer of OIDC tokens. Registering one accepts nothing by itself: a role's trust policy still has to name the provider and the workloads it admits (see Set a trust policy).
Prerequisites
- Permission for
iam:CreateOpenIdConnectProvider. - In the console, also
iam:ListOpenIdConnectProviders: without it Identity providers shows only "You do not have permission to list identity providers".
Add the provider
- Open Identity, then choose Identity providers.
- Choose Add GitHub Actions, or Add Deutsche Cloud CI for jobs that run on Deutsche Cloud's runners. To register another issuer, choose Custom issuer, enter the Issuer URL and at least one audience under Audiences (comma-separated), then choose Add provider.
The provider is listed with its Provider RN (Principal.Federated in a trust policy) and Accepted audiences.
dcloud iam oidc-providers create --url https://token.actions.githubusercontent.comPOST /iam/api/oidc-providers
{ "url": "https://token.actions.githubusercontent.com" }resource "dcloud_iam_oidc_provider" "github" {
url = "https://token.actions.githubusercontent.com"
}Result
- GitHub Actions registers
https://token.actions.githubusercontent.com. - Deutsche Cloud CI registers the console's own issuer,
https://<console host>/ci/api/oidc. - Without audiences (the two Add buttons, and the CLI, API or Terraform without
audiences), the provider accepts one: the console's own origin, such ashttps://console.example.com. The Custom issuer form needs at least one; left empty, it is refused with 400audiences: …. A job must request a token for one of the accepted audiences. Up to 10 audiences are accepted. - The issuer URL must equal the
issclaim of the tokens exactly. The platform reads/.well-known/openid-configurationand the signing keys from it, so it must be a publichttps://address.
Change the audiences
The console does not change audiences. With the CLI or the API, the list you send replaces the
whole list. This needs iam:UpdateOpenIdConnectProvider.
dcloud iam oidc-providers update provider-id --audiences https://console.example.comDelete a provider
On Identity providers, choose the provider's delete icon, then Delete provider. Roles whose trust policy names it can no longer be assumed with its tokens; credentials already issued stay valid until they expire, at most one hour. The trust policies themselves are left unchanged.
dcloud iam oidc-providers delete provider-idThis needs iam:DeleteOpenIdConnectProvider.
If the provider is refused
- 400
The issuer must be a public https:// URL on the default port, without credentials, query or fragment - 409
An identity provider for this issuer already exists - 409
Quota exceeded: OIDC identity providers (iam.oidc-providers) — …