diff --git a/adguard/provider.go b/adguard/provider.go index 4823f74..2a822a6 100644 --- a/adguard/provider.go +++ b/adguard/provider.go @@ -285,6 +285,7 @@ func (p *adguardProvider) DataSources(_ context.Context) []func() datasource.Dat NewClientDataSource, NewListFilterDataSource, NewUserRulesDataSource, + NewRewriteDataSource, } } @@ -294,5 +295,6 @@ func (p *adguardProvider) Resources(_ context.Context) []func() resource.Resourc NewClientResource, NewListFilterResource, NewUserRulesResource, + NewRewriteResource, } } diff --git a/adguard/rewrite_data_source.go b/adguard/rewrite_data_source.go new file mode 100644 index 0000000..12c8321 --- /dev/null +++ b/adguard/rewrite_data_source.go @@ -0,0 +1,106 @@ +package adguard + +import ( + "context" + + "github.com/gmichels/adguard-client-go" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// ensure the implementation satisfies the expected interfaces +var ( + _ datasource.DataSource = &rewriteDataSource{} + _ datasource.DataSourceWithConfigure = &rewriteDataSource{} +) + +// rewriteDataSource is the data source implementation +type rewriteDataSource struct { + adg *adguard.ADG +} + +// rewriteDataModel maps rewrite schema data +type rewriteDataModel struct { + ID types.String `tfsdk:"id"` + Domain types.String `tfsdk:"domain"` + Answer types.String `tfsdk:"answer"` +} + +// NewRewriteDataSource is a helper function to simplify the provider implementation +func NewRewriteDataSource() datasource.DataSource { + return &rewriteDataSource{} +} + +// Metadata returns the data source type name +func (d *rewriteDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_rewrite" +} + +// Schema defines the schema for the data source +func (d *rewriteDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "Identifier attribute", + Computed: true, + }, + "domain": schema.StringAttribute{ + Description: "Domain name", + Required: true, + }, + "answer": schema.StringAttribute{ + Description: "Value of A, AAAA or CNAME DNS record", + Computed: true, + }, + }, + } +} + +// Read refreshes the Terraform state with the latest data +func (d *rewriteDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + // read Terraform configuration data into the model + var state rewriteDataModel + diags := req.Config.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + + // retrieve rewrite info + rewrite, err := d.adg.GetRewrite(state.Domain.ValueString()) + if err != nil { + resp.Diagnostics.AddError( + "Unable to Read AdGuard Home Rewrite Rule", + err.Error(), + ) + return + } + if rewrite == nil { + resp.Diagnostics.AddError( + "Unable to Locate AdGuard Home Rewrite Rule", + "No rewrite rule with name `"+state.Domain.ValueString()+"` exists in AdGuard Home.", + ) + return + } + + // map response body to model + state.Domain = types.StringValue(rewrite.Domain) + state.Answer = types.StringValue(rewrite.Answer) + + // set ID placeholder for testing + state.ID = types.StringValue("placeholder") + + // set state + diags = resp.State.Set(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } +} + +// Configure adds the provider configured rewrite to the data source +func (d *rewriteDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + d.adg = req.ProviderData.(*adguard.ADG) +} diff --git a/adguard/rewrite_data_source_test.go b/adguard/rewrite_data_source_test.go new file mode 100644 index 0000000..53dec95 --- /dev/null +++ b/adguard/rewrite_data_source_test.go @@ -0,0 +1,26 @@ +package adguard + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccRewriteDataSource(t *testing.T) { + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + // Read testing + { + Config: providerConfig + `data "adguard_rewrite" "test" { domain = "example.org" }`, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("data.adguard_rewrite.test", "domain", "example.org"), + resource.TestCheckResourceAttr("data.adguard_rewrite.test", "answer", "1.2.3.4"), + + // Verify placeholder id attribute + resource.TestCheckResourceAttr("data.adguard_rewrite.test", "id", "placeholder"), + ), + }, + }, + }) +} diff --git a/adguard/rewrite_resource.go b/adguard/rewrite_resource.go new file mode 100644 index 0000000..5a6c92e --- /dev/null +++ b/adguard/rewrite_resource.go @@ -0,0 +1,230 @@ +package adguard + +import ( + "context" + "regexp" + "time" + + "github.com/gmichels/adguard-client-go" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// ensure the implementation satisfies the expected interfaces +var ( + _ resource.Resource = &rewriteResource{} + _ resource.ResourceWithConfigure = &rewriteResource{} + _ resource.ResourceWithImportState = &rewriteResource{} +) + +// rewriteResource is the resource implementation +type rewriteResource struct { + adg *adguard.ADG +} + +// rewriteResourceModel maps DNS rewrite rule schema data +type rewriteResourceModel struct { + ID types.String `tfsdk:"id"` + LastUpdated types.String `tfsdk:"last_updated"` + Domain types.String `tfsdk:"domain"` + Answer types.String `tfsdk:"answer"` +} + +// NewRewriteResource is a helper function to simplify the provider implementation +func NewRewriteResource() resource.Resource { + return &rewriteResource{} +} + +// Metadata returns the resource type name +func (r *rewriteResource) Metadata(_ context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_rewrite" +} + +// Schema defines the schema for the resource +func (r *rewriteResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + Description: "Internal identifier for this rewrite", + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "last_updated": schema.StringAttribute{ + Description: "Timestamp of the last Terraform update of the rewrite", + Computed: true, + }, + "domain": schema.StringAttribute{ + Description: "Domain name", + Required: true, + }, + "answer": schema.StringAttribute{ + Description: "Value of A, AAAA or CNAME DNS record", + Required: true, + Validators: []validator.String{ + stringvalidator.RegexMatches( + regexp.MustCompile(`^[a-z0-9/.:-]+$`), + "must be an IP address/CIDR, MAC address, or only contain numbers, lowercase letters, and hyphens", + ), + }, + }, + }, + } +} + +// Configure adds the provider configured DNS rewrite rule to the resource +func (r *rewriteResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + r.adg = req.ProviderData.(*adguard.ADG) +} + +// Create creates the resource and sets the initial Terraform state +func (r *rewriteResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + // retrieve values from plan + var plan rewriteResourceModel + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // instantiate empty DNS rewrite rule for storing plan data + var rewrite adguard.RewriteEntry + + // populate DNS rewrite rule from plan + rewrite.Domain = plan.Domain.ValueString() + rewrite.Answer = plan.Answer.ValueString() + + // create new DNS rewrite rule using plan + newRewrite, err := r.adg.CreateRewrite(rewrite) + if err != nil { + resp.Diagnostics.AddError( + "Error Creating DNS Rewrite Rule", + "Could not create DNS rewrite rule, unexpected error: "+err.Error(), + ) + return + } + + // response sent by AdGuard Home is the same as the sent payload, + // just add missing attributes for state + plan.ID = types.StringValue(newRewrite.Domain) + // add the last updated attribute + plan.LastUpdated = types.StringValue(time.Now().Format(time.RFC850)) + + // set state to fully populated data + diags = resp.State.Set(ctx, plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } +} + +// Read refreshes the Terraform state with the latest data +func (r *rewriteResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + // get current state + var state rewriteResourceModel + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // get refreshed DNS rewrite rule value from AdGuard Home + rewrite, err := r.adg.GetRewrite(state.ID.ValueString()) + if err != nil { + resp.Diagnostics.AddError( + "Error Reading AdGuard Home DNS Rewrite Rule", + "Could not read AdGuard Home DNS rewrite rule with ID "+state.ID.ValueString()+": "+err.Error(), + ) + return + } else if rewrite == nil { + resp.Diagnostics.AddError( + "Error Reading AdGuard Home DNS Rewrite Rule", + "No such AdGuard Home DNS rewrite rule with ID "+state.ID.ValueString(), + ) + return + } + + // overwrite DNS rewrite rule with refreshed state + state.Domain = types.StringValue(rewrite.Domain) + state.Answer = types.StringValue(rewrite.Answer) + + // set refreshed state + diags = resp.State.Set(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } +} + +// Update updates the resource and sets the updated Terraform state on success +func (r *rewriteResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + // retrieve values from plan + var plan rewriteResourceModel + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // generate API request body from plan + var updateRewrite adguard.RewriteEntry + updateRewrite.Domain = plan.Domain.ValueString() + updateRewrite.Answer = plan.Answer.ValueString() + + // update existing DNS rewrite rule + _, err := r.adg.UpdateRewrite(updateRewrite) + if err != nil { + resp.Diagnostics.AddError( + "Error Updating AdGuard Home DNS Rewrite Rule", + "Could not update DNS rewrite rule, unexpected error: "+err.Error(), + ) + return + } + + // update resource state with updated items and timestamp + plan.LastUpdated = types.StringValue(time.Now().Format(time.RFC850)) + + // update state + diags = resp.State.Set(ctx, plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } +} + +// Delete deletes the resource and removes the Terraform state on success +func (r *rewriteResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + // retrieve values from state + var state rewriteResourceModel + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // delete existing DNS rewrite rule + err := r.adg.DeleteRewrite(state.ID.ValueString()) + if err != nil { + resp.Diagnostics.AddError( + "Error Deleting AdGuard Home DNS Rewrite Rule", + "Could not delete DNS rewrite rule, unexpected error: "+err.Error(), + ) + return + } +} + +func (r *rewriteResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + // retrieve import ID and save to id attribute + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} diff --git a/adguard/rewrite_resource_test.go b/adguard/rewrite_resource_test.go new file mode 100644 index 0000000..1bb3b59 --- /dev/null +++ b/adguard/rewrite_resource_test.go @@ -0,0 +1,54 @@ +package adguard + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccRewriteResource(t *testing.T) { + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + // Create and Read testing + { + Config: providerConfig + ` +resource "adguard_rewrite" "test" { + domain = "example.com" + answer = "4.3.2.1" +} +`, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("adguard_rewrite.test", "domain", "example.com"), + resource.TestCheckResourceAttr("adguard_rewrite.test", "answer", "4.3.2.1"), + // Verify dynamic values have any value set in the state. + resource.TestCheckResourceAttrSet("adguard_rewrite.test", "id"), + resource.TestCheckResourceAttrSet("adguard_rewrite.test", "last_updated"), + ), + }, + // ImportState testing + { + ResourceName: "adguard_rewrite.test", + ImportState: true, + ImportStateVerify: true, + // The last_updated attribute does not exist in AdGuard Home, + // therefore there is no value for it during import + ImportStateVerifyIgnore: []string{"last_updated"}, + }, + // Update and Read testing + { + Config: providerConfig + ` +resource "adguard_rewrite" "test" { + domain = "example.com" + answer = "2400:cb00:2049:1::a29f:1804" +} +`, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("adguard_rewrite.test", "domain", "example.com"), + resource.TestCheckResourceAttr("adguard_rewrite.test", "answer", "2400:cb00:2049:1::a29f:1804"), + ), + }, + // Delete testing automatically occurs in TestCase + }, + }) +} diff --git a/adguard/user_rules_data_source_test.go b/adguard/user_rules_data_source_test.go index da32979..7800ca5 100644 --- a/adguard/user_rules_data_source_test.go +++ b/adguard/user_rules_data_source_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccUserRulesrDataSource(t *testing.T) { +func TestAccUserRulesDataSource(t *testing.T) { resource.Test(t, resource.TestCase{ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ diff --git a/docker/conf/AdGuardHome.yaml b/docker/conf/AdGuardHome.yaml index d109ff0..47b2221 100644 --- a/docker/conf/AdGuardHome.yaml +++ b/docker/conf/AdGuardHome.yaml @@ -66,7 +66,9 @@ dns: safesearch_cache_size: 1048576 parental_cache_size: 1048576 cache_time: 30 - rewrites: [] + rewrites: + - domain: example.org + answer: 1.2.3.4 blocked_services: [] upstream_timeout: 10s private_networks: [] diff --git a/docs/data-sources/rewrite.md b/docs/data-sources/rewrite.md new file mode 100644 index 0000000..82f618b --- /dev/null +++ b/docs/data-sources/rewrite.md @@ -0,0 +1,34 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "adguard_rewrite Data Source - adguard" +subcategory: "" +description: |- + +--- + +# adguard_rewrite (Data Source) + + + +## Example Usage + +```terraform +# get a DNS rewrite rule +data "adguard_rewrite" "test" { + domain = "example.org" +} +``` + + +## Schema + +### Required + +- `domain` (String) Domain name + +### Read-Only + +- `answer` (String) Value of A, AAAA or CNAME DNS record +- `id` (String) Identifier attribute + + diff --git a/docs/resources/rewrite.md b/docs/resources/rewrite.md new file mode 100644 index 0000000..2163e82 --- /dev/null +++ b/docs/resources/rewrite.md @@ -0,0 +1,43 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "adguard_rewrite Resource - adguard" +subcategory: "" +description: |- + +--- + +# adguard_rewrite (Resource) + + + +## Example Usage + +```terraform +# manage a DNS rewrite rule +resource "adguard_rewrite" "test" { + domain = "example.com" + answer = "4.3.2.1" +} +``` + + +## Schema + +### Required + +- `answer` (String) Value of A, AAAA or CNAME DNS record +- `domain` (String) Domain name + +### Read-Only + +- `id` (String) Internal identifier for this rewrite +- `last_updated` (String) Timestamp of the last Terraform update of the rewrite + +## Import + +Import is supported using the following syntax: + +```shell +# DNS rewrite rule can be imported by specifying the domain name +terraform import adguard_rewrite.test "example.org" +``` diff --git a/examples/data-sources/adguard_rewrite/data-source.tf b/examples/data-sources/adguard_rewrite/data-source.tf new file mode 100644 index 0000000..66e5b4c --- /dev/null +++ b/examples/data-sources/adguard_rewrite/data-source.tf @@ -0,0 +1,4 @@ +# get a DNS rewrite rule +data "adguard_rewrite" "test" { + domain = "example.org" +} diff --git a/examples/resources/adguard_rewrite/import.sh b/examples/resources/adguard_rewrite/import.sh new file mode 100644 index 0000000..b51a3c5 --- /dev/null +++ b/examples/resources/adguard_rewrite/import.sh @@ -0,0 +1,2 @@ +# DNS rewrite rule can be imported by specifying the domain name +terraform import adguard_rewrite.test "example.org" diff --git a/examples/resources/adguard_rewrite/resource.tf b/examples/resources/adguard_rewrite/resource.tf new file mode 100644 index 0000000..e4f574d --- /dev/null +++ b/examples/resources/adguard_rewrite/resource.tf @@ -0,0 +1,5 @@ +# manage a DNS rewrite rule +resource "adguard_rewrite" "test" { + domain = "example.com" + answer = "4.3.2.1" +} diff --git a/go.mod b/go.mod index cf1b1d2..ddd6ace 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ go 1.20 // replace github.com/gmichels/adguard-client-go => /path/to/adguard-client-go require ( - github.com/gmichels/adguard-client-go v0.2.1 + github.com/gmichels/adguard-client-go v0.3.0 github.com/hashicorp/terraform-plugin-docs v0.14.1 github.com/hashicorp/terraform-plugin-framework v1.2.0 github.com/hashicorp/terraform-plugin-framework-validators v0.10.0 - github.com/hashicorp/terraform-plugin-go v0.14.3 + github.com/hashicorp/terraform-plugin-go v0.15.0 github.com/hashicorp/terraform-plugin-log v0.8.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 ) @@ -45,7 +45,7 @@ require ( github.com/hashicorp/terraform-svchost v0.1.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/huandu/xstrings v1.4.0 // indirect - github.com/imdario/mergo v0.3.14 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.18 // indirect github.com/mitchellh/cli v1.1.5 // indirect @@ -60,8 +60,8 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect - github.com/vmihailenco/tagparser v0.1.2 // indirect + github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/zclconf/go-cty v1.13.1 // indirect golang.org/x/crypto v0.7.0 // indirect golang.org/x/mod v0.9.0 // indirect @@ -69,7 +69,7 @@ require ( golang.org/x/sys v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230323203342-db269f900576 // indirect + google.golang.org/genproto v0.0.0-20230327152035-dc694ad2151e // indirect google.golang.org/grpc v1.54.0 // indirect google.golang.org/protobuf v1.30.0 // indirect ) diff --git a/go.sum b/go.sum index e33b901..e2280a7 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBD github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/gmichels/adguard-client-go v0.2.1 h1:N+SArVllJixvN1jA2zSp+vsrtmZVmAQymY5q0dzhsMU= -github.com/gmichels/adguard-client-go v0.2.1/go.mod h1:77E8dDI1mhRP5E7tNJWvtF2PLqZiqwcmMrgBUCCc4KY= +github.com/gmichels/adguard-client-go v0.3.0 h1:u5JI4Zml7wxWXqbeWyPqwFgSNtOKMz7oT3Av2/u3GfI= +github.com/gmichels/adguard-client-go v0.3.0/go.mod h1:77E8dDI1mhRP5E7tNJWvtF2PLqZiqwcmMrgBUCCc4KY= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= @@ -51,7 +51,6 @@ github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -102,8 +101,8 @@ github.com/hashicorp/terraform-plugin-framework v1.2.0 h1:MZjFFfULnFq8fh04FqrKPc github.com/hashicorp/terraform-plugin-framework v1.2.0/go.mod h1:nToI62JylqXDq84weLJ/U3umUsBhZAaTmU0HXIVUOcw= github.com/hashicorp/terraform-plugin-framework-validators v0.10.0 h1:4L0tmy/8esP6OcvocVymw52lY0HyQ5OxB7VNl7k4bS0= github.com/hashicorp/terraform-plugin-framework-validators v0.10.0/go.mod h1:qdQJCdimB9JeX2YwOpItEu+IrfoJjWQ5PhLpAOMDQAE= -github.com/hashicorp/terraform-plugin-go v0.14.3 h1:nlnJ1GXKdMwsC8g1Nh05tK2wsC3+3BL/DBBxFEki+j0= -github.com/hashicorp/terraform-plugin-go v0.14.3/go.mod h1:7ees7DMZ263q8wQ6E4RdIdR6nHHJtrdt4ogX5lPkX1A= +github.com/hashicorp/terraform-plugin-go v0.15.0 h1:1BJNSUFs09DS8h/XNyJNJaeusQuWc/T9V99ylU9Zwp0= +github.com/hashicorp/terraform-plugin-go v0.15.0/go.mod h1:tk9E3/Zx4RlF/9FdGAhwxHExqIHHldqiQGt20G6g+nQ= github.com/hashicorp/terraform-plugin-log v0.8.0 h1:pX2VQ/TGKu+UU1rCay0OlzosNKe4Nz1pepLXj95oyy0= github.com/hashicorp/terraform-plugin-log v0.8.0/go.mod h1:1myFrhVsBLeylQzYYEV17VVjtG8oYPRFdaZs7xdW2xs= github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 h1:G9WAfb8LHeCxu7Ae8nc1agZlQOSCUWsb610iAogBhCs= @@ -121,8 +120,8 @@ github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.14 h1:fOqeC1+nCuuk6PKQdg9YmosXX7Y7mHX6R/0ZldI9iHo= -github.com/imdario/mergo v0.3.14/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= @@ -200,11 +199,10 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= -github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= -github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -228,7 +226,6 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -280,11 +277,10 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20230323203342-db269f900576 h1:x2O+AvoTs+OtJ+GW9l7lRFyDlvJCHzEpJIkn3Ec4V9g= -google.golang.org/genproto v0.0.0-20230323203342-db269f900576/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= +google.golang.org/genproto v0.0.0-20230327152035-dc694ad2151e h1:rRGPYd0STm9H4Ci+iGrSLG35mkAKY41/nzCcG7PQADw= +google.golang.org/genproto v0.0.0-20230327152035-dc694ad2151e/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak= google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=