mongodb / terraform-provider-mongodbatlas

Terraform MongoDB Atlas Provider: Deploy, update, and manage MongoDB Atlas infrastructure as code through HashiCorp Terraform
https://registry.terraform.io/providers/mongodb/mongodbatlas
Mozilla Public License 2.0
244 stars 172 forks source link

Error: Plugin did not respond - panic: interface conversion: interface *** is nil, not map[string]interface *** #1337

Closed Kikivsantos closed 1 year ago

Kikivsantos commented 1 year ago

Terraform CLI and Terraform MongoDB Atlas Provider Version

# Terraform v1.5.2

Terraform Configuration File

# main.tf:

resource "mongodbatlas_alert_configuration" "default" {
  project_id = var.project_id[var.environment]
  event_type = var.event_type #"OUTSIDE_METRIC_THRESHOLD"
  enabled    = var.enabled

  notification {
    type_name     = var.type_name #"GROUP"
    interval_min  = var.interval_min # 5
    delay_min     = var.delay_min #0
    sms_enabled   = var.sms_enabled #false
    email_enabled = var.email_enabled #true
    roles         = var.roles #["GROUP_OWNER", "GROUP_CLUSTER_MANAGER"]
    api_token        = try(var.api_token, null)
  }

  metric_threshold_config {
    metric_name = try(var.metric_threshold_config.metric_name, null) #"ASSERT_REGULAR"
    operator    = try(var.metric_threshold_config.operator, null) #"LESS_THAN"
    threshold   = try(var.metric_threshold_config.threshold, null)#99.0
    units       = try(var.metric_threshold_config.units, null)#"RAW"
    mode        = try(var.metric_threshold_config.mode, null)#"AVERAGE"
  }

  threshold_config {
    operator    = try(var.threshold_config.operator, null) #"LESS_THAN"
    threshold   = try(var.threshold_config.threshold, null)#99.0
    units       = try(var.threshold_config.units, null)#"RAW"
  }
}

# variables.tf
# Vale guardarmos o link abaixo para saber quais as opções de event_type (pois na doc do terraform está muito ruim)
# https://www.mongodb.com/docs/cloud-manager/reference/alert-types/#replica-set

variable "project_id" {
    description = <<HEREDOC
    (Required) The ID of the project where the alert configuration will create.
    HEREDOC
    default = {
        production            = "PROJECT_ID_PROD",
        staging               = "PROJECT_ID_STG",
        develop               = "PROJECT_ID_DEV"
    }
}

variable "environment" {
    description = <<HEREDOC
    Required - The environment of the project for the Atlas cluster.
    HEREDOC
    type = string
}

variable "enabled" {
    description = <<HEREDOC
    It is not required, but If the attribute is omitted, by default will be false, and the configuration would be disabled. You must set true to enable the configuration.
    HEREDOC
    default = true
}

variable "event_type" {
    description = <<HEREDOC
    (Required) The type of event that will trigger an alert.
    OPtions in https://www.mongodb.com/docs/cloud-manager/reference/alert-types/#alert-event-types
    HEREDOC
}

variable "type_name" {
    description = <<HEREDOC
    Type of alert notification. Accepted values are:
      - DATADOG
      - EMAIL
      - FLOWDOCK
      - GROUP (Project)
      - OPS_GENIE
      - ORG
      - PAGER_DUTY
      - SLACK
      - SMS
      - TEAM
      - USER
      - VICTOR_OPS
      - WEBHOOK
      - MICROSOFT_TEAMS
    HEREDOC
    default = "GROUP"
}

variable "api_token" {
    description = <<HEREDOC
    AKIIII Slack API token. Required for the SLACK notifications type. 
    If the token later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
    HEREDOC
    default = null
}

variable "channel_name" {
    description = <<HEREDOC
    Slack channel name. Required for the SLACK notifications type.
    HEREDOC
    default = null
}

variable "datadog_api_key" {
    description = <<HEREDOC
    Datadog API Key. Found in the Datadog dashboard. Required for the DATADOG notifications type.
    HEREDOC
    default = null
}

variable "delay_min" {
    description = <<HEREDOC
    Number of minutes to wait after an alert condition is detected before sending out the first notification.
    HEREDOC
    default = 0
}

variable "interval_min" {
    description = <<HEREDOC
    Number of minutes to wait between successive notifications for unacknowledged alerts that are not resolved. 
    The minimum value is 5. 
    NOTE PAGER_DUTY, VICTOR_OPS, and OPS_GENIE notifications do not return this value. 
    The notification interval must be configured and managed within each external service.
    HEREDOC
    default = 60
}

variable "email_enabled" {
    description = <<HEREDOC
    Flag indicating email notifications should be sent. This flag is only valid if type_name is set to ORG, GROUP, or USER.
    HEREDOC
    default = true
}

variable "sms_enabled" {
    description = <<HEREDOC
    Flag indicating if text message notifications should be sent to this user's mobile phone. This flag is only valid if type_name is set to ORG, GROUP, or USER.
    HEREDOC
    default = false
}

variable "mobile_number" {
    description = "Mobile number to which alert notifications are sent. Required for the SMS notifications type"
    default = null
}

variable "roles" {
    description = <<HEREDOC
    roles - Optional. One or more roles that receive the configured alert. If you include this field, Atlas sends alerts only to users assigned the roles you specify in the array. If you omit this field, Atlas sends alerts to users assigned any role. This parameter is only valid if type_name is set to ORG, GROUP, or USER. Accepted values are:
    * Project roles: 
        - GROUP_CHARTS_ADMIN
        - GROUP_CLUSTER_MANAGER
        - GROUP_DATA_ACCESS_ADMIN
        - GROUP_DATA_ACCESS_READ_ONLY
        - GROUP_DATA_ACCESS_READ_WRITE
        - GROUP_OWNER
        - GROUP_READ_ONLY
    * Organization roles:
        - ORG_OWNER
        - ORG_MEMBER
        - ORG_GROUP_CREATOR
        - ORG_BILLING_ADMIN
        - ORG_READ_ONLY
    HEREDOC
    type        = list(string)
    default = [ "GROUP_OWNER" ]
}

variable "metric_threshold_config" {
    description = <<HEREDOC
    The threshold that causes an alert to be triggered. 
    Required if event_type_name : OUTSIDE_METRIC_THRESHOLD or OUTSIDE_SERVERLESS_METRIC_THRESHOLD
    HEREDOC
    type = any
    default = null
}

variable "threshold_config" {
    type = any
    default = null
}

### terragrunt.hcl

include {
  path = find_in_parent_folders()
}

locals {
  component_name = "modules/alert"
  environment_vars = read_terragrunt_config(find_in_parent_folders("environment.hcl")).locals
  component_version = "feature-addalert"
}

inputs = {
  environment = local.environment_vars.environment
  event_type = "REPLICATION_OPLOG_WINDOW_RUNNING_OUT" ##OPLOG_BEHIND => OPLOG_BEHIND não funciona (não existe)
  enabled   = false

  notification = {
    type_name     = "GROUP"
    interval_min  = 60
    delay_min     = 0
    sms_enabled   = false
    email_enabled = true
    roles         = ["GROUP_OWNER"]
  }

  threshold_config = {
    operator    = "LESS_THAN"
    threshold   = 1
    units       = "HOURS"
  }

} 

## environment.hcl:
locals {
    environment = "develop"
}

Steps to Reproduce

terraform apply

Expected Behavior

Should have created an alert on mongodb atlas (on the develop project)

Actual Behavior

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # mongodbatlas_alert_configuration.default will be created
  + resource "mongodbatlas_alert_configuration" "default" ***
      + alert_configuration_id = (known after apply)
      + created                = (known after apply)
      + enabled                = false
      + event_type             = "REPLICATION_OPLOG_WINDOW_RUNNING_OUT"
      + id                     = (known after apply)
      + project_id             = "PROJECT_ID_DEV"
      + updated                = (known after apply)

      + metric_threshold_config ***

      + notification ***
          + delay_min     = 0
          + email_enabled = true
          + interval_min  = 60
          + roles         = [
              + "GROUP_OWNER",
            ]
          + sms_enabled   = false
          + team_name     = (known after apply)
          + type_name     = "GROUP"
        ***

      + threshold_config ***
          + operator  = "LESS_THAN"
          + threshold = 1
          + units     = "HOURS"
        ***
    ***

Plan: 1 to add, 0 to change, 0 to destroy.
mongodbatlas_alert_configuration.default: Creating...

Error: Plugin did not respond

  with mongodbatlas_alert_configuration.default,
  on main.tf line 2, in resource "mongodbatlas_alert_configuration" "default":
   2: resource "mongodbatlas_alert_configuration" "default" ***

The plugin encountered an error, and failed to respond to the
plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain
more details.

Stack trace from the terraform-provider-mongodbatlas_v1.10.2 plugin:

panic: interface conversion: interface *** is nil, not map[string]interface ***

goroutine 26 [running]:
github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas.expandAlertConfigurationMetricThresholdConfig(0x4143e5?)
    github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas/resource_mongodbatlas_alert_configuration.go:580 +0x4e6
github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas.resourceMongoDBAtlasAlertConfigurationCreate(***0x14284c8, 0xc0009d8180***, 0x0?, ***0xf8cf40?, 0xc0006f9ae0?***)
    github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas/resource_mongodbatlas_alert_configuration.go:306 +0x173
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0005cfdc0, ***0x1428500, 0xc000992330***, 0xd?, ***0xf8cf40, 0xc0006f9ae0***)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:733 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0005cfdc0, ***0x1428500, 0xc000992330***, 0xc000943ba0, 0xc00096f400, ***0xf8cf40, 0xc0006f9ae0***)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:864 +0xa7e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000109c50, ***0x1428500?, 0xc000992210?***, 0xc000964af0)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/grpc_provider.go:1024 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00050caa0, ***0x1428500?, 0xc000973800?***, 0xc00092e7e0)
    github.com/hashicorp/terraform-plugin-go@v0.16.0/tfprotov5/tf5server/server.go:821 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(***0x108dbe0?, 0xc00050caa0***, ***0x1428500, 0xc000973800***, 0xc00092e770, 0x0)
    github.com/hashicorp/terraform-plugin-go@v0.16.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:422 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000194000, ***0x142d040, 0xc00067e000***, 0xc00097d440, 0xc0005fb590, 0x1af1ba0, 0x0)
    google.golang.org/grpc@v1.56.0/server.go:1337 +0xdf3
google.golang.org/grpc.(*Server).handleStream(0xc000194000, ***0x142d040, 0xc00067e000***, 0xc00097d440, 0x0)
    google.golang.org/grpc@v1.56.0/server.go:1714 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.1()
    google.golang.org/grpc@v1.56.0/server.go:959 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
    google.golang.org/grpc@v1.56.0/server.go:957 +0x18c

Error: The terraform-provider-mongodbatlas_v1.10.2 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

time=2023-07-20T18:31:02Z level=error msg=Terraform invocation failed in /home/gitrunner/actions-runner/_work/mongodb-atlas-org/mongodb-atlas-org/terraform/resources/alert/develop/bkp/.terragrunt-cache/MzwcffHROT_JVjzKD3x9v0x7MUY/pzZ6kKKOog-nM-3feLfydekfdws/modules/alert prefix=[terraform/resources/alert/develop/bkp] 
time=2023-07-20T18:31:02Z level=error msg=1 error occurred:
    * [/home/gitrunner/actions-runner/_work/mongodb-atlas-org/mongodb-atlas-org/terraform/resources/alert/develop/bkp/.terragrunt-cache/MzwcffHROT_JVjzKD3x9v0x7MUY/pzZ6kKKOog-nM-3feLfydekfdws/modules/alert] exit status 1

Error: Process completed with exit code 1.

Debug Output

Crash Output

Error: Plugin did not respond

  with mongodbatlas_alert_configuration.default,
  on main.tf line 2, in resource "mongodbatlas_alert_configuration" "default":
   2: resource "mongodbatlas_alert_configuration" "default" ***

The plugin encountered an error, and failed to respond to the
plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain
more details.

Stack trace from the terraform-provider-mongodbatlas_v1.10.2 plugin:

panic: interface conversion: interface *** is nil, not map[string]interface ***

goroutine 26 [running]:
github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas.expandAlertConfigurationMetricThresholdConfig(0x4143e5?)
    github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas/resource_mongodbatlas_alert_configuration.go:580 +0x4e6
github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas.resourceMongoDBAtlasAlertConfigurationCreate(***0x14284c8, 0xc0009d8180***, 0x0?, ***0xf8cf40?, 0xc0006f9ae0?***)
    github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas/resource_mongodbatlas_alert_configuration.go:306 +0x173
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0005cfdc0, ***0x1428500, 0xc000992330***, 0xd?, ***0xf8cf40, 0xc0006f9ae0***)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:733 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0005cfdc0, ***0x1428500, 0xc000992330***, 0xc000943ba0, 0xc00096f400, ***0xf8cf40, 0xc0006f9ae0***)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:864 +0xa7e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000109c50, ***0x1428500?, 0xc000992210?***, 0xc000964af0)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/grpc_provider.go:1024 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00050caa0, ***0x1428500?, 0xc000973800?***, 0xc00092e7e0)
    github.com/hashicorp/terraform-plugin-go@v0.16.0/tfprotov5/tf5server/server.go:821 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(***0x108dbe0?, 0xc00050caa0***, ***0x1428500, 0xc000973800***, 0xc00092e770, 0x0)
    github.com/hashicorp/terraform-plugin-go@v0.16.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:422 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000194000, ***0x142d040, 0xc00067e000***, 0xc00097d440, 0xc0005fb590, 0x1af1ba0, 0x0)
    google.golang.org/grpc@v1.56.0/server.go:1337 +0xdf3
google.golang.org/grpc.(*Server).handleStream(0xc000194000, ***0x142d040, 0xc00067e000***, 0xc00097d440, 0x0)
    google.golang.org/grpc@v1.56.0/server.go:1714 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.1()
    google.golang.org/grpc@v1.56.0/server.go:959 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
    google.golang.org/grpc@v1.56.0/server.go:957 +0x18c

Error: The terraform-provider-mongodbatlas_v1.10.2 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

time=2023-07-20T18:31:02Z level=error msg=Terraform invocation failed in /home/gitrunner/actions-runner/_work/mongodb-atlas-org/mongodb-atlas-org/terraform/resources/alert/develop/bkp/.terragrunt-cache/MzwcffHROT_JVjzKD3x9v0x7MUY/pzZ6kKKOog-nM-3feLfydekfdws/modules/alert prefix=[terraform/resources/alert/develop/bkp] 
time=2023-07-20T18:31:02Z level=error msg=1 error occurred:
    * [/home/gitrunner/actions-runner/_work/mongodb-atlas-org/mongodb-atlas-org/terraform/resources/alert/develop/bkp/.terragrunt-cache/MzwcffHROT_JVjzKD3x9v0x7MUY/pzZ6kKKOog-nM-3feLfydekfdws/modules/alert] exit status 1

Error: Process completed with exit code 1.

Additional Context

References

github-actions[bot] commented 1 year ago

Thanks for opening this issue. The ticket INTMDB-955 was created for internal tracking.

andreaangiolillo commented 1 year ago

Hello @Kikivsantos, Thanks for opening the issue. I was able to reproduce the failure: the reason why the provider is panicking is that you are providing metric_threshold_config {} as an empty object. The fix is to remove metric_threshold_config if it has no attributes inside. With that said, the provider should not panic in this scenario and we are fixing this issue in https://github.com/mongodb/terraform-provider-mongodbatlas/pull/1342

andreaangiolillo commented 1 year ago

Hello, The fix was released in v1.11.0.. Feel free to reopen the issue if you still have the same problem with the latest version.

Thanks

Kikivsantos commented 1 year ago

HI, @andreaangiolillo I'm still getting error

My version:

$ terraform version
Terraform v1.5.3
on linux_amd64
+ provider registry.terraform.io/mongodb/mongodbatlas v1.11.0

My terragrunt file:

locals {
  component_name = "modules/alert"
  #environment_vars = read_terragrunt_config(find_in_parent_folders("environment.hcl")).locals
  component_version = "feature-addalert"
}

include "root" {
  path = "${get_repo_root()}/terragrunt.hcl"
}

dependency "project" {
  config_path = "../.."
}

inputs = {
  project_id   = dependency.project.outputs.project_id
  #environment = local.environment_vars.environment
  event_type = "NO_PRIMARY" 
  enabled   = false

  notification = {
    type_name     = "GROUP"
    interval_min  = 60
    delay_min     = 0
    sms_enabled   = false
    email_enabled = true
    roles         = ["GROUP_OWNER"]
  }  
} 

My main.tf:


resource "mongodbatlas_alert_configuration" "default" {
  project_id = var.project_id #var.project_id[var.environment]
  event_type = var.event_type #"OUTSIDE_METRIC_THRESHOLD"
  enabled    = var.enabled

  notification {
    type_name     = var.type_name #"GROUP"
    interval_min  = var.interval_min # 5
    delay_min     = var.delay_min #0
    sms_enabled   = var.sms_enabled #false
    email_enabled = var.email_enabled #true
    roles         = var.roles #["GROUP_OWNER", "GROUP_CLUSTER_MANAGER"]
    api_token        = try(var.api_token, null)
  }

  matcher {
    field_name = try(var.matcher.field_name, null)
    operator   = try(var.matcher.operator, null)
    value = try(var.matcher.value, null)
  }

  metric_threshold_config {
    metric_name = try(var.metric_threshold_config.metric_name, null) #"ASSERT_REGULAR"
    operator    = try(var.metric_threshold_config.operator, null) #"LESS_THAN"
    threshold   = try(var.metric_threshold_config.threshold, null)#99.0
    units       = try(var.metric_threshold_config.units, null)#"RAW"
    mode        = try(var.metric_threshold_config.mode, null)#"AVERAGE"
  }

  threshold_config {
    operator    = try(var.threshold_config.operator, null) #"LESS_THAN"
    threshold   = try(var.threshold_config.threshold, null)#99.0
    units       = try(var.threshold_config.units, null)#"RAW"
  }
}

I try commenting the threshold_config part and the matcher (code below), but the error still happens.

resource "mongodbatlas_alert_configuration" "default" {
  project_id = var.project_id #var.project_id[var.environment]
  event_type = var.event_type #"OUTSIDE_METRIC_THRESHOLD"
  enabled    = var.enabled

  notification {
    type_name     = var.type_name #"GROUP"
    interval_min  = var.interval_min # 5
    delay_min     = var.delay_min #0
    sms_enabled   = var.sms_enabled #false
    email_enabled = var.email_enabled #true
    roles         = var.roles #["GROUP_OWNER", "GROUP_CLUSTER_MANAGER"]
    api_token        = try(var.api_token, null)
  }

  # matcher {
  #   field_name = try(var.matcher.field_name, null)
  #   operator   = try(var.matcher.operator, null)
  #   value = try(var.matcher.value, null)
  # }

  metric_threshold_config {
    metric_name = try(var.metric_threshold_config.metric_name, null) #"ASSERT_REGULAR"
    operator    = try(var.metric_threshold_config.operator, null) #"LESS_THAN"
    threshold   = try(var.metric_threshold_config.threshold, null)#99.0
    units       = try(var.metric_threshold_config.units, null)#"RAW"
    mode        = try(var.metric_threshold_config.mode, null)#"AVERAGE"
  }

  # threshold_config {
  #   operator    = try(var.threshold_config.operator, null) #"LESS_THAN"
  #   threshold   = try(var.threshold_config.threshold, null)#99.0
  #   units       = try(var.threshold_config.units, null)#"RAW"
  # }
}

This is the error I'm getting:


│ Error: Plugin did not respond
│
│   with mongodbatlas_alert_configuration.default,
│   on main.tf line 2, in resource "mongodbatlas_alert_configuration" "default":
│    2: resource "mongodbatlas_alert_configuration" "default" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵

Stack trace from the terraform-provider-mongodbatlas_v1.11.0 plugin:

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 27 [running]:
github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas.expandAlertConfigurationThresholdConfig(0x4143e5?)
        github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas/resource_mongodbatlas_alert_configuration.go:613 +0x314
github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas.resourceMongoDBAtlasAlertConfigurationCreate({0x1758948, 0xc000977a40}, 0x0?, {0x121f160?, 0xc00013c4b0?})
        github.com/mongodb/terraform-provider-mongodbatlas/mongodbatlas/resource_mongodbatlas_alert_configuration.go:307 +0x185
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0008048c0, {0x1758980, 0xc0007f3b90}, 0xd?, {0x121f160, 0xc00013c4b0})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:733 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0008048c0, {0x1758980, 0xc0007f3b90}, 0xc000956820, 0xc00011eb00, {0x121f160, 0xc00013c4b0})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/resource.go:864 +0xa7e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000127b18, {0x1758980?, 0xc0007f3a70?}, 0xc0006b4460)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.27.0/helper/schema/grpc_provider.go:1024 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0000b72c0, {0x1758980?, 0xc0007f21b0?}, 0xc000712150)
        github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/tf5server/server.go:821 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x137a400?, 0xc0000b72c0}, {0x1758980, 0xc0007f21b0}, 0xc0007120e0, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.18.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:422 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00020e000, {0x175d5a0, 0xc00053c1a0}, 0xc000b0a000, 0xc0008174d0, 0x1ffc080, 0x0)
        google.golang.org/grpc@v1.56.1/server.go:1337 +0xdf3
google.golang.org/grpc.(*Server).handleStream(0xc00020e000, {0x175d5a0, 0xc00053c1a0}, 0xc000b0a000, 0x0)
        google.golang.org/grpc@v1.56.1/server.go:1714 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.1()
        google.golang.org/grpc@v1.56.1/server.go:959 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.56.1/server.go:957 +0x18c

Error: The terraform-provider-mongodbatlas_v1.11.0 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Thanks

Kikivsantos commented 1 year ago

PS: I have created this new Issue for the problem: https://github.com/mongodb/terraform-provider-mongodbatlas/issues/1396