Resource
dcloud_iam_sso_connection
The organization's single sign-on identity provider (OIDC or SAML) for the console. It signs nobody in until enabled, and it can be enabled only once one of its domains (dcloud_iam_sso_domain) is verified by DNS.
Example Usage
variable "oidc_client_secret" {
type = string
sensitive = true
}
resource "dcloud_iam_group" "platform" {
name = "platform"
}
resource "dcloud_iam_sso_connection" "okta" {
name = "Okta"
protocol = "oidc"
default_role = "member"
oidc_issuer = "https://acme.okta.com"
oidc_client_id = "0oa1b2c3d4e5f6g7h8i9"
oidc_client_secret = var.oidc_client_secret
groups_claim = "groups"
group_mappings = jsonencode([
{ idpGroup = "platform-team", iamGroupId = dcloud_iam_group.platform.id },
])
# Turn it on once a domain (dcloud_iam_sso_domain) is verified.
enabled = false
}
# Register this at the IdP.
output "redirect_uri" {
value = dcloud_iam_sso_connection.okta.oidc_redirect_uri
}Schema
Required
name(String) Display name, up to 100 characters.protocol(String)oidcorsaml. One of:oidc,saml. Changing it replaces the resource.
Optional
default_role(String) The role a person joining through the connection gets. Defaultmember. One of:admin,member,viewer,billing.enabled(Boolean) Sign people in through the connection. Needs a verified domain.enforced(Boolean) Require single sign-on for addresses at the verified domains. Needsenabled.group_mappings(String) IdP group → IAM group mappings as JSON,[{ idpGroup = "eng", iamGroupId = dcloud_iam_group.eng.id }]; usejsonencode. Order does not matter. The whole list: a mapping set elsewhere is removed.groups_claim(String) The OIDC claim or SAML attribute listing the person's IdP groups. Defaultgroups.oidc_client_id(String) oidc: the client id registered at the IdP.oidc_client_secret(String, Sensitive) oidc: the client secret. Stored encrypted. Never returned by the API: not read back, and empty after an import.oidc_issuer(String) oidc: the issuer URL (public https).saml_allow_sha1(Boolean) saml: accept SHA-1 signatures. Default false.saml_idp_certificate(String) saml: the IdP's signing certificate (PEM).saml_idp_entity_id(String) saml: the IdP's entity id.saml_idp_sso_url(String) saml: the IdP's sign-in URL (https).
Read-Only
id(String) The resource's id.oidc_redirect_uri(String) oidc: the redirect URI to register at the IdP.rn(String) The connection's resource name.sp_acs_url(String) saml: the assertion consumer service URL to give the IdP.sp_entity_id(String) saml: the service provider entity id (and metadata URL) to give the IdP.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# The OIDC client secret is never read back: set it in the configuration after an import.
terraform import dcloud_iam_sso_connection.okta <connection-id>Generated from the provider's schema.
Related