diff --git a/internal/services/legacy/virtual_machine_resource.go b/internal/services/legacy/virtual_machine_resource.go index 0d213fc02b49..e0c29de73ce7 100644 --- a/internal/services/legacy/virtual_machine_resource.go +++ b/internal/services/legacy/virtual_machine_resource.go @@ -16,7 +16,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate" @@ -166,14 +165,13 @@ func resourceVirtualMachine() *pluginsdk.Resource { }, "license_type": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, ValidateFunc: validation.StringInSlice([]string{ "Windows_Client", "Windows_Server", - }, !features.ThreePointOhBeta()), + }, false), }, "vm_size": { @@ -239,8 +237,7 @@ func resourceVirtualMachine() *pluginsdk.Resource { ValidateFunc: validation.StringInSlice([]string{ string(compute.OperatingSystemTypesLinux), string(compute.OperatingSystemTypesWindows), - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, "name": { @@ -275,8 +272,7 @@ func resourceVirtualMachine() *pluginsdk.Resource { string(compute.StorageAccountTypesPremiumLRS), string(compute.StorageAccountTypesStandardLRS), string(compute.StorageAccountTypesStandardSSDLRS), - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, "image_uri": { @@ -350,8 +346,7 @@ func resourceVirtualMachine() *pluginsdk.Resource { string(compute.StorageAccountTypesStandardLRS), string(compute.StorageAccountTypesStandardSSDLRS), string(compute.StorageAccountTypesUltraSSDLRS), - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, "create_option": { @@ -498,8 +493,7 @@ func resourceVirtualMachine() *pluginsdk.Resource { ValidateFunc: validation.StringInSlice([]string{ "HTTP", "HTTPS", - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, "certificate_url": { Type: pluginsdk.TypeString, diff --git a/internal/services/legacy/virtual_machine_scale_set_resource.go b/internal/services/legacy/virtual_machine_scale_set_resource.go index 864ac844e2bf..e3ca30c6b633 100644 --- a/internal/services/legacy/virtual_machine_scale_set_resource.go +++ b/internal/services/legacy/virtual_machine_scale_set_resource.go @@ -13,7 +13,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" validate2 "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate" @@ -133,14 +132,13 @@ func resourceVirtualMachineScaleSet() *pluginsdk.Resource { }, "license_type": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, ValidateFunc: validation.StringInSlice([]string{ "Windows_Client", "Windows_Server", - }, !features.ThreePointOhBeta()), + }, false), }, "upgrade_policy_mode": { @@ -150,8 +148,7 @@ func resourceVirtualMachineScaleSet() *pluginsdk.Resource { string(compute.UpgradeModeAutomatic), string(compute.UpgradeModeManual), string(compute.UpgradeModeRolling), - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, "health_probe_id": { @@ -224,8 +221,7 @@ func resourceVirtualMachineScaleSet() *pluginsdk.Resource { ValidateFunc: validation.StringInSlice([]string{ string(compute.VirtualMachinePriorityTypesLow), string(compute.VirtualMachinePriorityTypesRegular), - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, "eviction_policy": { @@ -591,8 +587,7 @@ func resourceVirtualMachineScaleSet() *pluginsdk.Resource { string(compute.StorageAccountTypesPremiumLRS), string(compute.StorageAccountTypesStandardLRS), string(compute.StorageAccountTypesStandardSSDLRS), - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, "caching": { @@ -651,8 +646,7 @@ func resourceVirtualMachineScaleSet() *pluginsdk.Resource { string(compute.StorageAccountTypesPremiumLRS), string(compute.StorageAccountTypesStandardLRS), string(compute.StorageAccountTypesStandardSSDLRS), - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, }, }, diff --git a/internal/services/loadbalancer/backend_address_pool_resource.go b/internal/services/loadbalancer/backend_address_pool_resource.go index b7fcbd0c4949..449d49962dd9 100644 --- a/internal/services/loadbalancer/backend_address_pool_resource.go +++ b/internal/services/loadbalancer/backend_address_pool_resource.go @@ -6,14 +6,11 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-05-01/network" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/validate" - networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -46,123 +43,88 @@ func resourceArmLoadBalancerBackendAddressPool() *pluginsdk.Resource { Delete: pluginsdk.DefaultTimeout(30 * time.Minute), }, - Schema: func() map[string]*pluginsdk.Schema { - s := map[string]*pluginsdk.Schema{ - "name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - - "loadbalancer_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validate.LoadBalancerID, - }, - - "tunnel_interface": { - Type: pluginsdk.TypeList, - Optional: true, - MinItems: 1, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "identifier": { - Type: pluginsdk.TypeInt, - Required: true, - }, + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "loadbalancer_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.LoadBalancerID, + }, + + "tunnel_interface": { + Type: pluginsdk.TypeList, + Optional: true, + MinItems: 1, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "identifier": { + Type: pluginsdk.TypeInt, + Required: true, + }, - "type": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - string(network.GatewayLoadBalancerTunnelInterfaceTypeNone), - string(network.GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(network.GatewayLoadBalancerTunnelInterfaceTypeExternal), - }, - false, - ), + "type": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + string(network.GatewayLoadBalancerTunnelInterfaceTypeNone), + string(network.GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(network.GatewayLoadBalancerTunnelInterfaceTypeExternal), }, + false, + ), + }, - "protocol": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - string(network.GatewayLoadBalancerTunnelProtocolNone), - string(network.GatewayLoadBalancerTunnelProtocolNative), - string(network.GatewayLoadBalancerTunnelProtocolVXLAN), - }, - false, - ), + "protocol": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + string(network.GatewayLoadBalancerTunnelProtocolNone), + string(network.GatewayLoadBalancerTunnelProtocolNative), + string(network.GatewayLoadBalancerTunnelProtocolVXLAN), }, + false, + ), + }, - "port": { - Type: pluginsdk.TypeInt, - Required: true, - }, + "port": { + Type: pluginsdk.TypeInt, + Required: true, }, }, }, + }, - "backend_ip_configurations": { - Type: pluginsdk.TypeList, - Computed: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - }, + "backend_ip_configurations": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, }, + }, - "load_balancing_rules": { - Type: pluginsdk.TypeList, - Computed: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - }, + "load_balancing_rules": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, }, + }, - "outbound_rules": { - Type: pluginsdk.TypeList, - Computed: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - }, + "outbound_rules": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, }, - } - - if !features.ThreePointOhBeta() { - s["resource_group_name"] = commonschema.ResourceGroupNameDeprecatedComputed() - s["backend_address"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeSet, - Optional: true, - Deprecated: "This field is non-functional and will be removed in version 3.0 of the Azure Provider - use the separate `azurerm_lb_backend_address_pool_address` resource instead.", - MinItems: 1, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "name": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - - "virtual_network_id": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: networkValidate.VirtualNetworkID, - }, - - "ip_address": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.IsIPAddress, - }, - }, - }, - } - } - - return s - }(), + }, + }, } } @@ -222,12 +184,6 @@ func resourceArmLoadBalancerBackendAddressPoolCreateUpdate(d *pluginsdk.Resource return fmt.Errorf("nil or empty `sku` for Load Balancer %q for Backend Address Pool %q was not found", loadBalancerId, id) } - // Sanity checks - if !features.ThreePointOhBeta() && len(d.Get("backend_address").(*pluginsdk.Set).List()) != 0 && sku.Name != network.LoadBalancerSkuNameStandard { - return fmt.Errorf("only the Standard (sku) Load Balancer allows IP based Backend Address Pool configuration,"+ - "whilst %q is of sku %s", id, sku.Name) - } - if len(d.Get("tunnel_interface").([]interface{})) != 0 && sku.Name != network.LoadBalancerSkuNameGateway { return fmt.Errorf("only the Gateway (sku) Load Balancer allows IP based Backend Address Pool configuration,"+ "whilst %q is of sku %s", id, sku.Name) @@ -313,18 +269,7 @@ func resourceArmLoadBalancerBackendAddressPoolRead(d *pluginsdk.ResourceData, me d.Set("name", id.BackendAddressPoolName) d.Set("loadbalancer_id", lbId.ID()) - if !features.ThreePointOhBeta() { - d.Set("resource_group_name", id.ResourceGroup) - } - if props := resp.BackendAddressPoolPropertiesFormat; props != nil { - if !features.ThreePointOhBeta() { - // @tombuildsstuff: this is a Set so won't be referenced, let's just nil this out for now - if err := d.Set("backend_address", []interface{}{}); err != nil { - return fmt.Errorf("setting `backend_address`: %v", err) - } - } - if err := d.Set("tunnel_interface", flattenGatewayLoadBalancerTunnelInterfaces(props.TunnelInterfaces)); err != nil { return fmt.Errorf("setting `tunnel_interface`: %v", err) } diff --git a/internal/services/loadbalancer/loadbalancer_outbound_rule_resource_test.go b/internal/services/loadbalancer/loadbalancer_outbound_rule_resource_test.go index 58b27283d187..1d6c3f5708b0 100644 --- a/internal/services/loadbalancer/loadbalancer_outbound_rule_resource_test.go +++ b/internal/services/loadbalancer/loadbalancer_outbound_rule_resource_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -193,10 +192,6 @@ func (r LoadBalancerOutboundRule) Destroy(ctx context.Context, client *clients.C } func (r LoadBalancerOutboundRule) basic(data acceptance.TestData) string { - var rg string - if !features.ThreePointOhBeta() { - rg = "resource_group_name = azurerm_resource_group.test.name" - } return fmt.Sprintf(` provider "azurerm" { features {} @@ -228,7 +223,6 @@ resource "azurerm_lb" "test" { } resource "azurerm_lb_backend_address_pool" "test" { - %s loadbalancer_id = azurerm_lb.test.id name = "be-%d" } @@ -243,7 +237,7 @@ resource "azurerm_lb_outbound_rule" "test" { name = "one-%d" } } -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, rg, data.RandomInteger, data.RandomInteger, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) } func (r LoadBalancerOutboundRule) requiresImport(data acceptance.TestData) string { @@ -265,10 +259,6 @@ resource "azurerm_lb_outbound_rule" "import" { } func (r LoadBalancerOutboundRule) multipleRules(data, data2 acceptance.TestData) string { - var rg string - if !features.ThreePointOhBeta() { - rg = "resource_group_name = azurerm_resource_group.test.name" - } return fmt.Sprintf(` provider "azurerm" { features {} @@ -313,7 +303,6 @@ resource "azurerm_lb" "test" { } resource "azurerm_lb_backend_address_pool" "test" { - %s loadbalancer_id = azurerm_lb.test.id name = "be-%d" } @@ -339,14 +328,10 @@ resource "azurerm_lb_outbound_rule" "test2" { name = "fe2-%d" } } -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, rg, data.RandomInteger, data.RandomInteger, data.RandomInteger, data2.RandomInteger, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data2.RandomInteger, data.RandomInteger) } func (r LoadBalancerOutboundRule) multipleRulesUpdate(data, data2 acceptance.TestData) string { - var rg string - if !features.ThreePointOhBeta() { - rg = "resource_group_name = azurerm_resource_group.test.name" - } return fmt.Sprintf(` provider "azurerm" { features {} @@ -391,7 +376,6 @@ resource "azurerm_lb" "test" { } resource "azurerm_lb_backend_address_pool" "test" { - %s loadbalancer_id = azurerm_lb.test.id name = "be-%d" } @@ -417,14 +401,10 @@ resource "azurerm_lb_outbound_rule" "test2" { name = "fe2-%d" } } -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, rg, data.RandomInteger, data.RandomInteger, data.RandomInteger, data2.RandomInteger, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data2.RandomInteger, data.RandomInteger) } func (r LoadBalancerOutboundRule) withPublicIPPrefix(data acceptance.TestData) string { - var rg string - if !features.ThreePointOhBeta() { - rg = "resource_group_name = azurerm_resource_group.test.name" - } return fmt.Sprintf(` provider "azurerm" { features {} @@ -455,7 +435,6 @@ resource "azurerm_lb" "test" { } resource "azurerm_lb_backend_address_pool" "test" { - %s loadbalancer_id = azurerm_lb.test.id name = "be-%d" } @@ -470,7 +449,7 @@ resource "azurerm_lb_outbound_rule" "test" { name = "one-%d" } } -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, rg, data.RandomInteger, data.RandomInteger, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) } func (r LoadBalancerOutboundRule) allocatedOutboundPortsDefault(data acceptance.TestData) string { diff --git a/internal/services/loadbalancer/loadbalancer_resource.go b/internal/services/loadbalancer/loadbalancer_resource.go index f4cce725245f..7b3d7c250b52 100644 --- a/internal/services/loadbalancer/loadbalancer_resource.go +++ b/internal/services/loadbalancer/loadbalancer_resource.go @@ -1,7 +1,6 @@ package loadbalancer import ( - "context" "fmt" "log" "strings" @@ -20,7 +19,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -49,27 +47,6 @@ func resourceArmLoadBalancer() *pluginsdk.Resource { }, Schema: resourceArmLoadBalancerSchema(), - - CustomizeDiff: pluginsdk.CustomizeDiffShim(func(ctx context.Context, d *pluginsdk.ResourceDiff, v interface{}) error { - if features.ThreePointOhBeta() { - return nil - } - if ok := d.HasChange("frontend_ip_configuration"); ok { - configs := d.Get("frontend_ip_configuration").([]interface{}) - - for index := range configs { - if d.HasChange(fmt.Sprintf("frontend_ip_configuration.%d.availability_zone", index)) && !d.HasChange(fmt.Sprintf("frontend_ip_configuration.%d.name", index)) { - return fmt.Errorf("in place change of the `frontend_ip_configuration.%[1]d.availability_zone` is not allowed. It is allowed to do this while also changing `frontend_ip_configuration.%[1]d.name`", index) - } - - if d.HasChange(fmt.Sprintf("frontend_ip_configuration.%d.zones", index)) && !d.HasChange(fmt.Sprintf("frontend_ip_configuration.%d.name", index)) { - return fmt.Errorf("in place change of the `frontend_ip_configuration.%[1]d.zones` is not allowed. It is allowed to do this while also changing `frontend_ip_configuration.%[1]d.name`", index) - } - } - } - - return nil - }), } } @@ -225,9 +202,8 @@ func resourceArmLoadBalancerDelete(d *pluginsdk.ResourceData, meta interface{}) func expandAzureRmLoadBalancerFrontendIpConfigurations(d *pluginsdk.ResourceData) (*[]network.FrontendIPConfiguration, error) { configs := d.Get("frontend_ip_configuration").([]interface{}) frontEndConfigs := make([]network.FrontendIPConfiguration, 0, len(configs)) - sku := d.Get("sku").(string) - for index, configRaw := range configs { + for _, configRaw := range configs { data := configRaw.(map[string]interface{}) privateIpAllocationMethod := data["private_ip_address_allocation"].(string) @@ -245,7 +221,6 @@ func expandAzureRmLoadBalancerFrontendIpConfigurations(d *pluginsdk.ResourceData properties.PrivateIPAddress = &v } - subnetSet := false if v := data["public_ip_address_id"].(string); v != "" { properties.PublicIPAddress = &network.PublicIPAddress{ ID: &v, @@ -259,7 +234,6 @@ func expandAzureRmLoadBalancerFrontendIpConfigurations(d *pluginsdk.ResourceData } if v := data["subnet_id"].(string); v != "" { - subnetSet = true properties.PrivateIPAddressVersion = network.IPVersionIPv4 if v := data["private_ip_address_version"].(string); v != "" { properties.PrivateIPAddressVersion = network.IPVersion(v) @@ -274,46 +248,9 @@ func expandAzureRmLoadBalancerFrontendIpConfigurations(d *pluginsdk.ResourceData FrontendIPConfigurationPropertiesFormat: &properties, } - if features.ThreePointOhBeta() { - zones := zones.Expand(data["zones"].(*pluginsdk.Set).List()) - if len(zones) > 0 { - frontEndConfig.Zones = &zones - } - } else { - zones := &[]string{"1", "2"} - zonesSet := false - if deprecatedZonesRaw, ok := d.GetOk(fmt.Sprintf("frontend_ip_configuration.%d.zones", index)); ok { - zonesSet = true - deprecatedZones := azure.ExpandZones(deprecatedZonesRaw.([]interface{})) - if deprecatedZones != nil { - zones = deprecatedZones - } - } - - if availabilityZones, ok := d.GetOk(fmt.Sprintf("frontend_ip_configuration.%d.availability_zone", index)); ok { - zonesSet = true - switch availabilityZones.(string) { - case "1", "2", "3": - zones = &[]string{availabilityZones.(string)} - case "Zone-Redundant": - zones = &[]string{"1", "2"} - case "No-Zone": - zones = &[]string{} - } - } - if strings.EqualFold(sku, string(network.LoadBalancerSkuNameBasic)) { - if zonesSet && len(*zones) > 0 { - return nil, fmt.Errorf("Availability Zones are not available on the `Basic` SKU") - } - zones = &[]string{} - } else if !subnetSet { - if zonesSet && len(*zones) > 0 { - return nil, fmt.Errorf("Networking supports zones only for frontendIpconfigurations which reference a subnet.") - } - zones = &[]string{} - } - - frontEndConfig.Zones = zones + zones := zones.Expand(data["zones"].(*pluginsdk.Set).List()) + if len(zones) > 0 { + frontEndConfig.Zones = &zones } frontEndConfigs = append(frontEndConfigs, frontEndConfig) @@ -413,33 +350,16 @@ func flattenLoadBalancerFrontendIpConfiguration(ipConfigs *[]network.FrontendIPC "private_ip_address_allocation": privateIPAllocationMethod, "public_ip_prefix_id": publicIpPrefixId, "subnet_id": subnetId, + "zones": zones.Flatten(config.Zones), } - if features.ThreePointOhBeta() { - out["zones"] = zones.Flatten(config.Zones) - } else { - availabilityZones := "No-Zone" - zonesDeprecated := make([]string, 0) - if config.Zones != nil { - if len(*config.Zones) > 1 { - availabilityZones = "Zone-Redundant" - } - if len(*config.Zones) == 1 { - zones := *config.Zones - availabilityZones = zones[0] - zonesDeprecated = zones - } - } - out["availability_zone"] = availabilityZones - out["zones"] = zonesDeprecated - } result = append(result, out) } return result } func resourceArmLoadBalancerSchema() map[string]*pluginsdk.Schema { - out := map[string]*pluginsdk.Schema{ + return map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, Required: true, @@ -461,8 +381,7 @@ func resourceArmLoadBalancerSchema() map[string]*pluginsdk.Schema { string(network.LoadBalancerSkuNameBasic), string(network.LoadBalancerSkuNameStandard), string(network.LoadBalancerSkuNameGateway), - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, "sku_tier": { @@ -578,6 +497,8 @@ func resourceArmLoadBalancerSchema() map[string]*pluginsdk.Schema { Set: pluginsdk.HashString, }, + "zones": commonschema.ZonesMultipleOptionalForceNew(), + "id": { Type: pluginsdk.TypeString, Computed: true, @@ -600,39 +521,6 @@ func resourceArmLoadBalancerSchema() map[string]*pluginsdk.Schema { "tags": tags.Schema(), } - - s := out["frontend_ip_configuration"].Elem.(*pluginsdk.Resource) - if !features.ThreePointOhBeta() { - s.Schema["availability_zone"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - Optional: true, - // Default: "Zone-Redundant", - Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - "No-Zone", - "1", - "2", - "3", - "Zone-Redundant", - }, false), - } - - s.Schema["zones"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeList, - Optional: true, - Computed: true, - Deprecated: "This property has been deprecated in favour of `availability_zone` due to a breaking behavioural change in Azure: https://azure.microsoft.com/en-us/updates/zone-behavior-change/", - MaxItems: 1, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validation.StringIsNotEmpty, - }, - } - } else { - s.Schema["zones"] = commonschema.ZonesMultipleOptionalForceNew() - } - - return out } func expandEdgeZone(input string) *network.ExtendedLocation { diff --git a/internal/services/loadbalancer/loadbalancer_resource_test.go b/internal/services/loadbalancer/loadbalancer_resource_test.go index 6f1c5681cd8c..745907799756 100644 --- a/internal/services/loadbalancer/loadbalancer_resource_test.go +++ b/internal/services/loadbalancer/loadbalancer_resource_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -166,10 +165,6 @@ func TestAccAzureRMLoadBalancer_privateIP(t *testing.T) { } func TestAccAzureRMLoadBalancer_zonesSingle(t *testing.T) { - if !features.ThreePointOhBeta() { - t.Skip("skipping since this requires the 3.0 beta") - } - data := acceptance.BuildTestData(t, "azurerm_lb", "test") r := LoadBalancer{} @@ -185,10 +180,6 @@ func TestAccAzureRMLoadBalancer_zonesSingle(t *testing.T) { } func TestAccAzureRMLoadBalancer_zonesMultiple(t *testing.T) { - if !features.ThreePointOhBeta() { - t.Skip("skipping since this requires the 3.0 beta") - } - data := acceptance.BuildTestData(t, "azurerm_lb", "test") r := LoadBalancer{} @@ -203,99 +194,6 @@ func TestAccAzureRMLoadBalancer_zonesMultiple(t *testing.T) { }) } -func TestAccAzureRMLoadBalancer_legacyUpdateFrontEndConfigsWithZone(t *testing.T) { - if features.ThreePointOhBeta() { - t.Skip("this test is not applicable in 3.0 mode") - } - data := acceptance.BuildTestData(t, "azurerm_lb", "test") - r := LoadBalancer{} - - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.availability_zone_update1(data, "Zone-Redundant"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - { - Config: r.availability_zone_update1(data, "No-Zone"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - { - Config: r.availability_zone_update1(data, "Zone-Redundant"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - { - Config: r.availability_zone_update2(data, "Zone-Redundant"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - -func TestAccAzureRMLoadBalancer_legacyZoneRedundant(t *testing.T) { - if features.ThreePointOhBeta() { - t.Skip("this test is not applicable in 3.0 mode") - } - data := acceptance.BuildTestData(t, "azurerm_lb", "test") - r := LoadBalancer{} - - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.availability_zone(data, "Zone-Redundant"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - -func TestAccAzureRMLoadBalancer_legacyNoZone(t *testing.T) { - if features.ThreePointOhBeta() { - t.Skip("this test is not applicable in 3.0 mode") - } - data := acceptance.BuildTestData(t, "azurerm_lb", "test") - r := LoadBalancer{} - - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.availability_zone(data, "No-Zone"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - -func TestAccAzureRMLoadBalancer_legacySingleZone(t *testing.T) { - if features.ThreePointOhBeta() { - t.Skip("this test is not applicable in 3.0 mode") - } - data := acceptance.BuildTestData(t, "azurerm_lb", "test") - r := LoadBalancer{} - - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.availability_zone(data, "1"), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - func TestAccAzureRMLoadBalancer_PointToGatewayLB(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_lb", "test") r := LoadBalancer{} @@ -746,144 +644,6 @@ resource "azurerm_lb" "test" { `, data.RandomInteger, data.Locations.Primary) } -func (r LoadBalancer) availability_zone(data acceptance.TestData, zone string) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-lb-%d" - location = "%s" -} - -resource "azurerm_virtual_network" "test" { - name = "acctvn-%d" - address_space = ["10.0.0.0/16"] - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name -} - -resource "azurerm_subnet" "test" { - name = "acctsub-%d" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name - address_prefixes = ["10.0.2.0/24"] -} - -resource "azurerm_lb" "test" { - name = "acctestlb-%d" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location - sku = "Standard" - - frontend_ip_configuration { - name = "Internal" - private_ip_address_allocation = "Static" - private_ip_address_version = "IPv4" - private_ip_address = "10.0.2.7" - subnet_id = azurerm_subnet.test.id - availability_zone = "%s" - } -} -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, zone) -} - -func (r LoadBalancer) availability_zone_update1(data acceptance.TestData, zone string) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-lb-%[1]d" - location = "%[2]s" -} - -resource "azurerm_virtual_network" "test" { - name = "acctvn-%[1]d" - address_space = ["10.0.0.0/16"] - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name -} - -resource "azurerm_subnet" "test" { - name = "acctsub-%[1]d" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name - address_prefixes = ["10.0.2.0/24"] -} - -resource "azurerm_lb" "test" { - name = "acctestlb-%[1]d" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location - sku = "Standard" - - frontend_ip_configuration { - name = "Internal-%[3]s" - private_ip_address_allocation = "Static" - private_ip_address_version = "IPv4" - private_ip_address = "10.0.2.7" - subnet_id = azurerm_subnet.test.id - availability_zone = "%[3]s" - } -} -`, data.RandomInteger, data.Locations.Primary, zone) -} - -func (r LoadBalancer) availability_zone_update2(data acceptance.TestData, zone string) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-lb-%[1]d" - location = "%[2]s" -} - -resource "azurerm_virtual_network" "test" { - name = "acctvn-%[1]d" - address_space = ["10.0.0.0/16"] - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name -} - -resource "azurerm_subnet" "test" { - name = "acctsub-%[1]d" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name - address_prefixes = ["10.0.2.0/24"] -} - -resource "azurerm_lb" "test" { - name = "acctestlb-%[1]d" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location - sku = "Standard" - - frontend_ip_configuration { - name = "Internal-%[3]s" - private_ip_address_allocation = "Static" - private_ip_address_version = "IPv4" - private_ip_address = "10.0.2.7" - subnet_id = azurerm_subnet.test.id - availability_zone = "%[3]s" - } - - frontend_ip_configuration { - name = "Internal2-%[3]s" - private_ip_address_allocation = "Static" - private_ip_address_version = "IPv4" - private_ip_address = "10.0.2.8" - subnet_id = azurerm_subnet.test.id - availability_zone = "%[3]s" - } -} -`, data.RandomInteger, data.Locations.Primary, zone) -} - func (r LoadBalancer) pointToGatewayLB(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/loadbalancer/loadbalancer_rule_data_source_test.go b/internal/services/loadbalancer/loadbalancer_rule_data_source_test.go index 3be6ca1caaf8..6d286e1077b9 100644 --- a/internal/services/loadbalancer/loadbalancer_rule_data_source_test.go +++ b/internal/services/loadbalancer/loadbalancer_rule_data_source_test.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" ) func TestAccAzureRMDataSourceLoadBalancerRule_basic(t *testing.T) { @@ -65,16 +64,11 @@ data "azurerm_lb_rule" "test" { } func (r LoadBalancerRule) completeDataSource(data acceptance.TestData) string { - var rg string - if !features.ThreePointOhBeta() { - rg = "resource_group_name = azurerm_resource_group.test.name" - } template := r.template(data, "Standard") return fmt.Sprintf(` %s resource "azurerm_lb_backend_address_pool" "test" { - name = "LbPool-%s" - %s + name = "LbPool-%s" loadbalancer_id = azurerm_lb.test.id } @@ -108,5 +102,5 @@ data "azurerm_lb_rule" "test" { name = azurerm_lb_rule.test.name loadbalancer_id = azurerm_lb_rule.test.loadbalancer_id } -`, template, data.RandomStringOfLength(8), rg, data.RandomStringOfLength(8), data.RandomStringOfLength(8)) +`, template, data.RandomStringOfLength(8), data.RandomStringOfLength(8), data.RandomStringOfLength(8)) } diff --git a/internal/services/loadbalancer/loadbalancer_rule_resource_test.go b/internal/services/loadbalancer/loadbalancer_rule_resource_test.go index 7ccbb40662d1..84ba45b1e2d2 100644 --- a/internal/services/loadbalancer/loadbalancer_rule_resource_test.go +++ b/internal/services/loadbalancer/loadbalancer_rule_resource_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -357,17 +356,12 @@ resource "azurerm_lb_rule" "import" { // https://github.com/hashicorp/terraform/issues/9424 func (r LoadBalancerRule) inconsistentRead(data acceptance.TestData) string { - var rg string - if !features.ThreePointOhBeta() { - rg = "resource_group_name = azurerm_resource_group.test.name" - } template := r.template(data, "Basic") return fmt.Sprintf(` %s resource "azurerm_lb_backend_address_pool" "test" { - name = "%d-address-pool" - %s + name = "%d-address-pool" loadbalancer_id = azurerm_lb.test.id } @@ -386,7 +380,7 @@ resource "azurerm_lb_rule" "test" { backend_port = 3389 frontend_ip_configuration_name = azurerm_lb.test.frontend_ip_configuration.0.name } -`, template, data.RandomInteger, rg, data.RandomInteger, data.RandomStringOfLength(8)) +`, template, data.RandomInteger, data.RandomInteger, data.RandomStringOfLength(8)) } func (r LoadBalancerRule) multipleRules(data, data2 acceptance.TestData) string { diff --git a/internal/services/loadbalancer/nat_pool_resource.go b/internal/services/loadbalancer/nat_pool_resource.go index 3591c20f36ac..2f9b741b67f9 100644 --- a/internal/services/loadbalancer/nat_pool_resource.go +++ b/internal/services/loadbalancer/nat_pool_resource.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" loadBalancerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/validate" @@ -70,7 +69,7 @@ func resourceArmLoadBalancerNatPool() *pluginsdk.Resource { string(network.TransportProtocolAll), string(network.TransportProtocolTCP), string(network.TransportProtocolUDP), - }, !features.ThreePointOhBeta()), + }, false), }, "frontend_port_start": { diff --git a/internal/services/loadbalancer/nat_rule_resource.go b/internal/services/loadbalancer/nat_rule_resource.go index 4ee90bafab2d..394b91b4582e 100644 --- a/internal/services/loadbalancer/nat_rule_resource.go +++ b/internal/services/loadbalancer/nat_rule_resource.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" loadBalancerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/validate" @@ -70,7 +69,7 @@ func resourceArmLoadBalancerNatRule() *pluginsdk.Resource { string(network.TransportProtocolAll), string(network.TransportProtocolTCP), string(network.TransportProtocolUDP), - }, !features.ThreePointOhBeta()), + }, false), }, "frontend_port": { diff --git a/internal/services/loadbalancer/probe_resource.go b/internal/services/loadbalancer/probe_resource.go index 39a4c2b47c5f..6a3c7dec64e9 100644 --- a/internal/services/loadbalancer/probe_resource.go +++ b/internal/services/loadbalancer/probe_resource.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" loadBalancerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/validate" @@ -68,7 +67,7 @@ func resourceArmLoadBalancerProbe() *pluginsdk.Resource { string(network.ProbeProtocolHTTP), string(network.ProbeProtocolHTTPS), string(network.ProbeProtocolTCP), - }, !features.ThreePointOhBeta()), + }, false), }, "port": { diff --git a/internal/services/loadbalancer/rule_data_source.go b/internal/services/loadbalancer/rule_data_source.go index 10c47686a1b5..53d6eec0190b 100644 --- a/internal/services/loadbalancer/rule_data_source.go +++ b/internal/services/loadbalancer/rule_data_source.go @@ -5,9 +5,7 @@ import ( "log" "time" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -53,11 +51,7 @@ func dataSourceArmLoadBalancerRuleRead(d *pluginsdk.ResourceData, meta interface defer cancel() id := parse.NewLoadBalancingRuleID(loadBalancerId.SubscriptionId, loadBalancerId.ResourceGroup, loadBalancerId.Name, name) - resourceGroup := id.ResourceGroup - if !features.ThreePointOhBeta() { - resourceGroup = d.Get("resource_group_name").(string) - } - resp, err := lbRuleClient.Get(ctx, resourceGroup, *loadBalancer.Name, name) + resp, err := lbRuleClient.Get(ctx, id.ResourceGroup, *loadBalancer.Name, name) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("%s was not found", id) @@ -115,7 +109,7 @@ func dataSourceArmLoadBalancerRuleRead(d *pluginsdk.ResourceData, meta interface } func dataSourceArmLoadBalancerSchema() map[string]*pluginsdk.Schema { - out := map[string]*pluginsdk.Schema{ + return map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, Required: true, @@ -185,10 +179,4 @@ func dataSourceArmLoadBalancerSchema() map[string]*pluginsdk.Schema { Computed: true, }, } - - if !features.ThreePointOhBeta() { - out["resource_group_name"] = commonschema.ResourceGroupNameForDataSource() - } - - return out } diff --git a/internal/services/loadbalancer/rule_resource.go b/internal/services/loadbalancer/rule_resource.go index 829c657a2792..c9c143d626eb 100644 --- a/internal/services/loadbalancer/rule_resource.go +++ b/internal/services/loadbalancer/rule_resource.go @@ -11,7 +11,6 @@ import ( "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-05-01/network" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -172,9 +171,6 @@ func resourceArmLoadBalancerRuleRead(d *pluginsdk.ResourceData, meta interface{} backendAddressPoolIds = append(backendAddressPoolIds, *p.ID) } } - if len(backendAddressPoolIds) == 1 { - backendAddressPoolId = backendAddressPoolIds[0].(string) - } } } else { if props.BackendAddressPool != nil && props.BackendAddressPool.ID != nil { @@ -182,10 +178,6 @@ func resourceArmLoadBalancerRuleRead(d *pluginsdk.ResourceData, meta interface{} backendAddressPoolIds = []interface{}{backendAddressPoolId} } } - if !features.ThreePointOhBeta() { - - d.Set("backend_address_pool_id", backendAddressPoolId) - } d.Set("backend_address_pool_ids", backendAddressPoolIds) frontendIPConfigName := "" @@ -309,21 +301,6 @@ func expandAzureRmLoadBalancerRule(d *pluginsdk.ResourceData, lb *network.LoadBa if lb.Sku != nil && lb.Sku.Name == network.LoadBalancerSkuNameGateway { isGateway = true } - if !features.ThreePointOhBeta() { - if v := d.Get("backend_address_pool_id").(string); v != "" { - if isGateway { - properties.BackendAddressPools = &[]network.SubResource{ - { - ID: &v, - }, - } - } else { - properties.BackendAddressPool = &network.SubResource{ - ID: &v, - } - } - } - } if l := d.Get("backend_address_pool_ids").([]interface{}); len(l) != 0 { if isGateway { @@ -358,7 +335,7 @@ func expandAzureRmLoadBalancerRule(d *pluginsdk.ResourceData, lb *network.LoadBa } func resourceArmLoadBalancerRuleSchema() map[string]*pluginsdk.Schema { - out := map[string]*pluginsdk.Schema{ + return map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, Required: true, @@ -387,19 +364,12 @@ func resourceArmLoadBalancerRuleSchema() map[string]*pluginsdk.Schema { "backend_address_pool_ids": { Type: pluginsdk.TypeList, Optional: true, - Computed: !features.ThreePointOhBeta(), MinItems: 1, MaxItems: 2, // Only Gateway SKU LB can have 2 backend address pools Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, ValidateFunc: loadBalancerValidate.LoadBalancerBackendAddressPoolID, }, - ConflictsWith: func() []string { - if !features.ThreePointOhBeta() { - return []string{"backend_address_pool_id"} - } - return []string{} - }(), }, "protocol": { @@ -410,7 +380,7 @@ func resourceArmLoadBalancerRuleSchema() map[string]*pluginsdk.Schema { string(network.TransportProtocolAll), string(network.TransportProtocolTCP), string(network.TransportProtocolUDP), - }, !features.ThreePointOhBeta()), + }, false), }, "frontend_port": { @@ -463,16 +433,4 @@ func resourceArmLoadBalancerRuleSchema() map[string]*pluginsdk.Schema { Computed: true, }, } - - if !features.ThreePointOhBeta() { - out["backend_address_pool_id"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - Deprecated: "This property has been deprecated by `backend_address_pool_ids` and will be removed in the next major version of the provider", - ConflictsWith: []string{"backend_address_pool_ids"}, - } - - } - return out } diff --git a/internal/services/loganalytics/log_analytics_datasource_windows_event_resource.go b/internal/services/loganalytics/log_analytics_datasource_windows_event_resource.go index b7a5d58bbeea..08827234034a 100644 --- a/internal/services/loganalytics/log_analytics_datasource_windows_event_resource.go +++ b/internal/services/loganalytics/log_analytics_datasource_windows_event_resource.go @@ -11,7 +11,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/validate" @@ -79,8 +78,7 @@ func resourceLogAnalyticsDataSourceWindowsEvent() *pluginsdk.Resource { Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, // API backend accepts event_types case-insensitively - ValidateFunc: validation.StringInSlice([]string{"Error", "Warning", "Information"}, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + ValidateFunc: validation.StringInSlice([]string{"Error", "Warning", "Information"}, false), }, }, }, diff --git a/internal/services/loganalytics/log_analytics_linked_service_resource.go b/internal/services/loganalytics/log_analytics_linked_service_resource.go index 39daff5df0df..65ddd4e6b7c4 100644 --- a/internal/services/loganalytics/log_analytics_linked_service_resource.go +++ b/internal/services/loganalytics/log_analytics_linked_service_resource.go @@ -12,14 +12,11 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" validateAuto "github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -45,70 +42,6 @@ func resourceLogAnalyticsLinkedService() *pluginsdk.Resource { Schema: resourceLogAnalyticsLinkedServiceSchema(), CustomizeDiff: pluginsdk.CustomizeDiffShim(func(ctx context.Context, d *pluginsdk.ResourceDiff, v interface{}) error { - if !features.ThreePointOhBeta() && d.HasChange("linked_service_name") { - oldServiceName, newServiceName := d.GetChange("linked_service_name") - - // This is an unneeded field, if it is removed you can safely ignore it - // as it's value can be(and is) derived via the 'read_access_id' field. It - // is only here for backwards compatibility to avoid a breaking change - if newServiceName.(string) != "" { - // Ignore change if it's in case only - if !strings.EqualFold(oldServiceName.(string), newServiceName.(string)) { - d.ForceNew("linked_service_name") - } - } - } - - if !features.ThreePointOhBeta() && d.HasChange("workspace_id") { - forceNew := true - _, newWorkspaceName := d.GetChange("workspace_name") - oldWorkspaceID, newWorkspaceID := d.GetChange("workspace_id") - - // If the workspcae ID has been removed, only do a force new if the new workspace name - // and the old workspace ID points to different workspaces - if oldWorkspaceID.(string) != "" && newWorkspaceName.(string) != "" && newWorkspaceID.(string) == "" { - workspace, err := parse.LogAnalyticsWorkspaceID(oldWorkspaceID.(string)) - if err == nil { - if workspace.WorkspaceName == newWorkspaceName.(string) { - forceNew = false - } - } - } - - if forceNew { - d.ForceNew("workspace_id") - } - } - - if !features.ThreePointOhBeta() && d.HasChange("workspace_name") { - forceNew := true - oldWorkspaceName, newWorkspaceName := d.GetChange("workspace_name") - _, newWorkspaceID := d.GetChange("workspace_id") - - // If the workspcae name has been removed, only do a force new if the new workspace ID - // and the old workspace name points to different workspaces - if oldWorkspaceName.(string) != "" && newWorkspaceID.(string) != "" && newWorkspaceName.(string) == "" { - workspace, err := parse.LogAnalyticsWorkspaceID(newWorkspaceID.(string)) - if err == nil { - if workspace.WorkspaceName == oldWorkspaceName.(string) { - forceNew = false - } - } - } - - if forceNew { - d.ForceNew("workspace_name") - } - } - - if !features.ThreePointOhBeta() && d.HasChange("resource_id") { - if resourceID := d.Get("resource_id").(string); resourceID != "" { - if _, err := validateAuto.AutomationAccountID(resourceID, "resource_id"); err != nil { - return fmt.Errorf("'resource_id' must be an Automation Account resource ID, got %q", resourceID) - } - } - } - if d.HasChange("read_access_id") { if readAccessID := d.Get("read_access_id").(string); readAccessID != "" { if _, err := validateAuto.AutomationAccountID(readAccessID, "read_acces_id"); err != nil { @@ -138,26 +71,11 @@ func resourceLogAnalyticsLinkedServiceCreateUpdate(d *pluginsdk.ResourceData, me log.Printf("[INFO] preparing arguments for AzureRM Log Analytics Linked Services creation.") - var tmpSpace parse.LogAnalyticsWorkspaceId var workspaceId string - resourceGroup := d.Get("resource_group_name").(string) readAccess := d.Get("read_access_id").(string) writeAccess := d.Get("write_access_id").(string) - - if !features.ThreePointOhBeta() { - if resourceId := d.Get("resource_id").(string); resourceId != "" { - readAccess = resourceId - } - } - workspaceId = d.Get("workspace_id").(string) - if !features.ThreePointOhBeta() { - if workspaceName := d.Get("workspace_name").(string); workspaceName != "" { - tmpSpace = parse.NewLogAnalyticsWorkspaceID(subscriptionId, resourceGroup, workspaceName) - workspaceId = tmpSpace.ID() - } - } workspace, err := parse.LogAnalyticsWorkspaceID(workspaceId) if err != nil { @@ -166,15 +84,6 @@ func resourceLogAnalyticsLinkedServiceCreateUpdate(d *pluginsdk.ResourceData, me id := parse.NewLogAnalyticsLinkedServiceID(subscriptionId, resourceGroup, workspace.WorkspaceName, LogAnalyticsLinkedServiceType(readAccess)) - if !features.ThreePointOhBeta() { - linkedServiceName := d.Get("linked_service_name").(string) - if linkedServiceName != "" { - if !strings.EqualFold(linkedServiceName, LogAnalyticsLinkedServiceType(readAccess)) { - return fmt.Errorf("Linked Service '%s/%s' (Resource Group %q): 'linked_service_name' %q does not match expected value of %q", workspace.WorkspaceName, id.LinkedServiceName, resourceGroup, linkedServiceName, LogAnalyticsLinkedServiceType(readAccess)) - } - } - } - if strings.EqualFold(id.LinkedServiceName, "Cluster") && writeAccess == "" { return fmt.Errorf("Linked Service '%s/%s' (Resource Group %q): A linked Log Analytics Cluster requires the 'write_access_id' attribute to be set", workspace.WorkspaceName, id.LinkedServiceName, resourceGroup) } @@ -252,17 +161,9 @@ func resourceLogAnalyticsLinkedServiceRead(d *pluginsdk.ResourceData, meta inter d.Set("resource_group_name", id.ResourceGroup) d.Set("workspace_id", workspace.ID()) - if !features.ThreePointOhBeta() { - d.Set("linked_service_name", id.LinkedServiceName) - d.Set("workspace_name", id.WorkspaceName) - } - if props := resp.LinkedServiceProperties; props != nil { d.Set("read_access_id", props.ResourceID) d.Set("write_access_id", props.WriteAccessResourceID) - if !features.ThreePointOhBeta() { - d.Set("resource_id", props.ResourceID) - } } return nil @@ -309,34 +210,29 @@ func LogAnalyticsLinkedServiceType(readAccessId string) string { } func resourceLogAnalyticsLinkedServiceSchema() map[string]*pluginsdk.Schema { - out := map[string]*pluginsdk.Schema{ + return map[string]*pluginsdk.Schema{ "resource_group_name": azure.SchemaResourceGroupNameDiffSuppress(), + "workspace_id": { + Type: pluginsdk.TypeString, + Required: true, + DiffSuppressFunc: suppress.CaseDifference, + ValidateFunc: azure.ValidateResourceID, + }, + "read_access_id": { Type: pluginsdk.TypeString, Computed: true, Optional: true, ValidateFunc: azure.ValidateResourceID, - ExactlyOneOf: func() []string { - out := []string{"read_access_id", "write_access_id"} - if !features.ThreePointOhBeta() { - out = append(out, "resource_id") - } - return out - }(), + ExactlyOneOf: []string{"read_access_id", "write_access_id"}, }, "write_access_id": { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: azure.ValidateResourceID, - ExactlyOneOf: func() []string { - out := []string{"read_access_id", "write_access_id"} - if !features.ThreePointOhBeta() { - out = append(out, "resource_id") - } - return out - }(), + ExactlyOneOf: []string{"read_access_id", "write_access_id"}, }, // Exported properties "name": { @@ -344,68 +240,4 @@ func resourceLogAnalyticsLinkedServiceSchema() map[string]*pluginsdk.Schema { Computed: true, }, } - - if !features.ThreePointOhBeta() { - out["workspace_id"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - Computed: true, - Optional: true, - DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: azure.ValidateResourceID, - ExactlyOneOf: func() []string { - if !features.ThreePointOhBeta() { - return []string{"workspace_id", "workspace_name"} - } - return []string{} - }(), - } - - out["workspace_name"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - Computed: true, - Optional: true, - DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: validate.LogAnalyticsWorkspaceName, - ExactlyOneOf: []string{"workspace_name", "workspace_id"}, - Deprecated: "This field has been deprecated in favour of `workspace_id` and will be removed in a future version of the provider", - } - - out["resource_id"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - Computed: true, - Optional: true, - ValidateFunc: azure.ValidateResourceID, - ExactlyOneOf: []string{"read_access_id", "write_access_id", "resource_id"}, - Deprecated: "This field has been deprecated in favour of `read_access_id` and will be removed in a future version of the provider", - } - - out["linked_service_name"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - Computed: true, - Optional: true, - DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: validation.StringInSlice([]string{ - "automation", - "cluster", - }, false), - Deprecated: "This field has been deprecated and will be removed in a future version of the provider", - } - - out["tags"] = tags.SchemaDeprecatedUnsupported() - } else { - out["workspace_id"] = &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - Required: true, - DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: azure.ValidateResourceID, - ExactlyOneOf: func() []string { - if !features.ThreePointOhBeta() { - return []string{"workspace_id", "workspace_name"} - } - return []string{} - }(), - } - } - - return out } diff --git a/internal/services/loganalytics/log_analytics_linked_service_resource_test.go b/internal/services/loganalytics/log_analytics_linked_service_resource_test.go index d9d96efc7d35..394d95e12c13 100644 --- a/internal/services/loganalytics/log_analytics_linked_service_resource_test.go +++ b/internal/services/loganalytics/log_analytics_linked_service_resource_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -65,25 +64,6 @@ func TestAccLogAnalyticsLinkedService_complete(t *testing.T) { }) } -// CLEANUP: Remove in 3.0 -func TestAccLogAnalyticsLinkedService_legacy(t *testing.T) { - if features.ThreePointOhBeta() { - t.Skip("This test does not apply on 3.0 or later") - } - data := acceptance.BuildTestData(t, "azurerm_log_analytics_linked_service", "test") - r := LogAnalyticsLinkedServiceResource{} - - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.legacy(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - func TestAccLogAnalyticsLinkedService_withWriteAccessResourceId(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_log_analytics_linked_service", "test") r := LogAnalyticsLinkedServiceResource{} @@ -154,20 +134,6 @@ resource "azurerm_log_analytics_linked_service" "test" { `, r.template(data)) } -// CLEANUP: Remove in 3.0 -func (r LogAnalyticsLinkedServiceResource) legacy(data acceptance.TestData) string { - return fmt.Sprintf(` -%s - -resource "azurerm_log_analytics_linked_service" "test" { - resource_group_name = azurerm_resource_group.test.name - workspace_name = azurerm_log_analytics_workspace.test.name - linked_service_name = "automation" - resource_id = azurerm_automation_account.test.id -} -`, r.template(data)) -} - func (LogAnalyticsLinkedServiceResource) template(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/loganalytics/log_analytics_storage_insights_resource.go b/internal/services/loganalytics/log_analytics_storage_insights_resource.go index 787c63ccba26..e5aa747660c2 100644 --- a/internal/services/loganalytics/log_analytics_storage_insights_resource.go +++ b/internal/services/loganalytics/log_analytics_storage_insights_resource.go @@ -11,11 +11,9 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/validate" storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -163,7 +161,7 @@ func expandStorageInsightConfigStorageAccount(id string, key string) *operationa } func resourceLogAnalyticsStorageInsightsSchema() map[string]*pluginsdk.Schema { - schema := map[string]*pluginsdk.Schema{ + return map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, Required: true, @@ -212,10 +210,4 @@ func resourceLogAnalyticsStorageInsightsSchema() map[string]*pluginsdk.Schema { }, }, } - - if !features.ThreePointOhBeta() { - schema["tags"] = tags.SchemaDeprecatedUnsupported() - } - - return schema } diff --git a/internal/services/loganalytics/log_analytics_workspace_resource.go b/internal/services/loganalytics/log_analytics_workspace_resource.go index a45a3a3847d9..658a873d336b 100644 --- a/internal/services/loganalytics/log_analytics_workspace_resource.go +++ b/internal/services/loganalytics/log_analytics_workspace_resource.go @@ -11,13 +11,11 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/migration" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/loganalytics/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -86,8 +84,7 @@ func resourceLogAnalyticsWorkspace() *pluginsdk.Resource { string(operationalinsights.WorkspaceSkuNameEnumStandard), string(operationalinsights.WorkspaceSkuNameEnumCapacityReservation), "Unlimited", // TODO check if this is actually no longer valid, removed in v28.0.0 of the SDK - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: logAnalyticsLinkedServiceSkuChangeCaseDifference, + }, false), }, "reservation_capacity_in_gb_per_day": { @@ -335,14 +332,3 @@ func dailyQuotaGbDiffSuppressFunc(_, _, _ string, d *pluginsdk.ResourceData) boo return false } - -func logAnalyticsLinkedServiceSkuChangeCaseDifference(k, old, new string, d *pluginsdk.ResourceData) bool { - // (@WodansSon) - This is needed because if you connect your workspace to a log analytics linked service resource it - // will modify the value of your sku to "lacluster". We are currently in negotiations with the service team to - // see if there is another way of doing this, for now this is the workaround - if old == "lacluster" { - old = new - } - - return suppress.CaseDifferenceV2Only(k, old, new, d) -} diff --git a/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go b/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go index 4b6f394de1c2..45d879da96c2 100644 --- a/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go +++ b/internal/services/logic/logic_app_integration_account_batch_configuration_resource.go @@ -91,9 +91,8 @@ func resourceLogicAppIntegrationAccountBatchConfiguration() *pluginsdk.Resource Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ "frequency": { - Type: pluginsdk.TypeString, - Required: true, - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + Type: pluginsdk.TypeString, + Required: true, ValidateFunc: validation.StringInSlice([]string{ string(logic.RecurrenceFrequencySecond), string(logic.RecurrenceFrequencyMinute), @@ -161,9 +160,8 @@ func resourceLogicAppIntegrationAccountBatchConfiguration() *pluginsdk.Resource Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ "weekday": { - Type: pluginsdk.TypeString, - Required: true, - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + Type: pluginsdk.TypeString, + Required: true, ValidateFunc: validation.StringInSlice([]string{ string(logic.DayOfWeekMonday), string(logic.DayOfWeekTuesday), @@ -189,9 +187,8 @@ func resourceLogicAppIntegrationAccountBatchConfiguration() *pluginsdk.Resource }, "week_days": { - Type: pluginsdk.TypeSet, - Optional: true, - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + Type: pluginsdk.TypeSet, + Optional: true, Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, ValidateFunc: validation.StringInSlice([]string{ diff --git a/internal/services/logic/logic_app_standard_resource.go b/internal/services/logic/logic_app_standard_resource.go index 5159dbb29313..dbea093deaf2 100644 --- a/internal/services/logic/logic_app_standard_resource.go +++ b/internal/services/logic/logic_app_standard_resource.go @@ -20,7 +20,6 @@ import ( storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -141,7 +140,6 @@ func resourceLogicAppStandard() *pluginsdk.Resource { string(web.ConnectionStringTypeSQLAzure), string(web.ConnectionStringTypeSQLServer), }, false), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, }, "value": { @@ -768,7 +766,6 @@ func schemaLogicAppStandardSiteConfig() *pluginsdk.Schema { "v5.0", "v6.0", }, false), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, }, "vnet_route_all_enabled": { diff --git a/internal/services/logz/logz_monitor_resource.go b/internal/services/logz/logz_monitor_resource.go index ee378c585ed2..896162b3b3ec 100644 --- a/internal/services/logz/logz_monitor_resource.go +++ b/internal/services/logz/logz_monitor_resource.go @@ -12,7 +12,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/services/logz/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -94,8 +93,7 @@ func resourceLogzMonitor() *pluginsdk.Resource { ValidateFunc: validation.StringInSlice([]string{ "MONTHLY", "WEEKLY", - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, "effective_date": { @@ -112,8 +110,7 @@ func resourceLogzMonitor() *pluginsdk.Resource { ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ "100gb14days", - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, "usage_type": { @@ -123,8 +120,7 @@ func resourceLogzMonitor() *pluginsdk.Resource { ValidateFunc: validation.StringInSlice([]string{ "PAYG", "COMMITTED", - }, !features.ThreePointOhBeta()), - DiffSuppressFunc: suppress.CaseDifferenceV2Only, + }, false), }, }, },