From 681f42b125584bf36876fb42e9c8579cb337c335 Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Tue, 14 Apr 2020 07:39:48 +0800 Subject: [PATCH 1/3] Fix #6452 --- .../services/network/resource_arm_application_gateway.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_application_gateway.go b/azurerm/internal/services/network/resource_arm_application_gateway.go index 341126d93371..dbc8576f0992 100644 --- a/azurerm/internal/services/network/resource_arm_application_gateway.go +++ b/azurerm/internal/services/network/resource_arm_application_gateway.go @@ -318,7 +318,7 @@ func resourceArmApplicationGateway() *schema.Resource { }, "frontend_port": { - Type: schema.TypeList, + Type: schema.TypeSet, Required: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -2405,7 +2405,7 @@ func flattenApplicationGatewayIPConfigurations(input *[]network.ApplicationGatew } func expandApplicationGatewayFrontendPorts(d *schema.ResourceData) *[]network.ApplicationGatewayFrontendPort { - vs := d.Get("frontend_port").([]interface{}) + vs := d.Get("frontend_port").(*schema.Set).List() results := make([]network.ApplicationGatewayFrontendPort, 0) for _, raw := range vs { From dcccf0b5db17f5e048f49a1d06e2cacd2420836d Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Wed, 22 Apr 2020 15:12:23 +0800 Subject: [PATCH 2/3] Make redirect_configuration TypeSet --- .../services/network/resource_arm_application_gateway.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_application_gateway.go b/azurerm/internal/services/network/resource_arm_application_gateway.go index dbc8576f0992..97c60cd47923 100644 --- a/azurerm/internal/services/network/resource_arm_application_gateway.go +++ b/azurerm/internal/services/network/resource_arm_application_gateway.go @@ -552,7 +552,7 @@ func resourceArmApplicationGateway() *schema.Resource { }, "redirect_configuration": { - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -3015,7 +3015,7 @@ func flattenApplicationGatewayRewriteRuleSets(input *[]network.ApplicationGatewa } func expandApplicationGatewayRedirectConfigurations(d *schema.ResourceData, gatewayID string) (*[]network.ApplicationGatewayRedirectConfiguration, error) { - vs := d.Get("redirect_configuration").([]interface{}) + vs := d.Get("redirect_configuration").(*schema.Set).List() results := make([]network.ApplicationGatewayRedirectConfiguration, 0) for _, raw := range vs { From 7622f8b15722c6f930b2a0da721468110d1bf967 Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Wed, 22 Apr 2020 15:13:12 +0800 Subject: [PATCH 3/3] Make request_routing_rule TypeSet --- .../services/network/resource_arm_application_gateway.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_application_gateway.go b/azurerm/internal/services/network/resource_arm_application_gateway.go index 97c60cd47923..8fcdd30c995b 100644 --- a/azurerm/internal/services/network/resource_arm_application_gateway.go +++ b/azurerm/internal/services/network/resource_arm_application_gateway.go @@ -461,7 +461,7 @@ func resourceArmApplicationGateway() *schema.Resource { }, "request_routing_rule": { - Type: schema.TypeList, + Type: schema.TypeSet, Required: true, MinItems: 1, Elem: &schema.Resource{ @@ -2663,7 +2663,7 @@ func flattenApplicationGatewayProbes(input *[]network.ApplicationGatewayProbe) [ } func expandApplicationGatewayRequestRoutingRules(d *schema.ResourceData, gatewayID string) (*[]network.ApplicationGatewayRequestRoutingRule, error) { - vs := d.Get("request_routing_rule").([]interface{}) + vs := d.Get("request_routing_rule").(*schema.Set).List() results := make([]network.ApplicationGatewayRequestRoutingRule, 0) for _, raw := range vs {