Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated the grpc address and added the mtls grpc address to the namespa… #141

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/resources/namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 14 additions & 7 deletions internal/provider/namespace_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
)

Expand All @@ -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,
}
)

Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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...)
Expand Down
Loading