diff --git a/examples/resources/namespace/namespace.tf b/examples/resources/namespace/namespace.tf index ea52c31..9931085 100644 --- a/examples/resources/namespace/namespace.tf +++ b/examples/resources/namespace/namespace.tf @@ -6,5 +6,5 @@ resource "temporalcloud_namespace" "terraform" { name = "terraform" regions = ["aws-us-east-1"] accepted_client_ca = base64encode(file("${path.module}/ca.pem")) - retention_days = 14 + retention_days = 7 } diff --git a/internal/provider/namespace_resource.go b/internal/provider/namespace_resource.go index 7ef849d..6c3f6da 100644 --- a/internal/provider/namespace_resource.go +++ b/internal/provider/namespace_resource.go @@ -136,6 +136,9 @@ func (r *namespaceResource) Schema(ctx context.Context, _ resource.SchemaRequest }, "resource_version": schema.StringAttribute{ Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, }, "certificate_filters": schema.ListNestedAttribute{ Optional: true, @@ -263,6 +266,10 @@ func (r *namespaceResource) Update(ctx context.Context, req resource.UpdateReque if resp.Diagnostics.HasError() { return } + + tflog.Debug(ctx, "running update with resource version", map[string]any{ + "resource_version": plan.ResourceVersion.ValueString(), + }) svcResp, err := r.client.UpdateNamespace(ctx, &cloudservicev1.UpdateNamespaceRequest{ Namespace: plan.ID.ValueString(), Spec: &namespacev1.NamespaceSpec{ diff --git a/internal/provider/namespace_resource_test.go b/internal/provider/namespace_resource_test.go index a453795..0768ade 100644 --- a/internal/provider/namespace_resource_test.go +++ b/internal/provider/namespace_resource_test.go @@ -45,12 +45,10 @@ PEM // New namespace with retention of 7 Config: config("tf-basic-namespace", 7), }, - /* Does not work yet: CLD-1971 { // Update retention to 14 - Config: testAccBasicNamespaceConfig("terraform-test", 14), + Config: config("terraform-test", 14), }, - */ // Delete testing automatically occurs in TestCase }, })