Closed matt-zappitello closed 2 years ago
I'm not sure if this helps, but when I manually added the samples in the portal, then applied my Terraform config again, it gave me the following output:
terraform apply azurerm_resource_group.matt_test: Refreshing state... [id=/subscriptions/20c74213-6aef-436f-bd6f-0399983b5594/resourceGroups/matt_test] azurerm_api_management.matts-apim: Refreshing state... [id=/subscriptions/20c74213-6aef-436f-bd6f-0399983b5594/resourceGroups/matt_test/providers/Microsoft.ApiManagement/service/matts-apim] azurerm_api_management_api.carto-replacement-api: Refreshing state... [id=/subscriptions/20c74213-6aef-436f-bd6f-0399983b5594/resourceGroups/matt_test/providers/Microsoft.ApiManagement/service/matts-apim/apis/carto-replacement-api] azurerm_api_management_api_operation.bbox: Refreshing state... [id=/subscriptions/20c74213-6aef-436f-bd6f-0399983b5594/resourceGroups/matt_test/providers/Microsoft.ApiManagement/service/matts-apim/apis/carto-replacement-api/operations/bbox] β· β Error: Plugin did not respond β β with azurerm_api_management_api_operation.bbox, β on main.tf line 56, in resource "azurerm_api_management_api_operation" "bbox": β 56: resource "azurerm_api_management_api_operation" "bbox" { β β The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin β logs may contain more details. β΅
Stack trace from the terraform-provider-azurerm_v2.98.0_x5.exe plugin:
panic: interface conversion: interface {} is map[string]interface {}, not string
goroutine 145 [running]: github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/schemaz.FlattenApiManagementOperationParameterExampleContract(0xc001c5b590) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/internal/services/apimanagement/schemaz/api_management.go:426 +0x3fc github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/schemaz.FlattenApiManagementOperationRepresentation(0xc0021a6210) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/internal/services/apimanagement/schemaz/api_management.go:200 +0x1db github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement.flattenApiManagementOperationResponseContract(0xc0021a6180) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/internal/services/apimanagement/api_management_api_operation_resource.go:359 +0x245 github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement.resourceApiManagementApiOperationRead(0xc001c4c300, {0x57563c0, 0xc000f16700}) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/internal/services/apimanagement/api_management_api_operation_resource.go:213 +0x6b6 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).read(0x60521fc, {0x6783898, 0xc001fdee40}, 0x24, {0x57563c0, 0xc000f16700}) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:346 +0x178 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).RefreshWithoutUpgrade(0xc000008d20, {0x6783898, 0xc001fdee40}, 0xc000eef1e0, {0x57563c0, 0xc000f16700}) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:635 +0x35b github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(GRPCProviderServer).ReadResource(0xc0015025e8, {0x6783898, 0xc001fdee40}, 0xc001fdeec0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go:576 +0x534 github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(server).ReadResource(0xc000310f00, {0x6783940, 0xc002f8db00}, 0xc00257d3e0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go:553 +0x3b0 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x5cab3a0, 0xc000310f00}, {0x6783940, 0xc002f8db00}, 0xc00257d380, 0x0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:344 +0x170 google.golang.org/grpc.(Server).processUnaryRPC(0xc000328fc0, {0x67d4508, 0xc00066c000}, 0xc002faf0e0, 0xc001132f90, 0xae323d0, 0x0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1292 +0xc6f google.golang.org/grpc.(Server).handleStream(0xc000328fc0, {0x67d4508, 0xc00066c000}, 0xc002faf0e0, 0x0) /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1617 +0xa2a google.golang.org/grpc.(Server).serveStreams.func1.2() /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:940 +0x98 created by google.golang.org/grpc.(Server).serveStreams.func1 /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:938 +0x294
Error: The terraform-provider-azurerm_v2.98.0_x5.exe 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.
Hey @matt-zappitello. It looks like this was fixed and merged in v3.1.0 of the provider with #14848. Feel free to reopen this if you're still experiencing this issue when upgrading
I'm going to lock this issue because it has been closed for 30 days β³. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Terraform (and AzureRM Provider) Version
Terraform v1.1.7 on windows_amd64
Affected Resource(s)
azurerm_api_management_api_operation
Terraform Configuration Files
Expected Behaviour
An API with a "Bounding Box" operation should have been created. The Request should have one representation added with a Sample including the JSON as specified in the above terraform. The 201 Response should also have a representation added with the Sample field populated.
Actual Behaviour
The API is created and both the Request and 201 Response have a representation added; however the Sample field for both representations is empty.
Steps to Reproduce
terraform apply
Important Factoids
I can do this exact thing manually so I suspect there is either a bug in the
representation.example
code being applied or I specified it incorrectly, in which case the documentation is incomplete and the examples insufficient for me to follow.