Skip to content

Commit

Permalink
Merge pull request #33 from ultradns/patch/add_loggers
Browse files Browse the repository at this point in the history
added loggers on resource read
  • Loading branch information
stevedejong authored Oct 20, 2023
2 parents 6d88ce6 + dc5784f commit 48dfb7c
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .plugin-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.8.0
v1.8.1
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ terraform {
required_providers {
ultradns = {
source = "ultradns/ultradns"
version = ">= 1.3.0"
version = ">= 1.8.0"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.19

require (
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-log v0.4.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.17.0
github.com/ultradns/ultradns-go-sdk v1.5.0-20230427130837-23c9b0c
)
Expand All @@ -30,7 +31,6 @@ require (
github.com/hashicorp/terraform-exec v0.16.1 // indirect
github.com/hashicorp/terraform-json v0.14.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.9.1 // indirect
github.com/hashicorp/terraform-plugin-log v0.4.0 // indirect
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 // indirect
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
Expand Down
2 changes: 2 additions & 0 deletions internal/dirgroupgeo/resource_geogroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dirgroupgeo
import (
"context"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/service"
Expand Down Expand Up @@ -48,6 +49,7 @@ func resourceGeoGroupRead(ctx context.Context, rd *schema.ResourceData, meta int

_, geoGroup, _, err := services.DirGroupGeoService.Read(geoID)
if err != nil {
tflog.Error(ctx, err.Error())
return diag.FromErr(err)
}

Expand Down
2 changes: 2 additions & 0 deletions internal/dirgroupip/resource_ipgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"strings"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/service"
Expand Down Expand Up @@ -50,6 +51,7 @@ func resourceIPGroupRead(ctx context.Context, rd *schema.ResourceData, meta inte
_, ipGroup, _, err := services.DirGroupIPService.Read(ipID)
//_, _, err := services.DirGroupIPService.Read(ipID)
if err != nil {
tflog.Error(ctx, err.Error())
return diag.FromErr(err)
}

Expand Down
3 changes: 2 additions & 1 deletion internal/dirpool/resource_dirpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dirpool
import (
"context"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/rrset"
Expand Down Expand Up @@ -51,7 +52,7 @@ func resourceDIRPoolRead(ctx context.Context, rd *schema.ResourceData, meta inte
_, resList, err := services.RecordService.Read(rrSetKey)
if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion internal/probedns/resource_probe_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package probedns
import (
"context"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/helper"
Expand Down Expand Up @@ -59,7 +60,7 @@ func resourceProbeDNSRead(ctx context.Context, rd *schema.ResourceData, meta int
_, probeData, err := services.ProbeService.Read(rrSetKey)
if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion internal/probehttp/resource_probe_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package probehttp
import (
"context"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/helper"
Expand Down Expand Up @@ -59,7 +60,7 @@ func resourceProbeHTTPRead(ctx context.Context, rd *schema.ResourceData, meta in
_, probeData, err := services.ProbeService.Read(rrSetKey)
if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion internal/probeping/resource_probe_ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package probeping
import (
"context"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/helper"
Expand Down Expand Up @@ -59,7 +60,7 @@ func resourceProbePINGRead(ctx context.Context, rd *schema.ResourceData, meta in
_, probeData, err := services.ProbeService.Read(rrSetKey)
if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion internal/probetcp/resource_probe_tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package probetcp
import (
"context"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/helper"
Expand Down Expand Up @@ -62,7 +63,7 @@ func resourceProbeTCPRead(ctx context.Context, rd *schema.ResourceData, meta int

if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion internal/rdpool/resource_rdpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package rdpool
import (
"context"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/rrset"
Expand Down Expand Up @@ -52,7 +53,7 @@ func resourceRDPoolRead(ctx context.Context, rd *schema.ResourceData, meta inter
_, resList, err := services.RecordService.Read(rrSetKey)
if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion internal/record/resource_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"strings"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/helper"
Expand Down Expand Up @@ -64,7 +65,7 @@ func resourceRecordRead(ctx context.Context, rd *schema.ResourceData, meta inter
_, resList, err := services.RecordService.Read(rrSetKey)
if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion internal/sbpool/resource_sbpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sbpool
import (
"context"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/pool"
Expand Down Expand Up @@ -52,7 +53,7 @@ func resourceSBPoolRead(ctx context.Context, rd *schema.ResourceData, meta inter
_, resList, err := services.RecordService.Read(rrSetKey)
if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion internal/sfpool/resource_sfpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sfpool
import (
"context"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/pool"
Expand Down Expand Up @@ -52,7 +53,7 @@ func resourceSFPoolRead(ctx context.Context, rd *schema.ResourceData, meta inter
_, resList, err := services.RecordService.Read(rrSetKey)
if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion internal/slbpool/resource_slbpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package slbpool
import (
"context"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/pool"
Expand Down Expand Up @@ -52,7 +53,7 @@ func resourceSLBPoolRead(ctx context.Context, rd *schema.ResourceData, meta inte
_, resList, err := services.RecordService.Read(rrSetKey)
if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion internal/tcpool/resource_tcpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tcpool
import (
"context"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/pool"
Expand Down Expand Up @@ -52,7 +53,7 @@ func resourceTCPoolRead(ctx context.Context, rd *schema.ResourceData, meta inter
_, resList, err := services.RecordService.Read(rrSetKey)
if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion internal/zone/resource_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"strings"

"github.com/hashicorp/terraform-plugin-log/tflog"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/ultradns/terraform-provider-ultradns/internal/service"
Expand Down Expand Up @@ -50,7 +51,7 @@ func resourceZoneRead(ctx context.Context, rd *schema.ResourceData, meta interfa
_, zoneResponse, err := services.ZoneService.ReadZone(zoneID)
if err != nil {
rd.SetId("")

tflog.Error(ctx, err.Error())
return nil
}

Expand Down

0 comments on commit 48dfb7c

Please sign in to comment.