auth0 / terraform-provider-auth0

The Auth0 Terraform Provider is the official plugin for managing Auth0 tenant configuration through the Terraform tool.
https://registry.terraform.io/providers/auth0/auth0/latest/docs
Mozilla Public License 2.0
166 stars 81 forks source link

app_domain #225

Closed arcticShadow closed 2 years ago

arcticShadow commented 2 years ago

Describe the problem

https://github.com/auth0/terraform-provider-auth0/pull/202#issuecomment-1168863713 suggests that app_domain is not set in state, therefore removing it will not affect things.

This has not been my experience. app_domain for a connection does exist in my connections that are created on 0.30.2 and 0.31.0 - my state is in a GCP backend so I cannot easily edit it. I attempted to use terrform state pull to retreive it, manually remove app_domain form my connecitons and terraform state push <statefile> to push it back up but the internal verifications are stopping the push due to the serial being the same.

How can I safely progress - do i need to manually manipulate my state?

What was the expected behavior?

Expected that the deprecated value being removed would not affect my existing state.

Reproduction

  1. Create a connection in 0.30.2 for strategy facebook, or google-oauth2, or auth0
  2. Update to 0.32.0 terraform init -upgrade
  3. terraform plan, or terraform apply now error.
arcticShadow commented 2 years ago

I have worked around this issuse with a combination of terrform state pull to retrieve remote state, manually removing app_domain form my connections and bumping hte serial by 1, then terraform state push <statefile> to set it back. I was comfortable to do this, once i found that my gcp backend has object versioning enabled, so i could rollback the state if required.

This has introduced a new (mabey unrelated) issue where all of my connections are erroring during the plan with the following


Error: Failed to decode resource from state
ā”‚ 
ā”‚ Error decoding "module.auth0.auth0_connection.google-oauth2" from previous state: string
ā”‚ is required

Just need to figure out what string is required šŸ¤”

arcticShadow commented 2 years ago

Found the following in Trace Logs

2022-07-08T13:37:49.446+1200 [WARN]  UpgradeResourceState: unexpected type cty.String for map in json state
2022-07-08T13:37:49.446+1200 [TRACE] upgradeResourceState: schema version of module.auth0.auth0_connection.facebook is still 2; calling provider "auth0" for any other minor fixups
2022-07-08T13:37:49.446+1200 [TRACE] GRPCProvider: UpgradeResourceState
2022-07-08T13:37:49.447+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Received request: @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/tf5server/server.go:708 tf_req_id=a8844330-e4dd-1326-49fa-824875588dcb tf_resource_type=auth0_connection @module=sdk.proto tf_proto_version=5.2 tf_provider_addr=provider tf_rpc=UpgradeResourceState timestamp=2022-07-08T13:37:49.447+1200
2022-07-08T13:37:49.447+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Sending request downstream: tf_req_id=a8844330-e4dd-1326-49fa-824875588dcb tf_resource_type=auth0_connection @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/tf5serverlogging/downstream_request.go:17 tf_provider_addr=provider tf_proto_version=5.2 tf_rpc=UpgradeResourceState @module=sdk.proto timestamp=2022-07-08T13:37:49.447+1200
2022-07-08T13:37:49.447+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Upgrading JSON state: tf_rpc=UpgradeResourceState @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/grpc_provider.go:323 tf_provider_addr=provider @module=sdk.helper_schema tf_req_id=a8844330-e4dd-1326-49fa-824875588dcb tf_resource_type=auth0_connection timestamp=2022-07-08T13:37:49.447+1200
2022-07-08T13:37:49.447+1200 [WARN]  provider.terraform-provider-auth0_v0.32.0: unexpected type for map in JSON state: @module=sdk.helper_schema tf_provider_addr=provider tf_req_id=a8844330-e4dd-1326-49fa-824875588dcb type=string @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/grpc_provider.go:492 tf_resource_type=auth0_connection tf_rpc=UpgradeResourceState timestamp=2022-07-08T13:37:49.447+1200
2022-07-08T13:37:49.448+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Received downstream response: tf_provider_addr=provider tf_rpc=UpgradeResourceState @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/tf5serverlogging/downstream_request.go:38 diagnostic_error_count=1 diagnostic_warning_count=0 tf_proto_version=5.2 tf_req_duration_ms=0 tf_req_id=a8844330-e4dd-1326-49fa-824875588dcb tf_resource_type=auth0_connection @module=sdk.proto timestamp=2022-07-08T13:37:49.447+1200
2022-07-08T13:37:49.448+1200 [ERROR] provider.terraform-provider-auth0_v0.32.0: Response contains error diagnostic: tf_rpc=UpgradeResourceState diagnostic_attribute=AttributeName("options").ElementKeyInt(0).AttributeName("fields_map") tf_provider_addr=provider tf_resource_type=auth0_connection diagnostic_detail= tf_req_id=a8844330-e4dd-1326-49fa-824875588dcb diagnostic_severity=ERROR @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/diag/diagnostics.go:56 @module=sdk.proto diagnostic_summary="string is required" tf_proto_version=5.2 timestamp=2022-07-08T13:37:49.448+1200
2022-07-08T13:37:49.448+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Served request: tf_resource_type=auth0_connection tf_rpc=UpgradeResourceState @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/tf5server/server.go:728 tf_provider_addr=provider tf_proto_version=5.2 tf_req_id=a8844330-e4dd-1326-49fa-824875588dcb @module=sdk.proto timestamp=2022-07-08T13:37:49.448+1200
2022-07-08T13:37:49.448+1200 [ERROR] vertex "module.auth0.auth0_connection.facebook" error: string is required
2022-07-08T13:37:49.448+1200 [TRACE] vertex "module.auth0.auth0_connection.facebook": visit complete, with errors
2022-07-08T13:37:49.448+1200 [TRACE] vertex "module.auth0.auth0_connection.facebook": dynamic subgraph encountered errors: string is required
2022-07-08T13:37:49.448+1200 [ERROR] vertex "module.auth0.auth0_connection.facebook" error: string is required
2022-07-08T13:37:49.448+1200 [TRACE] vertex "module.auth0.auth0_connection.facebook": visit complete, with errors
2022-07-08T13:37:49.448+1200 [TRACE] vertex "module.auth0.auth0_connection.facebook (expand)": dynamic subgraph encountered errors: string is required
2022-07-08T13:37:49.448+1200 [ERROR] vertex "module.auth0.auth0_connection.facebook (expand)" error: string is required
2022-07-08T13:37:49.448+1200 [TRACE] vertex "module.auth0.auth0_connection.facebook (expand)": visit complete, with errors
2022-07-08T13:37:49.448+1200 [TRACE] readResourceInstanceState: reading state for module.auth0.auth0_connection.google-oauth2
2022-07-08T13:37:49.448+1200 [WARN]  UpgradeResourceState: unexpected type cty.String for map in json state
2022-07-08T13:37:49.448+1200 [TRACE] upgradeResourceState: schema version of module.auth0.auth0_connection.google-oauth2 is still 2; calling provider "auth0" for any other minor fixups
2022-07-08T13:37:49.448+1200 [TRACE] GRPCProvider: UpgradeResourceState
2022-07-08T13:37:49.448+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Received request: @module=sdk.proto tf_rpc=UpgradeResourceState tf_req_id=03d6dea9-a94a-97de-387b-01c261d570bd tf_resource_type=auth0_connection @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/tf5server/server.go:708 tf_proto_version=5.2 tf_provider_addr=provider timestamp=2022-07-08T13:37:49.448+1200
2022-07-08T13:37:49.448+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Sending request downstream: @module=sdk.proto tf_provider_addr=provider tf_req_id=03d6dea9-a94a-97de-387b-01c261d570bd tf_rpc=UpgradeResourceState tf_proto_version=5.2 tf_resource_type=auth0_connection @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/tf5serverlogging/downstream_request.go:17 timestamp=2022-07-08T13:37:49.448+1200
2022-07-08T13:37:49.448+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Upgrading JSON state: tf_resource_type=auth0_connection @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/grpc_provider.go:323 @module=sdk.helper_schema tf_provider_addr=provider tf_req_id=03d6dea9-a94a-97de-387b-01c261d570bd tf_rpc=UpgradeResourceState timestamp=2022-07-08T13:37:49.448+1200
2022-07-08T13:37:49.448+1200 [WARN]  provider.terraform-provider-auth0_v0.32.0: unexpected type for map in JSON state: @module=sdk.helper_schema tf_resource_type=auth0_connection tf_rpc=UpgradeResourceState type=string @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/grpc_provider.go:492 tf_req_id=03d6dea9-a94a-97de-387b-01c261d570bd tf_provider_addr=provider timestamp=2022-07-08T13:37:49.448+1200
2022-07-08T13:37:49.449+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Received downstream response: @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/tf5serverlogging/downstream_request.go:38 diagnostic_error_count=1 tf_provider_addr=provider tf_resource_type=auth0_connection tf_rpc=UpgradeResourceState @module=sdk.proto diagnostic_warning_count=0 tf_proto_version=5.2 tf_req_duration_ms=0 tf_req_id=03d6dea9-a94a-97de-387b-01c261d570bd timestamp=2022-07-08T13:37:49.448+1200
2022-07-08T13:37:49.449+1200 [ERROR] provider.terraform-provider-auth0_v0.32.0: Response contains error diagnostic: diagnostic_attribute=AttributeName("options").ElementKeyInt(0).AttributeName("fields_map") tf_rpc=UpgradeResourceState @module=sdk.proto diagnostic_summary="string is required" tf_proto_version=5.2 tf_req_id=03d6dea9-a94a-97de-387b-01c261d570bd tf_resource_type=auth0_connection @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/diag/diagnostics.go:56 diagnostic_severity=ERROR tf_provider_addr=provider diagnostic_detail= timestamp=2022-07-08T13:37:49.448+1200
2022-07-08T13:37:49.449+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Served request: tf_proto_version=5.2 tf_req_id=03d6dea9-a94a-97de-387b-01c261d570bd @module=sdk.proto tf_provider_addr=provider tf_resource_type=auth0_connection tf_rpc=UpgradeResourceState @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/tf5server/server.go:728 timestamp=2022-07-08T13:37:49.448+1200
2022-07-08T13:37:49.449+1200 [ERROR] vertex "module.auth0.auth0_connection.google-oauth2" error: string is required
2022-07-08T13:37:49.449+1200 [TRACE] vertex "module.auth0.auth0_connection.google-oauth2": visit complete, with errors
2022-07-08T13:37:49.449+1200 [TRACE] vertex "module.auth0.auth0_connection.google-oauth2": dynamic subgraph encountered errors: string is required
2022-07-08T13:37:49.449+1200 [ERROR] vertex "module.auth0.auth0_connection.google-oauth2" error: string is required
2022-07-08T13:37:49.449+1200 [TRACE] vertex "module.auth0.auth0_connection.google-oauth2": visit complete, with errors
2022-07-08T13:37:49.449+1200 [TRACE] vertex "module.auth0.auth0_connection.google-oauth2 (expand)": dynamic subgraph encountered errors: string is required
2022-07-08T13:37:49.449+1200 [ERROR] vertex "module.auth0.auth0_connection.google-oauth2 (expand)" error: string is required
2022-07-08T13:37:49.449+1200 [TRACE] vertex "module.auth0.auth0_connection.google-oauth2 (expand)": visit complete, with errors
2022-07-08T13:37:49.449+1200 [TRACE] readResourceInstanceState: reading state for module.auth0.auth0_connection.twitter
2022-07-08T13:37:49.449+1200 [TRACE] upgradeResourceState: schema version of module.auth0.auth0_connection.twitter is still 2; calling provider "auth0" for any other minor fixups
2022-07-08T13:37:49.449+1200 [TRACE] GRPCProvider: UpgradeResourceState
2022-07-08T13:37:49.449+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Received request: tf_provider_addr=provider tf_req_id=94677a81-8725-d9ed-cb7c-802116eda368 @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/tf5server/server.go:708 tf_resource_type=auth0_connection tf_rpc=UpgradeResourceState @module=sdk.proto tf_proto_version=5.2 timestamp=2022-07-08T13:37:49.449+1200
2022-07-08T13:37:49.449+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Sending request downstream: tf_req_id=94677a81-8725-d9ed-cb7c-802116eda368 tf_resource_type=auth0_connection tf_rpc=UpgradeResourceState @module=sdk.proto tf_proto_version=5.2 tf_provider_addr=provider @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/tf5serverlogging/downstream_request.go:17 timestamp=2022-07-08T13:37:49.449+1200
2022-07-08T13:37:49.449+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Upgrading JSON state: @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/grpc_provider.go:323 tf_req_id=94677a81-8725-d9ed-cb7c-802116eda368 tf_resource_type=auth0_connection tf_rpc=UpgradeResourceState @module=sdk.helper_schema tf_provider_addr=provider timestamp=2022-07-08T13:37:49.449+1200
2022-07-08T13:37:49.449+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Called downstream: @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.18.0/helper/schema/resource.go:1016 tf_provider_addr=provider tf_rpc=ReadResource @module=sdk.helper_schema tf_req_id=5d9270eb-b730-4327-a191-adfbb6f732d2 tf_resource_type=auth0_email timestamp=2022-07-08T13:37:49.449+1200
2022-07-08T13:37:49.450+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Received downstream response: tf_proto_version=5.2 tf_req_duration_ms=90 diagnostic_warning_count=0 tf_provider_addr=provider tf_req_id=5d9270eb-b730-4327-a191-adfbb6f732d2 @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/tf5serverlogging/downstream_request.go:38 @module=sdk.proto diagnostic_error_count=0 tf_resource_type=auth0_email tf_rpc=ReadResource timestamp=2022-07-08T13:37:49.450+1200
2022-07-08T13:37:49.450+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Served request: tf_req_id=5d9270eb-b730-4327-a191-adfbb6f732d2 tf_resource_type=auth0_email tf_rpc=ReadResource @module=sdk.proto @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/tf5server/server.go:759 tf_proto_version=5.2 tf_provider_addr=provider timestamp=2022-07-08T13:37:49.450+1200
2022-07-08T13:37:49.450+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Received downstream response: @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/internal/tf5serverlogging/downstream_request.go:38 @module=sdk.proto tf_provider_addr=provider tf_req_duration_ms=0 tf_rpc=UpgradeResourceState diagnostic_error_count=0 diagnostic_warning_count=0 tf_proto_version=5.2 tf_req_id=94677a81-8725-d9ed-cb7c-802116eda368 tf_resource_type=auth0_connection timestamp=2022-07-08T13:37:49.450+1200
2022-07-08T13:37:49.450+1200 [TRACE] provider.terraform-provider-auth0_v0.32.0: Served request: tf_proto_version=5.2 tf_provider_addr=provider @module=sdk.proto tf_req_id=94677a81-8725-d9ed-cb7c-802116eda368 tf_resource_type=auth0_connection tf_rpc=UpgradeResourceState @caller=github.com/hashicorp/terraform-plugin-go@v0.10.0/tfprotov5/tf5server/server.go:728 timestamp=2022-07-08T13:37:49.450+1200

Still not really sure what to make of it.

arcticShadow commented 2 years ago

I have worked around this by setting up new connections, exporting the state and coping the differences in structure from the new state to my existing state, then pushing the state back up - and letting terraform resolve any other minor difference.

So now i have resolved the Error Error: Failed to decode resource from state but I suspect it is still an issue

sergiught commented 2 years ago

Hey @arcticShadow, thanks for opening the issue and for the details.

I have tried to reproduce this following your steps with the following config:

terraform {
  required_providers {
    auth0 = {
      source  = "auth0/auth0"
      version = "0.30.2"
    }
  }
}

provider "auth0" {
  debug = "true"
}
resource "auth0_connection" "google_oauth2" {
  name     = "Test-Google-OAuth2-Connection"
  strategy = "google-oauth2"
  options {
    client_id                = "<client-id>"
    client_secret            = "<client-secret>"
    allowed_audiences        = [ "example.com", "api.example.com" ]
    scopes                   = [ "email", "profile", "gmail", "youtube" ]
    set_user_root_attributes = "on_each_login"
  }
}

After a successful terraform apply I checked the state and app_domain was set to an empty string as expected as it was never set anywhere inside the code to any value, so terraform always defaults it to an empty string.

After upgrading to 0.32.0 and doing an apply I simply get:

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

And checking the state I now see that there is no more "app_domain" as expected.

I suspect the issue you're having is due to something else and not the app_domain field being deprecated. I'll check right now your other issue as well.

sergiught commented 2 years ago

I have worked around this by setting up new connections, exporting the state and coping the differences in structure from the new state to my existing state, then pushing the state back up - and letting terraform resolve any other minor difference.

Would it be possible to know the differences you were getting? Which were the fields and how were they divergent? šŸ™šŸ»

sergiught commented 2 years ago

@arcticShadow, I believe your issue here is related to this change Changed options.fields_map from Map to String. Even tho you don't have fields_map perhaps in your config the type of this changes from map to string in the state. When encountering breaking changes like this (as we're still on v0 we'll very likely need to keep introducing some here and there), it's best to re-import the connection first, rather than applying directly e.g. $ terraform import auth0_connection.google con_a17f21fdb24d48a0

I'll add a note in the changelog for folks regarding this.

Update: let me know if this helps https://github.com/auth0/terraform-provider-auth0/releases/tag/v0.32.0

arcticShadow commented 2 years ago

Thanks that should help future people that may come across this. I will see if I can dig up a copy of my state from 0.30 to look over

arcticShadow commented 2 years ago

Heres a copy of my google-oauth2 connection from provider version 0.30.2

0.30.2 snippet ```json { "module": "module.auth0", "mode": "managed", "type": "auth0_connection", "name": "google-oauth2", "provider": "provider[\"registry.terraform.io/auth0/auth0\"]", "instances": [ { "schema_version": 2, "attributes": { "display_name": "", "enabled_clients": [ ], "id": "con_xxxxxxx", "is_domain_connection": false, "metadata": {}, "name": "google-oauth2", "options": [ { "adfs_server": "", "allowed_audiences": [], "api_enable_users": false, "app_domain": "", "app_id": "", "authorization_endpoint": "", "brute_force_protection": false, "client_id": "", "client_secret": "", "community_base_url": "", "configuration": {}, "custom_scripts": {}, "debug": false, "digest_algorithm": "", "disable_cache": false, "disable_signup": false, "discovery_url": "", "domain": "", "domain_aliases": [], "enabled_database_customization": false, "entity_id": "", "fields_map": {}, "forward_request_info": false, "from": "", "gateway_authentication": [], "gateway_url": "", "icon_url": "", "identity_api": "", "idp_initiated": [], "import_mode": false, "ips": [], "issuer": "", "jwks_uri": "", "key_id": "", "max_groups_to_retrieve": "", "messaging_service_sid": "", "mfa": [], "name": "", "non_persistent_attrs": [], "password_complexity_options": [], "password_dictionary": [], "password_history": [], "password_no_personal_info": [], "password_policy": "", "protocol_binding": "", "provider": "", "request_template": "", "requires_username": false, "scopes": [ "email", "profile" ], "scripts": {}, "set_user_root_attributes": "on_each_login", "should_trust_email_verified_connection": "", "sign_in_endpoint": "", "sign_out_endpoint": "", "sign_saml_request": false, "signature_algorithm": "", "signing_cert": "", "strategy_version": 0, "subject": "", "syntax": "", "team_id": "", "template": "", "tenant_domain": "", "token_endpoint": "", "totp": [], "twilio_sid": "", "twilio_token": "", "type": "", "use_cert_auth": false, "use_kerberos": false, "use_wsfed": false, "user_id_attribute": "", "userinfo_endpoint": "", "validation": [], "waad_common_endpoint": false, "waad_protocol": "" } ], "realms": [ "google-oauth2" ], "show_as_button": null, "strategy": "google-oauth2", "strategy_version": null, "validation": null }, "sensitive_attributes": [], "private": "xxxxxxx==", "dependencies": [ ] } ] }, ```

And the same resource from 0.32.0 (earlier in the day)

0.32.0 snippet ```json { "module": "module.auth0", "mode": "managed", "type": "auth0_connection", "name": "google-oauth2", "provider": "provider[\"registry.terraform.io/auth0/auth0\"]", "instances": [ { "schema_version": 2, "attributes": { "display_name": "", "enabled_clients": [ ], "id": "con_xxxxxx", "is_domain_connection": false, "metadata": {}, "name": "google-oauth2", "options": [ { "adfs_server": "", "allowed_audiences": [], "api_enable_users": false, "app_id": "", "authorization_endpoint": "", "brute_force_protection": false, "client_id": "", "client_secret": "", "community_base_url": "", "configuration": {}, "custom_scripts": {}, "debug": false, "digest_algorithm": "", "disable_cache": false, "disable_sign_out": false, "disable_signup": false, "discovery_url": "", "domain": "", "domain_aliases": [], "enabled_database_customization": false, "entity_id": "", "fields_map": "", "forward_request_info": false, "from": "", "gateway_authentication": [], "gateway_url": "", "icon_url": "", "identity_api": "", "idp_initiated": [], "import_mode": false, "ips": [], "issuer": "", "jwks_uri": "", "key_id": "", "max_groups_to_retrieve": "", "messaging_service_sid": "", "metadata_url": "", "metadata_xml": "", "mfa": [], "name": "", "non_persistent_attrs": [], "password_complexity_options": [], "password_dictionary": [], "password_history": [], "password_no_personal_info": [], "password_policy": "", "pkce_enabled": false, "protocol_binding": "", "provider": "", "request_template": "", "requires_username": false, "scopes": [ "email", "profile" ], "scripts": {}, "set_user_root_attributes": "on_each_login", "should_trust_email_verified_connection": "", "sign_in_endpoint": "", "sign_out_endpoint": "", "sign_saml_request": false, "signature_algorithm": "", "signing_cert": "", "signing_key": [], "strategy_version": 0, "subject": "", "syntax": "", "team_id": "", "template": "", "tenant_domain": "", "token_endpoint": "", "totp": [], "twilio_sid": "", "twilio_token": "", "type": "", "use_cert_auth": false, "use_kerberos": false, "use_wsfed": false, "user_id_attribute": "", "userinfo_endpoint": "", "validation": [], "waad_common_endpoint": false, "waad_protocol": "" } ], "realms": [ "google-oauth2" ], "show_as_button": null, "strategy": "google-oauth2", "strategy_version": null, "validation": null }, "sensitive_attributes": [], "private": "xxxxxxxx==", "dependencies": [ ] } ] }, ```

As expected - fields_map is an object in the earlier version

sergiught commented 2 years ago

Thanks @arcticShadow for those state snippets. I can confirm this issue was caused by the fields_map change. And it's fixable by doing terraform state rm auth0_connection.<resource name> <connID> && terraform import auth0_connection.<resource name> <connID>. We'll make sure to always post these notes in the Changelog when breaking changes are introduced. Apologies for having missed this on our part. I'll close this down then if you were also able to fix this, but please let us know if you encounter any other issues.