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

Remove deprecated fields from AWS and GCP integration resources #430

Merged
merged 2 commits into from
Jun 23, 2023
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
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
## Unreleased

## 7.0.0
IMPROVEMENTS:
* 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
Expand Down
11 changes: 0 additions & 11 deletions signalfx/resource_signalfx_aws_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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),
}
Expand Down
2 changes: 0 additions & 2 deletions signalfx/resource_signalfx_aws_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
27 changes: 3 additions & 24 deletions signalfx/resource_signalfx_gcp_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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))
}
Expand Down Expand Up @@ -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
}
Expand Down