Skip to content

Commit a2ba298

Browse files
authored
INTMDB-481: Add support for identity provider display name import (#924)
* Add support for identity provider display name import * Update example for mongodbatlas_federated_settings_org_config * Update documentation for mongodbatlas_federated_settings_org_configs * Remove confusing verbiage
1 parent 20ade4c commit a2ba298

5 files changed

+12
-2
lines changed

examples/Federated-Settings/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ resource "mongodbatlas_federated_settings_org_config" "org_connections_import" {
3535
identity_provider_id = var.identity_provider_id
3636
domain_restriction_enabled = false
3737
domain_allow_list = ["yourdomain.com"]
38+
post_auth_role_grants = ["ORG_MEMBER"]
3839
}
3940

4041
resource "mongodbatlas_federated_settings_identity_provider" "identity_provider" {

mongodbatlas/resource_mongodbatlas_federated_settings_identity_provider.go

+4
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ func resourceMongoDBAtlasFederatedSettingsIdentityProviderImportState(ctx contex
217217
return nil, fmt.Errorf("error setting Identity Provider in Federation settings (%s): %s", d.Id(), err)
218218
}
219219

220+
if err := d.Set("name", federatedSettingsIdentityProvider.DisplayName); err != nil {
221+
return nil, fmt.Errorf("error setting name (%s): %s", d.Id(), err)
222+
}
223+
220224
if err := d.Set("sso_debug_enabled", federatedSettingsIdentityProvider.SsoDebugEnabled); err != nil {
221225
return nil, fmt.Errorf("error setting sso debug enabled (%s): %s", d.Id(), err)
222226
}

website/docs/d/federated_settings_org_config.html.markdown

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ resource "mongodbatlas_federated_settings_org_config" "org_connections" {
1919
org_id = "627a9683ea7ff7f74de306f14"
2020
domain_restriction_enabled = false
2121
domain_allow_list = ["mydomain.com"]
22+
post_auth_role_grants = ["ORG_MEMBER"]
2223
}
2324
2425
data "mongodbatlas_federated_settings_org_config" "org_configs_ds" {
@@ -41,7 +42,7 @@ In addition to all arguments above, the following attributes are exported:
4142
* `domain_allow_list` - List that contains the approved domains from which organization users can log in. Note: If the organization uses an identity provider, `domain_allow_list` includes: any SSO domains associated with organization's identity provider and any custom domains associated with the specific organization.
4243
* `domain_restriction_enabled` - Flag that indicates whether domain restriction is enabled for the connected organization. User Conflicts returns null when `domain_restriction_enabled` is false.
4344
* `identity_provider_id` - Unique 24-hexadecimal digit string that identifies the federated authentication configuration.
44-
* `post_auth_role_grants` - List that contains the default [roles](https://www.mongodb.com/docs/atlas/reference/user-roles/#std-label-organization-roles) granted to users who authenticate through the IdP in a connected organization. If you provide a postAuthRoleGrants field in the request, the array that you provide replaces the current postAuthRoleGrants.
45+
* `post_auth_role_grants` - List that contains the default [roles](https://www.mongodb.com/docs/atlas/reference/user-roles/#std-label-organization-roles) granted to users who authenticate through the IdP in a connected organization.
4546

4647
### Role_mappings
4748
* `external_group_name` - Unique human-readable label that identifies the identity provider group to which this role mapping applies.

website/docs/d/federated_settings_org_configs.html.markdown

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ resource "mongodbatlas_federated_settings_org_config" "org_connections" {
1919
org_id = "627a9683ea7ff7f74de306f14"
2020
domain_restriction_enabled = false
2121
domain_allow_list = ["mydomain.com"]
22+
post_auth_role_grants = ["ORG_MEMBER"]
2223
}
2324
2425
data "mongodbatlas_federated_settings_org_configs" "org_configs_ds" {
@@ -45,7 +46,7 @@ In addition to all arguments above, the following attributes are exported:
4546
* `domain_restriction_enabled` - Flag that indicates whether domain restriction is enabled for the connected organization.
4647
* `identity_provider_id` - Unique 24-hexadecimal digit string that identifies the federated authentication configuration.
4748
* `org_id` - Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
48-
* `post_auth_role_grants` - List that contains the default roles granted to users who authenticate through the IdP in a connected organization. If you provide a postAuthRoleGrants field in the request, the array that you provide replaces the current postAuthRoleGrants.
49+
* `post_auth_role_grants` - List that contains the default roles granted to users who authenticate through the IdP in a connected organization.
4950

5051
### Role_mappings
5152
* `external_group_name` - Unique human-readable label that identifies the identity provider group to which this role mapping applies.

website/docs/r/federated_settings_org_config.html.markdown

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ resource "mongodbatlas_federated_settings_org_config" "org_connection" {
2121
org_id = "627a9683ea7ff7f74de306f14"
2222
domain_restriction_enabled = false
2323
domain_allow_list = ["mydomain.com"]
24+
post_auth_role_grants = ["ORG_MEMBER"]
2425
identity_provider_id = "0oad4fas87jL7f75Xnk1297"
2526
}
2627
@@ -34,6 +35,8 @@ data "mongodbatlas_federated_settings_org_configs" "org_configs_ds" {
3435
* `federation_settings_id` - (Required) Unique 24-hexadecimal digit string that identifies the federated authentication configuration.
3536
* `org_id` - (Required) Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
3637
* `domain_allow_list` - List that contains the approved domains from which organization users can log in.
38+
* `post_auth_role_grants` - (Optional) List that contains the default [roles](https://www.mongodb.com/docs/atlas/reference/user-roles/#std-label-organization-roles) granted to users who authenticate through the IdP in a connected organization.
39+
3740
* `domain_restriction_enabled` - (Required) Flag that indicates whether domain restriction is enabled for the connected organization.
3841
* `identity_provider_id` - (Required) Unique 24-hexadecimal digit string that identifies the federated authentication configuration.
3942

0 commit comments

Comments
 (0)