diff --git a/docs/pages/reference/terraform-provider/data-sources/static_host_user.mdx b/docs/pages/reference/terraform-provider/data-sources/static_host_user.mdx index 0cec7fd996331..59f464fbddff3 100644 --- a/docs/pages/reference/terraform-provider/data-sources/static_host_user.mdx +++ b/docs/pages/reference/terraform-provider/data-sources/static_host_user.mdx @@ -15,14 +15,27 @@ description: This page describes the supported values of the teleport_static_hos ### Required +- `metadata` (Attributes) metadata is resource metadata. (see [below for nested schema](#nested-schema-for-metadata)) - `spec` (Attributes) spec is the static host user spec. (see [below for nested schema](#nested-schema-for-spec)) ### Optional -- `metadata` (Attributes) metadata is resource metadata. (see [below for nested schema](#nested-schema-for-metadata)) - `sub_kind` (String) sub_kind is an optional resource sub kind, used in some resources. - `version` (String) version is the resource version. It must be specified. Supported values are: `v2`. +### Nested Schema for `metadata` + +Required: + +- `name` (String) name is an object name. + +Optional: + +- `description` (String) description is object description. +- `expires` (String) +- `labels` (Map of String) labels is a set of labels. + + ### Nested Schema for `spec` Required: @@ -43,23 +56,8 @@ Optional: ### Nested Schema for `spec.matchers.node_labels` -Optional: +Required: - `name` (String) The name of the label. - `values` (List of String) The values associated with the label. - - - -### Nested Schema for `metadata` - -Required: - -- `name` (String) name is an object name. - -Optional: - -- `description` (String) description is object description. -- `expires` (String) -- `labels` (Map of String) labels is a set of labels. - diff --git a/docs/pages/reference/terraform-provider/resources/static_host_user.mdx b/docs/pages/reference/terraform-provider/resources/static_host_user.mdx index 0ad4818aa359c..09cc1a3bfc2d6 100644 --- a/docs/pages/reference/terraform-provider/resources/static_host_user.mdx +++ b/docs/pages/reference/terraform-provider/resources/static_host_user.mdx @@ -42,14 +42,27 @@ resource "teleport_static_host_user" "test" { ### Required +- `metadata` (Attributes) metadata is resource metadata. (see [below for nested schema](#nested-schema-for-metadata)) - `spec` (Attributes) spec is the static host user spec. (see [below for nested schema](#nested-schema-for-spec)) ### Optional -- `metadata` (Attributes) metadata is resource metadata. (see [below for nested schema](#nested-schema-for-metadata)) - `sub_kind` (String) sub_kind is an optional resource sub kind, used in some resources. - `version` (String) version is the resource version. It must be specified. Supported values are: `v2`. +### Nested Schema for `metadata` + +Required: + +- `name` (String) name is an object name. + +Optional: + +- `description` (String) description is object description. +- `expires` (String) +- `labels` (Map of String) labels is a set of labels. + + ### Nested Schema for `spec` Required: @@ -70,23 +83,8 @@ Optional: ### Nested Schema for `spec.matchers.node_labels` -Optional: +Required: - `name` (String) The name of the label. - `values` (List of String) The values associated with the label. - - - -### Nested Schema for `metadata` - -Required: - -- `name` (String) name is an object name. - -Optional: - -- `description` (String) description is object description. -- `expires` (String) -- `labels` (Map of String) labels is a set of labels. - diff --git a/integrations/terraform/protoc-gen-terraform-statichostuser.yaml b/integrations/terraform/protoc-gen-terraform-statichostuser.yaml index 0ddb0dfd757b7..fe4945dca9f1b 100644 --- a/integrations/terraform/protoc-gen-terraform-statichostuser.yaml +++ b/integrations/terraform/protoc-gen-terraform-statichostuser.yaml @@ -42,9 +42,12 @@ computed_fields: # These fields will be marked as Required: true required_fields: + - "StaticHostUser.metadata" - "StaticHostUser.metadata.name" - "StaticHostUser.spec" - "StaticHostUser.spec.matchers" + - "StaticHostUser.spec.matchers.node_labels.name" + - "StaticHostUser.spec.matchers.node_labels.values" plan_modifiers: # Force to recreate resource if it's name changes diff --git a/integrations/terraform/tfschema/userprovisioning/v2/statichostuser_terraform.go b/integrations/terraform/tfschema/userprovisioning/v2/statichostuser_terraform.go index ad830c40d0adf..2d8cfbca9c525 100644 --- a/integrations/terraform/tfschema/userprovisioning/v2/statichostuser_terraform.go +++ b/integrations/terraform/tfschema/userprovisioning/v2/statichostuser_terraform.go @@ -91,7 +91,7 @@ func GenSchemaStaticHostUser(ctx context.Context) (github_com_hashicorp_terrafor }, }), Description: "metadata is resource metadata.", - Optional: true, + Required: true, }, "spec": { Attributes: github_com_hashicorp_terraform_plugin_framework_tfsdk.SingleNestedAttributes(map[string]github_com_hashicorp_terraform_plugin_framework_tfsdk.Attribute{"matchers": { @@ -115,12 +115,12 @@ func GenSchemaStaticHostUser(ctx context.Context) (github_com_hashicorp_terrafor Attributes: github_com_hashicorp_terraform_plugin_framework_tfsdk.ListNestedAttributes(map[string]github_com_hashicorp_terraform_plugin_framework_tfsdk.Attribute{ "name": { Description: "The name of the label.", - Optional: true, + Required: true, Type: github_com_hashicorp_terraform_plugin_framework_types.StringType, }, "values": { Description: "The values associated with the label.", - Optional: true, + Required: true, Type: github_com_hashicorp_terraform_plugin_framework_types.ListType{ElemType: github_com_hashicorp_terraform_plugin_framework_types.StringType}, }, }),