diff --git a/internal/sdkv2provider/resource_cloudflare_access_identity_provider.go b/internal/sdkv2provider/resource_cloudflare_access_identity_provider.go index 38c2251eb2..1ef9265c72 100644 --- a/internal/sdkv2provider/resource_cloudflare_access_identity_provider.go +++ b/internal/sdkv2provider/resource_cloudflare_access_identity_provider.go @@ -63,9 +63,10 @@ func resourceCloudflareAccessIdentityProviderRead(ctx context.Context, d *schema return diag.FromErr(fmt.Errorf("error setting Access Identity Provider configuration: %w", configErr)) } - // We need to get the current secret and set that in the state as it is only returned initially when the resource - // was created. The value read from the server will always be redacted. - scimConfig := convertAccessIDPScimConfigStructToSchema(d.Get("scim_config.0.secret"), accessIdentityProvider.ScimConfig) + // We need to get the current secret and set that in the state as it is only + // returned initially when the resource was created. The value read from the + // server will always be redacted. + scimConfig := convertAccessIDPScimConfigStructToSchema(d.Get("scim_config.0.secret").(string), accessIdentityProvider.ScimConfig) if scimConfigErr := d.Set("scim_config", scimConfig); scimConfigErr != nil { return diag.FromErr(fmt.Errorf("error setting Access Identity Provider scim configuration: %w", scimConfigErr)) } @@ -143,7 +144,7 @@ func resourceCloudflareAccessIdentityProviderUpdate(ctx context.Context, d *sche return diag.FromErr(fmt.Errorf("failed to find Access Identity Provider ID in update response; resource was empty")) } - scimSecret := d.Get("scim_config.0.secret") + scimSecret := d.Get("scim_config.0.secret").(string) checkRedactedRegex := regexp.MustCompile(`^\*+$`) if accessIdentityProvider.ScimConfig.Secret != "" && !checkRedactedRegex.MatchString(accessIdentityProvider.ScimConfig.Secret) { scimSecret = accessIdentityProvider.ScimConfig.Secret @@ -306,7 +307,7 @@ func convertAccessIDPConfigStructToSchema(options cloudflare.AccessIdentityProvi return []interface{}{m} } -func convertAccessIDPScimConfigStructToSchema(secret interface{}, options cloudflare.AccessIdentityProviderScimConfiguration) []interface{} { +func convertAccessIDPScimConfigStructToSchema(secret string, options cloudflare.AccessIdentityProviderScimConfiguration) []interface{} { m := map[string]interface{}{ "enabled": options.Enabled, "secret": secret,