Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FourPointOh - remove from services A-I with low find counts #28021

Merged
merged 7 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ 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/analysisservices/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
Expand Down Expand Up @@ -86,13 +85,6 @@ func resourceAnalysisServicesServer() *pluginsdk.Resource {
"power_bi_service_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
Computed: !features.FourPointOhBeta(),
ConflictsWith: func() []string {
if !features.FourPointOhBeta() {
return []string{"enable_power_bi_service"}
}
return []string{}
}(),
},

"ipv4_firewall_rule": {
Expand Down Expand Up @@ -144,24 +136,7 @@ func resourceAnalysisServicesServer() *pluginsdk.Resource {
"tags": commonschema.Tags(),
},
}
if !features.FourPointOhBeta() {
resource.Schema["querypool_connection_mode"] = &pluginsdk.Schema{
Type: pluginsdk.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{
string(servers.ConnectionModeAll),
string(servers.ConnectionModeReadOnly),
}, false),
}
resource.Schema["enable_power_bi_service"] = &pluginsdk.Schema{
Type: pluginsdk.TypeBool,
Optional: true,
Computed: true,
Deprecated: "The property `enable_power_bi_service` has been superseded by `power_bi_service_enabled` and will be removed in v4.0 of the AzureRM Provider.",
ConflictsWith: []string{"power_bi_service_enabled"},
}
}

return resource
}

Expand Down Expand Up @@ -198,14 +173,6 @@ func resourceAnalysisServicesServerCreate(d *pluginsdk.ResourceData, meta interf
Tags: tags.Expand(d.Get("tags").(map[string]interface{})),
}

if v, ok := d.GetOk("enable_power_bi_service"); ok && !features.FourPointOhBeta() {
if analysisServicesServer.Properties.IPV4FirewallSettings == nil {
analysisServicesServer.Properties.IPV4FirewallSettings = &servers.IPv4FirewallSettings{
FirewallRules: pointer.To(make([]servers.IPv4FirewallRule, 0)),
}
}
analysisServicesServer.Properties.IPV4FirewallSettings.EnablePowerBIService = pointer.To(v.(bool))
}
if v, ok := d.GetOk("power_bi_service_enabled"); ok {
if analysisServicesServer.Properties.IPV4FirewallSettings == nil {
analysisServicesServer.Properties.IPV4FirewallSettings = &servers.IPv4FirewallSettings{
Expand Down Expand Up @@ -266,9 +233,6 @@ func resourceAnalysisServicesServerRead(d *pluginsdk.ResourceData, meta interfac
d.Set("admin_users", adminUsers)

enablePowerBi, fwRules := flattenAnalysisServicesServerFirewallSettings(props)
if !features.FourPointOhBeta() {
d.Set("enable_power_bi_service", enablePowerBi)
}
d.Set("power_bi_service_enabled", enablePowerBi)
if err := d.Set("ipv4_firewall_rule", fwRules); err != nil {
return fmt.Errorf("setting `ipv4_firewall_rule`: %s", err)
Expand Down Expand Up @@ -352,17 +316,6 @@ func resourceAnalysisServicesServerUpdate(d *pluginsdk.ResourceData, meta interf
analysisServicesServer.Properties.IPV4FirewallSettings.EnablePowerBIService = pointer.To(d.Get("power_bi_service_enabled").(bool))
}

if !features.FourPointOhBeta() {
if d.HasChange("enable_power_bi_service") {
if analysisServicesServer.Properties.IPV4FirewallSettings == nil {
analysisServicesServer.Properties.IPV4FirewallSettings = &servers.IPv4FirewallSettings{
FirewallRules: pointer.To(make([]servers.IPv4FirewallRule, 0)),
}
}
analysisServicesServer.Properties.IPV4FirewallSettings.EnablePowerBIService = pointer.To(d.Get("enable_power_bi_service").(bool))
}
}

if containerUri, ok := d.GetOk("backup_blob_container_uri"); ok {
analysisServicesServer.Properties.BackupBlobContainerUri = pointer.To(containerUri.(string))
}
Expand Down
16 changes: 3 additions & 13 deletions internal/services/appservice/validate/app_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ package validate
import (
"fmt"
"strings"

"github.com/hashicorp/terraform-provider-azurerm/internal/features"
)

var UnmanagedSettings = []string{
Expand Down Expand Up @@ -40,17 +38,9 @@ var UnmanagedSettingsDeprecated = []string{
func AppSettings(input interface{}, key string) (warnings []string, errors []error) {
if appSettings, ok := input.(map[string]interface{}); ok {
for k := range appSettings {
if !features.FourPointOhBeta() {
for _, f := range UnmanagedSettingsDeprecated {
if strings.EqualFold(k, f) {
errors = append(errors, fmt.Errorf("cannot set a value for %s in %s", k, key))
}
}
} else {
for _, f := range UnmanagedSettings {
if strings.EqualFold(k, f) {
errors = append(errors, fmt.Errorf("cannot set a value for %s in %s", k, key))
}
for _, f := range UnmanagedSettings {
if strings.EqualFold(k, f) {
errors = append(errors, fmt.Errorf("cannot set a value for %s in %s", k, key))
}
}
}
Expand Down
28 changes: 0 additions & 28 deletions internal/services/attestation/attestation_provider_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"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/attestation/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
Expand Down Expand Up @@ -126,27 +125,6 @@ func resourceAttestationProvider() *pluginsdk.Resource {
},
}

if !features.FourPointOhBeta() {
s["policy"] = &pluginsdk.Schema{
Type: pluginsdk.TypeList,
Optional: true,
Deprecated: "This field is no longer used and will be removed in v4.0 of the Azure Provider - use `open_enclave_policy_base64`, `sgx_enclave_policy_base64`, `tpm_policy_base64` and `sev_snp_policy_base64` instead.",
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"environment_type": {
Type: pluginsdk.TypeString,
Optional: true,
},

"data": {
Type: pluginsdk.TypeString,
Optional: true,
},
},
},
}
}

return s
}(),
}
Expand Down Expand Up @@ -315,12 +293,6 @@ func resourceAttestationProviderRead(d *pluginsdk.ResourceData, meta interface{}
}
d.Set("sev_snp_policy_base64", pointer.From(sevSnpPolicyData))

if !features.FourPointOhBeta() {
if err := d.Set("policy", []interface{}{}); err != nil {
return fmt.Errorf("setting `policy`: %+v", err)
}
}

return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2023-11-01/certificate"
"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/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
Expand Down Expand Up @@ -81,13 +80,6 @@ func resourceAutomationCertificate() *pluginsdk.Resource {
},
}

if !features.FourPointOhBeta() {
resource.Schema["exportable"] = &pluginsdk.Schema{
Type: pluginsdk.TypeBool,
Computed: true,
Optional: true,
}
}
return resource
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2023-11-01/schedule"
"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/automation/migration"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down Expand Up @@ -95,7 +94,7 @@ func resourceAutomationJobSchedule() *pluginsdk.Resource {
Optional: true,
// NOTE: O+C this can remain as this can change if the runbook is updated but cannot be updated by the user
Computed: true,
ForceNew: features.FourPointOhBeta(),
ForceNew: true,
ValidateFunc: validation.IsUUID,
},

Expand Down
19 changes: 0 additions & 19 deletions internal/services/batch/batch_account_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,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/batch/validate"
keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down Expand Up @@ -186,24 +185,6 @@ func resourceBatchAccount() *pluginsdk.Resource {
},
}

if !features.FourPointOhBeta() {
resource.Schema["encryption"] = &pluginsdk.Schema{
Type: pluginsdk.TypeList,
Optional: true,
MaxItems: 1,
ConfigMode: pluginsdk.SchemaConfigModeAttr,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"key_vault_key_id": {
Type: pluginsdk.TypeString,
Required: true,
ValidateFunc: keyVaultValidate.NestedItemIdWithOptionalVersion,
},
},
},
}
}

return resource
}

Expand Down
40 changes: 0 additions & 40 deletions internal/services/batch/batch_pool_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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/batch/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress"
Expand Down Expand Up @@ -829,45 +828,6 @@ func resourceBatchPool() *pluginsdk.Resource {
},
}

if !features.FourPointOhBeta() {
resource.Schema["container_configuration"] = &pluginsdk.Schema{
Type: pluginsdk.TypeList,
Optional: true,
MinItems: 1,
MaxItems: 1,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"type": {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringIsNotEmpty,
AtLeastOneOf: []string{"container_configuration.0.type", "container_configuration.0.container_image_names", "container_configuration.0.container_registries"},
},
"container_image_names": {
Type: pluginsdk.TypeSet,
Optional: true,
ForceNew: true,
Elem: &pluginsdk.Schema{
Type: pluginsdk.TypeString,
ValidateFunc: validation.StringIsNotEmpty,
},
AtLeastOneOf: []string{"container_configuration.0.type", "container_configuration.0.container_image_names", "container_configuration.0.container_registries"},
},
"container_registries": {
Type: pluginsdk.TypeList,
Optional: true,
ForceNew: true,
ConfigMode: pluginsdk.SchemaConfigModeAttr,
Elem: &pluginsdk.Resource{
Schema: containerRegistry(),
},
AtLeastOneOf: []string{"container_configuration.0.type", "container_configuration.0.container_image_names", "container_configuration.0.container_registries"},
},
},
},
}
}

return resource
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"

"github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2021-06-01/cdn" // nolint: staticcheck
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/parse"
"github.com/hashicorp/terraform-provider-azurerm/utils"
)
Expand Down Expand Up @@ -231,13 +231,6 @@ func ExpandCdnFrontDoorRouteConfigurationOverrideAction(input []interface{}) (*[
compressionEnabled = cdn.RuleIsCompressionEnabledDisabled
}

if !features.FourPointOhBeta() {
// set the default value for forwarding protocol to avoid a breaking change...
if protocol == "" {
protocol = string(cdn.ForwardingProtocolMatchRequest)
}
}

// NOTE: It is valid to not define the originGroupOverride in the Route Configuration Override Action
// however, if you do not define the Origin Group ID you also cannot define the Forwarding Protocol either
if originGroupIdRaw != "" {
Expand All @@ -247,7 +240,7 @@ func ExpandCdnFrontDoorRouteConfigurationOverrideAction(input []interface{}) (*[

originGroupOverride = cdn.OriginGroupOverride{
OriginGroup: &cdn.ResourceReference{
ID: utils.String(originGroupIdRaw),
ID: pointer.To(originGroupIdRaw),
},
ForwardingProtocol: cdn.ForwardingProtocol(protocol),
}
Expand All @@ -268,44 +261,21 @@ func ExpandCdnFrontDoorRouteConfigurationOverrideAction(input []interface{}) (*[
return nil, fmt.Errorf("the 'route_configuration_override_action' block is not valid, if the 'cache_behavior' is set to 'Disabled' you cannot define the 'cache_duration', got %q", cacheDuration)
}
} else {
if !features.FourPointOhBeta() {
// since 'cache_duration', 'query_string_caching_behavior' and 'cache_behavior' are optional create a default values
// for those values if not set.
if cacheBehavior == "" {
cacheBehavior = string(cdn.RuleCacheBehaviorHonorOrigin)
}

if queryStringCachingBehavior == "" {
queryStringCachingBehavior = string(cdn.RuleQueryStringCachingBehaviorIgnoreQueryString)
}

// NOTE: if the cacheBehavior is 'HonorOrigin' the cacheDuration must be null, issue #19311
if cacheBehavior != string(cdn.RuleCacheBehaviorHonorOrigin) {
if cacheDuration == "" {
cacheDuration = "1.12:00:00"
}
} else if cacheDuration != "" {
return nil, fmt.Errorf("the 'route_configuration_override_action' block is not valid, if the 'cache_behavior' field is set to 'HonorOrigin' the 'cache_duration' must not be set")
}
if cacheBehavior == "" {
return nil, fmt.Errorf("the 'route_configuration_override_action' block is not valid, the 'cache_behavior' field must be set")
}

if features.FourPointOhBeta() {
if cacheBehavior == "" {
return nil, fmt.Errorf("the 'route_configuration_override_action' block is not valid, the 'cache_behavior' field must be set")
}

if queryStringCachingBehavior == "" {
return nil, fmt.Errorf("the 'route_configuration_override_action' block is not valid, the 'query_string_caching_behavior' field must be set")
}
if queryStringCachingBehavior == "" {
return nil, fmt.Errorf("the 'route_configuration_override_action' block is not valid, the 'query_string_caching_behavior' field must be set")
}

// NOTE: if the cacheBehavior is 'HonorOrigin' cacheDuration must be null, issue #19311
if cacheBehavior != string(cdn.RuleCacheBehaviorHonorOrigin) {
if cacheDuration == "" {
return nil, fmt.Errorf("the 'route_configuration_override_action' block is not valid, the 'cache_duration' field must be set")
}
} else if cacheDuration != "" {
return nil, fmt.Errorf("the 'route_configuration_override_action' block is not valid, the 'cache_duration' field must not be set if the 'cache_behavior' is 'HonorOrigin'")
// NOTE: if the cacheBehavior is 'HonorOrigin' cacheDuration must be null, issue #19311
if cacheBehavior != string(cdn.RuleCacheBehaviorHonorOrigin) {
if cacheDuration == "" {
return nil, fmt.Errorf("the 'route_configuration_override_action' block is not valid, the 'cache_duration' field must be set")
}
} else if cacheDuration != "" {
return nil, fmt.Errorf("the 'route_configuration_override_action' block is not valid, the 'cache_duration' field must not be set if the 'cache_behavior' is 'HonorOrigin'")
}

cacheConfiguration = cdn.CacheConfiguration{
Expand Down
Loading
Loading