CiscoDevNet / terraform-provider-mso

Terraform Cisco MSO provider
https://registry.terraform.io/providers/CiscoDevNet/mso/latest/docs
Mozilla Public License 2.0
10 stars 32 forks source link

mso_schema_site_contract_service_graph_listener resource failed when the health_check is empty #261

Closed sajagana closed 7 months ago

sajagana commented 7 months ago

Community Note

mso_schema_site_contract_service_graph_listener resource failed when the health_check is empty.

Terraform Version

MSO version

APIC version and APIC Platform for Site Level Resources

Affected Resource(s)

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

Panic Output

Stack trace from the terraform-provider-mso plugin:

panic: runtime error: index out of range [0] with length 0

goroutine 27 [running]: github.com/terraform-providers/terraform-provider-mso/mso.resourceMSOSchemaSiteContractServiceGraphListener.func1(0xc0007e3830?, {0xc0005fcf60?, 0xc00034f540?}) /terraform-provider-mso/mso/resource_mso_schema_site_contract_service_graph_listener.go:440 +0x445b github.com/hashicorp/terraform-plugin-sdk/helper/schema.schemaMap.Diff(0xc0003e7320, 0xc00034f540, 0xc0005fcf60, 0x1cb65d8, {0x1c3e320, 0xc00092e2d0}, 0x0) /go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.17.1/helper/schema/schema.go:524 +0x363 github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Resource).simpleDiff(0x1b34a80?, 0xc00034f540, 0xc0000e5590?, {0x1c3e320?, 0xc00092e2d0?}) /go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.17.1/helper/schema/resource.go:366 +0x4d github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Provider).SimpleDiff(0xc000146080, 0xc00091f9f0, 0x1b345a0?, 0xc0005fc030?) /go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.17.1/helper/schema/provider.go:321 +0x6a github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(GRPCProviderServer).PlanResourceChange(0xc0000c2628, {0xc0008ec540?, 0x10bfbe6?}, 0xc0008ec540) /go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.17.1/internal/helper/plugin/grpc_provider.go:643 +0x5d3 github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_PlanResourceChange_Handler({0x1c1ab20?, 0xc0000c2628}, {0x1ea7b48, 0xc00059d0e0}, 0xc0000b4f00, 0x0) /go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.17.1/internal/tfplugin5/tfplugin5.pb.go:3287 +0x169 google.golang.org/grpc.(Server).processUnaryRPC(0xc00052e380, {0x1eac558, 0xc000242900}, 0xc00058e100, 0xc000464ae0, 0x2529048, 0x0) /go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1194 +0xc95 google.golang.org/grpc.(Server).handleStream(0xc00052e380, {0x1eac558, 0xc000242900}, 0xc00058e100, 0x0) /go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1517 +0x9e7 google.golang.org/grpc.(Server).serveStreams.func1.2() /go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:859 +0x8d created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 56 /go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:857 +0x246

Error: The terraform-provider-mso plugin crashed!

Expected Behavior

Actual Behavior

Steps to Reproduce

resource "mso_schema_site_contract_service_graph_listener" "AzureSG4_Test" {
    contract_name      = "C1"
    listener_name      = "L1"
    port               = 80
    protocol           = "http"
    schema_id          = "65c62b5ca88f0a41485db5c8"
    security_policy    = "default"
    service_node_index = 0
    site_id            = "653a267d5814510d6a51cb23"
    template_name      = "T1"
    rules {
        action_type       = "redirect"
        content_type      = "text_plain"
        name              = "default"
        port              = 80
        priority          = 1
        protocol          = "http"
        redirect_code     = "permanently_moved"
        redirect_port     = 443
        redirect_protocol = "https"
        response_code     = "205"
        target_ip_type    = "unspecified"
        url_type          = "original"
    }
}
  1. terraform apply
  2. terraform plan

Important Factoids

References