Skip to content

Commit

Permalink
fix(synthetics): Fix to detect differences in locations_public of syn…
Browse files Browse the repository at this point in the history
…thetics script monitor
  • Loading branch information
vinay-newrelic committed Nov 19, 2024
1 parent 0e4098d commit b2a809c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions newrelic/resource_helpers_synthetics.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ var syntheticsMonitorTagKeyToSchemaAttrMap = map[string]string{
"scriptLanguage": "script_language",
"deviceOrientation": "device_orientation",
"deviceType": "device_type",
"publicLocation": "locations_public",
}

func getCertCheckMonitorValuesFromEntityTags(tags []entities.EntityTag) (domain string, daysUntilExpiration int) {
Expand Down
6 changes: 5 additions & 1 deletion newrelic/resource_newrelic_synthetics_script_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package newrelic

import (
"context"
"log"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/newrelic/newrelic-client-go/v2/pkg/common"
"github.com/newrelic/newrelic-client-go/v2/pkg/entities"
"github.com/newrelic/newrelic-client-go/v2/pkg/synthetics"
"log"
)

func resourceNewRelicSyntheticsScriptMonitor() *schema.Resource {
Expand Down Expand Up @@ -223,6 +224,9 @@ func resourceNewRelicSyntheticsScriptMonitorRead(ctx context.Context, d *schema.

switch e := (*resp).(type) {
case *entities.SyntheticMonitorEntity:
entity := (*resp).(*entities.SyntheticMonitorEntity)
_ = d.Set("locations_public", getPublicLocationsFromEntityTags(entity.GetTags()))

err = setSyntheticsMonitorAttributes(d, map[string]string{
"name": e.Name,
"type": string(e.MonitorType),
Expand Down

0 comments on commit b2a809c

Please sign in to comment.