From 245d50b996207b1bdb91da1e9aa707ed09541641 Mon Sep 17 00:00:00 2001 From: Andrew Tulloch Date: Thu, 23 Jan 2025 21:31:24 +0000 Subject: [PATCH] Get tags tests passing --- .../service_network_resource_association.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/service/vpclattice/service_network_resource_association.go b/internal/service/vpclattice/service_network_resource_association.go index 13c06734562..a33c247a488 100644 --- a/internal/service/vpclattice/service_network_resource_association.go +++ b/internal/service/vpclattice/service_network_resource_association.go @@ -15,6 +15,7 @@ import ( "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/listplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/types" @@ -62,7 +63,10 @@ func (r *resourceServiceNetworkResourceAssociation) Schema(ctx context.Context, Attributes: map[string]schema.Attribute{ "arn": framework.ARNAttributeComputedOnly(), "dns_entry": schema.ListAttribute{ - Computed: true, + Computed: true, + PlanModifiers: []planmodifier.List{ + listplanmodifier.UseStateForUnknown(), + }, CustomType: fwtypes.NewListNestedObjectTypeOf[dnsEntry](ctx), ElementType: types.ObjectType{ AttrTypes: fwtypes.AttributeTypesMust[dnsEntry](ctx), @@ -186,6 +190,13 @@ func (r *resourceServiceNetworkResourceAssociation) Read(ctx context.Context, re } func (r *resourceServiceNetworkResourceAssociation) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan resourceServiceNetworkResourceAssociationModel + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) } func (r *resourceServiceNetworkResourceAssociation) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {