DataDog / terraform-provider-datadog

Terraform Datadog provider
https://www.terraform.io/docs/providers/datadog/
Mozilla Public License 2.0
403 stars 377 forks source link

Applying Sensitive Data Scanner Rule causes terraform-provider-datadog_v3.28.0 to crash #2040

Closed russwion closed 1 year ago

russwion commented 1 year ago

Datadog Terraform Provider Version

v3.28.0

Terraform Version

v1.1.9, I also tested with 1.3.2, same problem

What resources or data sources are affected?

datadog_sensitive_data_scanner_rule

Terraform Configuration Files

resource "datadog_sensitive_data_scanner_group" "tdc_mpv_nginx" {
  // fill in with group info
  name         = "Masaya Test"
  description  = ""
  filter {
    query      = "service:(tdc-mpv-nginx OR tdc-tsmpv-nginx)"
  }
  is_enabled   = true
  product_list = ["logs", "apm", "events"]
}

############################ VISA ################################
# Visa Card Scanner (4x4 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "vcs_4_4" {
  filter = "Visa Card Scanner (4x4 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "vcs_4_4" {
  name        = "Visa Card Scanner (4x4 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.vcs_4_4.id
  excluded_namespaces = [""]
  # admin.email,recipient
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  # sensitive_data:visa_credit_card,sensitive_data_category:credit_card,sensitive_data:test
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# Visa Card Scanner (2x8 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "vcs_2_8" {
  filter = "Visa Card Scanner (2x8 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "vcs_2_8" {
  name        = "Visa Card Scanner (2x8 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.vcs_2_8.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# Visa Card Scanner (1x16 & 1x19 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "vcs_1_6and2_8" {
  filter = "Visa Card Scanner (1x16 & 1x19 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "vcs_1_6and2_8" {
  name        = "Visa Card Scanner (1x16 & 1x19 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.vcs_1_6and2_8.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

############################ MASTERCARD ################################

# MasterCard Scanner (4x4 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "mcs_4_4" {
  filter = "MasterCard Scanner (4x4 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "mcs_4_4" {
  name        = "MasterCard Scanner (4x4 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.mcs_4_4.id
  excluded_namespaces = [""]
  # admin.email,recipient
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  # sensitive_data:master_card_credit_card,sensitive_data_category:credit_card,sensitive_data:test
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# MasterCard Scanner (2x8 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "mcs_2_8" {
  filter = "MasterCard Scanner (2x8 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "mcs_2_8" {
  name        = "MasterCard Scanner (2x8 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.mcs_2_8.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# MasterCard Scanner (1x16 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "mcs_1_16" {
  filter = "MasterCard Scanner (1x16 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "mcs_1_16" {
  name        = "MasterCard Scanner (1x16 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.mcs_1_16.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

############################ DISCOVER ################################

# Discover Card Scanner (4x4 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "dcs_4_4" {
  filter = "Discover Card Scanner (4x4 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "dcs_4_4" {
  name        = "Discover Card Scanner (4x4 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.dcs_4_4.id
  excluded_namespaces = [""]
  # admin.email,recipient
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  # sensitive_data:discover_credit_card,sensitive_data_category:credit_card,sensitive_data:test
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# Discover Card Scanner (2x8 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "dcs_2_8" {
  filter = "Discover Card Scanner (2x8 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "dcs_2_8" {
  name        = "Discover Card Scanner (2x8 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.dcs_2_8.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# Discover Card Scanner (1x16 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "dcs_1_16" {
  filter = "Discover Card Scanner (1x16 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "dcs_1_16" {
  name        = "Discover Card Scanner (1x16 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.dcs_1_16.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

############################ AMERICAN EXPRESS ################################

# American Express Card Scanner (4+6+5 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "aecs_4_6_5" {
  filter = "American Express Card Scanner (4+6+5 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "aecs_4_6_5" {
  name        = "American Express Card Scanner (4+6+5 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.aecs_4_6_5.id
  excluded_namespaces = [""]
  # admin.email,recipient
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  # sensitive_data:american_express_credit_card,sensitive_data_category:credit_card,sensitive_data:test
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# American Express Card Scanner (4+4+4+3 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "aecs_4_4_4_3" {
  filter = "American Express Card Scanner (4+4+4+3 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "aecs_4_4_4_3" {
  name        = "American Express Card Scanner (4+4+4+3 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.aecs_4_4_4_3.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# American Express Card Scanner (8+7 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "aecs_8_7" {
  filter = "American Express Card Scanner (8+7 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "aecs_8_7" {
  name        = "American Express Card Scanner (8+7 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.aecs_8_7.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# American Express Card Scanner (1x15 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "aecs_1_15" {
  filter = "American Express Card Scanner (1x15 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "aecs_1_15" {
  name        = "American Express Card Scanner (1x15 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.aecs_1_15.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

############################ DINERS ################################

# Diners Card Scanner (4+6+4 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "dcs_4_6_4" {
  filter = "Diners Card Scanner (4+6+4 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "dcs_4_6_4" {
  name        = "Diners Card Scanner (4+6+4 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.dcs_4_6_4.id
  excluded_namespaces = [""]
  # admin.email,recipient
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  #  sensitive_data:diners_credit_card,sensitive_data_category:credit_card,sensitive_data:test
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# Diners Card Scanner (4+4+4+2 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "dcs_4_4_4_2" {
  filter = "Diners Card Scanner (4+4+4+2 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "dcs_4_4_4_2" {
  name        = "Diners Card Scanner (4+4+4+2 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.dcs_4_4_4_2.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# Diners Card Scanner (8+6 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "dcs_8_6" {
  filter = "Diners Card Scanner (8+6 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "dcs_8_6" {
  name        = "Diners Card Scanner (8+6 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.dcs_8_6.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# Diners Card Scanner (1x14 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "dcs_1_14" {
  filter = "Diners Card Scanner (1x14 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "dcs_1_14" {
  name        = "Diners Card Scanner (1x14 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.dcs_1_14.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

############################ JCB ################################

# JCB Card Scanner (4x4 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "jcbcs_4_4" {
  filter = "JCB Card Scanner (4x4 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "jcbcs_4_4" {
  name        = "JCB Card Scanner (4x4 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.jcbcs_4_4.id
  excluded_namespaces = [""]
  # admin.email,recipient
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  # sensitive_data:jcb_credit_card,sensitive_data_category:credit_card,sensitive_data:test
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# JCB Card Scanner (2x8 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "jcbcs_2_8" {
  filter = "JCB Card Scanner (2x8 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "jcbcs_2_8" {
  name        = "JCB Card Scanner (2x8 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.jcbcs_2_8.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# JCB Card Scanner (1x16 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "jcbcs_1_16" {
  filter = "JCB Card Scanner (1x16 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "jcbcs_1_16" {
  name        = "JCB Card Scanner (1x16 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.jcbcs_1_16.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

############################ MAESTRO ################################

# Maestro Card Scanner (4x4 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "mstrocs_4_4" {
  filter = "Maestro Card Scanner (4x4 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "mstrocs_4_4" {
  name        = "Maestro Card Scanner (4x4 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.mstrocs_4_4.id
  excluded_namespaces = [""]
  # admin.email,recipient
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  # sensitive_data:maestro_card,sensitive_data_category:credit_card,sensitive_data:test
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# Maestro Card Scanner (2x8 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "mstrocs_2_8" {
  filter = "Maestro Card Scanner (2x8 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "mstrocs_2_8" {
  name        = "Maestro Card Scanner (2x8 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.mstrocs_2_8.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

# Maestro Card Scanner (1x16 digits)
data "datadog_sensitive_data_scanner_standard_pattern" "mstrocs_1_16" {
  filter = "Maestro Card Scanner (1x16 digits)"
}

resource "datadog_sensitive_data_scanner_rule" "mstrocs_1_16" {
  name        = "Maestro Card Scanner (1x16 digits)"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.mstrocs_1_16.id
  excluded_namespaces = [""]
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

############################ MISC. ################################

# Standard Iban Code Scanner | country identification numbers
data "datadog_sensitive_data_scanner_standard_pattern" "sics" {
  filter = "Standard Iban Code Scanner"
}

resource "datadog_sensitive_data_scanner_rule" "sics" {
  name        = "Standard Iban Code Scanner"
  description = ""
  group_id    = datadog_sensitive_data_scanner_group.tdc_mpv_nginx.id
  // As standard_pattern_id is provided, the resource MUST NOT contain the "pattern" attribute
  standard_pattern_id = data.datadog_sensitive_data_scanner_standard_pattern.sics.id
  excluded_namespaces = [""]
  # admin.email,recipient
  is_enabled          = true
  tags                = ["sensitive_data:true"]
  # sensitive_data:iban_code,sensitive_data_category:iban_code,sensitive_data:test
  text_replacement {
    type               = "replacement_string"
    replacement_string = "[sensitive data]"
  }
}

Relevant debug or panic output

Stack trace from the terraform-provider-datadog_v3.28.0 plugin:

panic: interface conversion: interface {} is nil, not string

goroutine 386 [running]: github.com/terraform-providers/terraform-provider-datadog/datadog.buildSensitiveDataScannerRuleAttributes(0x80000000000?) github.com/terraform-providers/terraform-provider-datadog/datadog/resource_datadog_sensitive_data_scanner_rule.go:226 +0x966 github.com/terraform-providers/terraform-provider-datadog/datadog.resourceDatadogSensitiveDataScannerRuleCreate({0x1bbcd60?, 0xc001723080?}, 0x0?, {0x1564440?, 0xc000ab7410?}) github.com/terraform-providers/terraform-provider-datadog/datadog/resource_datadog_sensitive_data_scanner_rule.go:161 +0x11a github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).create(0xc0009749a0, {0x1bbcd60, 0xc001723080}, 0xd?, {0x1564440, 0xc000ab7410}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/resource.go:707 +0x12e github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).Apply(0xc0009749a0, {0x1bbcd60, 0xc001723080}, 0xc000b2b930, 0xc000b3b680, {0x1564440, 0xc000ab7410}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/resource.go:837 +0xa85 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(GRPCProviderServer).ApplyResourceChange(0xc000010d08, {0x1bbcd60?, 0xc001722f60?}, 0xc001724320) github.com/hashicorp/terraform-plugin-sdk/v2@v2.26.1/helper/schema/grpc_provider.go:1021 +0xe8d github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ApplyResourceChange({0xc000a00ff0, 0xc000a01050, {0xc000ca33e0, 0x2, 0x2}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...) github.com/hashicorp/terraform-plugin-mux@v0.8.0/tf5muxserver/mux_server_ApplyResourceChange.go:27 +0x102 github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(server).ApplyResourceChange(0xc000c52f00, {0x1bbcd60?, 0xc001722240?}, 0xc001708850) github.com/hashicorp/terraform-plugin-go@v0.15.0/tfprotov5/tf5server/server.go:818 +0x574 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x1847320?, 0xc000c52f00}, {0x1bbcd60, 0xc001722240}, 0xc0017087e0, 0x0) github.com/hashicorp/terraform-plugin-go@v0.15.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:419 +0x170 google.golang.org/grpc.(Server).processUnaryRPC(0xc0007281e0, {0x1bc2140, 0xc000bce000}, 0xc00171cb40, 0xc000d94a50, 0x2869900, 0x0) google.golang.org/grpc@v1.54.0/server.go:1345 +0xdf0 google.golang.org/grpc.(Server).handleStream(0xc0007281e0, {0x1bc2140, 0xc000bce000}, 0xc00171cb40, 0x0) google.golang.org/grpc@v1.54.0/server.go:1722 +0xa2f google.golang.org/grpc.(Server).serveStreams.func1.2() google.golang.org/grpc@v1.54.0/server.go:966 +0x98 created by google.golang.org/grpc.(Server).serveStreams.func1 google.golang.org/grpc@v1.54.0/server.go:964 +0x28a

Error: The terraform-provider-datadog_v3.28.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.

Expected Behavior

24 SDS Rules should be creted

Actual Behavior

The plugin crashes

Steps to Reproduce

terraform apply

Important Factoids

This is running in TFE.

References

No response

skarimo commented 1 year ago

Thanks for the report. This will be closed by #2041 . In the meantime, you can remove the empty strings in the excluded_namespaces if its not useful to avoid the panic.