From b66d43700227597ba5ae2434f1d1bf800afbc2b4 Mon Sep 17 00:00:00 2001 From: Jonathan Lacefield Date: Tue, 15 Oct 2024 10:30:20 -0400 Subject: [PATCH 1/2] updated the grp address and added the mtls grp address to the namespace.resource --- internal/provider/namespace_resource.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/internal/provider/namespace_resource.go b/internal/provider/namespace_resource.go index 9097b61..42a658a 100644 --- a/internal/provider/namespace_resource.go +++ b/internal/provider/namespace_resource.go @@ -85,8 +85,9 @@ type ( } endpointsModel struct { - WebAddress types.String `tfsdk:"web_address"` - GrpcAddress types.String `tfsdk:"grpc_address"` + WebAddress types.String `tfsdk:"web_address"` + GrpcAddress types.String `tfsdk:"grpc_address"` + MtlsGrpcAddress types.String `tfsdk:"mtls_grpc_address"` } ) @@ -109,8 +110,9 @@ var ( } endpointsAttrs = map[string]attr.Type{ - "web_address": types.StringType, - "grpc_address": types.StringType, + "web_address": types.StringType, + "grpc_address": types.StringType, + "mtls_grpc_address": types.StringType, } ) @@ -232,7 +234,11 @@ func (r *namespaceResource) Schema(ctx context.Context, _ resource.SchemaRequest Description: "The endpoints for the namespace.", Attributes: map[string]schema.Attribute{ "grpc_address": schema.StringAttribute{ - Description: "The gRPC endpoint for the namespace that clients can connect to.", + Description: "The gRPC address for API key client connections (may be empty if API keys are disabled).", + Computed: true, + }, + "mtls_grpc_address": schema.StringAttribute{ + Description: "The gRPC address for mTLS client connections (may be empty if mTLS is disabled).", Computed: true, }, "web_address": schema.StringAttribute{ @@ -566,8 +572,9 @@ func updateModelFromSpec(ctx context.Context, diags diag.Diagnostics, state *nam state.CodecServer = codecServerState endpoints := &endpointsModel{ - GrpcAddress: stringOrNull(ns.GetEndpoints().GetGrpcAddress()), - WebAddress: stringOrNull(ns.GetEndpoints().GetWebAddress()), + GrpcAddress: stringOrNull(ns.GetEndpoints().GetGrpcAddress()), + WebAddress: stringOrNull(ns.GetEndpoints().GetWebAddress()), + MtlsGrpcAddress: stringOrNull(ns.GetEndpoints().GetMtlsGrpcAddress()), } endpointsState, objectDiags := types.ObjectValueFrom(ctx, endpointsAttrs, endpoints) diags.Append(objectDiags...) From d8f92cf4bd786561893fb4adcbb542b0eea7776b Mon Sep 17 00:00:00 2001 From: Jonathan Lacefield Date: Tue, 15 Oct 2024 12:09:52 -0400 Subject: [PATCH 2/2] generate resolution --- docs/resources/namespace.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/resources/namespace.md b/docs/resources/namespace.md index 26de13f..785342a 100644 --- a/docs/resources/namespace.md +++ b/docs/resources/namespace.md @@ -171,7 +171,8 @@ Optional: Read-Only: -- `grpc_address` (String) The gRPC endpoint for the namespace that clients can connect to. +- `grpc_address` (String) The gRPC address for API key client connections (may be empty if API keys are disabled). +- `mtls_grpc_address` (String) The gRPC address for mTLS client connections (may be empty if mTLS is disabled). - `web_address` (String) The address in the Temporal Cloud Web UI for the namespace ## Import