From 6ffac835ee6292d90c7ee8a38ac4dba05132b915 Mon Sep 17 00:00:00 2001 From: Aleksandra Konarska Date: Wed, 10 May 2023 13:31:04 +0200 Subject: [PATCH 1/2] Remove deprecated fields --- CHANGELOG.md | 4 +++ signalfx/resource_signalfx_aws_integration.go | 11 -------- .../resource_signalfx_aws_integration_test.go | 2 -- signalfx/resource_signalfx_gcp_integration.go | 27 +++---------------- 4 files changed, 7 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e8e5e58..eca36afc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Unreleased +## 7.0.0 +IMPROVEMENTS: +* Remove deprecated fields: `use_get_metric_data_method` in AWS integration resource and `whitelist` in GCP integration resource. + ## 6.24.0 BUGFIXES: * Fixes backwards incompatibility for GCP integration resource introduced in `6.21.0` diff --git a/signalfx/resource_signalfx_aws_integration.go b/signalfx/resource_signalfx_aws_integration.go index 8193a530..156cd533 100644 --- a/signalfx/resource_signalfx_aws_integration.go +++ b/signalfx/resource_signalfx_aws_integration.go @@ -184,13 +184,6 @@ func integrationAWSResource() *schema.Resource { ConflictsWith: []string{"token", "key"}, Description: "Used with `signalfx_aws_external_integration`. Use this property to specify the external id.", }, - "use_get_metric_data_method": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - Deprecated: "This field will be removed", - Description: "Enables the use of Amazon's GetMetricData API. Defaults to `false`.", - }, "use_metric_streams_sync": &schema.Schema{ Type: schema.TypeBool, Optional: true, @@ -319,9 +312,6 @@ func awsIntegrationAPIToTF(d *schema.ResourceData, aws *integration.AwsCloudWatc if err := d.Set("poll_rate", aws.PollRate/1000); err != nil { return err } - if err := d.Set("use_get_metric_data_method", aws.UseGetMetricDataMethod); err != nil { - return err - } if err := d.Set("use_metric_streams_sync", aws.MetricStreamsSyncState == "ENABLED"); err != nil { return err } @@ -450,7 +440,6 @@ func getPayloadAWSIntegration(d *schema.ResourceData) (*integration.AwsCloudWatc Enabled: d.Get("enabled").(bool), EnableAwsUsage: d.Get("enable_aws_usage").(bool), ImportCloudWatch: d.Get("import_cloud_watch").(bool), - UseGetMetricDataMethod: d.Get("use_get_metric_data_method").(bool), EnableCheckLargeVolume: d.Get("enable_check_large_volume").(bool), SyncCustomNamespacesOnly: d.Get("sync_custom_namespaces_only").(bool), } diff --git a/signalfx/resource_signalfx_aws_integration_test.go b/signalfx/resource_signalfx_aws_integration_test.go index bedb0c84..b54dd356 100644 --- a/signalfx/resource_signalfx_aws_integration_test.go +++ b/signalfx/resource_signalfx_aws_integration_test.go @@ -73,7 +73,6 @@ const newIntegrationAWSConfig = ` poll_rate = 300 import_cloud_watch = true enable_aws_usage = true - use_get_metric_data_method = true custom_namespace_sync_rule { default_action = "Exclude" @@ -156,7 +155,6 @@ const updatedIntegrationAWSConfig = ` poll_rate = 300 import_cloud_watch = true enable_aws_usage = true - use_get_metric_data_method = true custom_namespace_sync_rule { default_action = "Exclude" diff --git a/signalfx/resource_signalfx_gcp_integration.go b/signalfx/resource_signalfx_gcp_integration.go index 76ea8777..b60af3c8 100644 --- a/signalfx/resource_signalfx_gcp_integration.go +++ b/signalfx/resource_signalfx_gcp_integration.go @@ -75,22 +75,9 @@ func integrationGCPResource() *schema.Resource { Description: "When this value is set to true Observability Cloud will force usage of a quota from the project where metrics are stored. For this to work the service account provided for the project needs to be provided with serviceusage.services.use permission or Service Usage Consumer role in this project. When set to false default quota settings are used.", }, "include_list": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Description: "List of custom metadata keys that you want Observability Cloud to collect for Compute Engine instances.", - ConflictsWith: []string{"whitelist"}, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "whitelist": &schema.Schema{ - Type: schema.TypeSet, - Optional: true, - Computed: true, - Description: "Compute Metadata Whitelist", - Deprecated: "Please use include_list instead", - ConflictsWith: []string{"include_list"}, + Type: schema.TypeSet, + Optional: true, + Description: "List of custom metadata keys that you want Observability Cloud to collect for Compute Engine instances.", Elem: &schema.Schema{ Type: schema.TypeString, }, @@ -190,10 +177,6 @@ func getGCPPayloadIntegration(d *schema.ResourceData) *integration.GCPIntegratio gcp.IncludeList = expandStringSetToSlice(val.(*schema.Set)) } - if val, ok := d.GetOk("whitelist"); ok { - gcp.Whitelist = expandStringSetToSlice(val.(*schema.Set)) - } - if val, ok := d.GetOk("custom_metric_type_domains"); ok { gcp.CustomMetricTypeDomains = expandStringSetToSlice(val.(*schema.Set)) } @@ -241,10 +224,6 @@ func gcpIntegrationAPIToTF(d *schema.ResourceData, gcp *integration.GCPIntegrati return err } - if err := d.Set("whitelist", flattenStringSliceToSet(gcp.Whitelist)); err != nil { - return err - } - if err := d.Set("custom_metric_type_domains", flattenStringSliceToSet(gcp.CustomMetricTypeDomains)); err != nil { return err } From bc07c3343407dc488b5d6f7924229e9dbdcfb041 Mon Sep 17 00:00:00 2001 From: Aleksandra Konarska Date: Fri, 23 Jun 2023 14:10:23 +0200 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eca36afc..98dcae91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,14 @@ ## 7.0.0 IMPROVEMENTS: -* Remove deprecated fields: `use_get_metric_data_method` in AWS integration resource and `whitelist` in GCP integration resource. +* Remove deprecated fields: `use_get_metric_data_method` in AWS integration resource and `whitelist` in GCP integration resource. [#430](https://github.com/splunk-terraform/terraform-provider-signalfx/pull/430) ## 6.24.0 BUGFIXES: -* Fixes backwards incompatibility for GCP integration resource introduced in `6.21.0` +* Fixes backwards incompatibility for GCP integration resource introduced in `6.21.0` [#429](https://github.com/splunk-terraform/terraform-provider-signalfx/pull/429) IMPROVEMENTS: -* Deprecate `use_get_metric_data_method` in AWS integration resource +* Deprecate `use_get_metric_data_method` in AWS integration resource [#428](https://github.com/splunk-terraform/terraform-provider-signalfx/pull/428) ## 6.23.0 WARNING: This version is NOT backward compatible for GCP integration resource. This is fixed in 6.24.0