From e7cce8c900bf2c410502d2331d23c660dc063f25 Mon Sep 17 00:00:00 2001 From: rkoron007 Date: Mon, 1 Dec 2025 12:32:23 -0800 Subject: [PATCH 1/5] Start using section --- .../registry/publish-stack-configuration.mdx | 82 ++++++++++++ .../docs/cloud-docs/registry/using.mdx | 12 +- .../permissions/organization.mdx | 9 +- .../block/stack/tfcomponent/stack.mdx | 124 ++++++++++++++++++ .../block/stack/tfcomponent/stack.mdx | 124 ++++++++++++++++++ 5 files changed, 343 insertions(+), 8 deletions(-) create mode 100644 content/terraform-docs-common/docs/cloud-docs/registry/publish-stack-configuration.mdx create mode 100644 content/terraform/v1.14.x/docs/language/block/stack/tfcomponent/stack.mdx create mode 100644 content/terraform/v1.15.x (alpha)/docs/language/block/stack/tfcomponent/stack.mdx diff --git a/content/terraform-docs-common/docs/cloud-docs/registry/publish-stack-configuration.mdx b/content/terraform-docs-common/docs/cloud-docs/registry/publish-stack-configuration.mdx new file mode 100644 index 0000000000..f8e3f3972b --- /dev/null +++ b/content/terraform-docs-common/docs/cloud-docs/registry/publish-stack-configuration.mdx @@ -0,0 +1,82 @@ +--- +page_title: Publish Stack component configurations to the HCP Terraform private registry +description: Use the HCP Terraform private registry to publish and share Stack component configurations across your organization. +tfc_only: true +--- + +# Publish Stack component configurations to the private registry + +Publish Stack component configurations to your organization's private registry to simplify sharing and versioning configurations with your teams. + +## Background + +Stacks are made up of individual `component` blocks that each source a Terraform module. You define components in `.tfcomponent.hcl` files, which contain the component configuration for your Stack. + +You can publish a component configuration to the HCP Terraform private registry to share a Stack across your organization. When you publish a component configuration, other teams can create a new Stack using that configuration by sourcing it in a `stack` block in their own `.tfcomponent.hcl` file. Refer to [Use artifacts from the HCP Terraform private registry](/terraform/cloud-docs/registry/using) to learn more about using the `stack` block. + +## Prerequisites + +To publish a Stack component configuration file you must meet the following requirements: + +- You must be a member of the [owners team](/terraform/cloud-docs/users-teams-organizations/permissions/organization#organization-owners) or a team with [**Manage Stack component configurations** permissions](/terraform/cloud-docs/users-teams-organizations/permissions/organization#manage-private-registry). +- You must configure a VCS provider connection. Refer to [Connect to VCS Providers](/terraform/cloud-docs/vcs) for more information. + +Your VCS provider connection and repository must also meet the following requirements: + +- Your HCP Terraform user account must have admin access to your connected VCS repository. +- GitLab repositories must be in the main organization or group, and not in any subgroups. +- Your repository must contain a `.tfcomponent.hcl` file that defines your Stack's components. +- Your repository must have at least one [Git release tag using semantic versioning](#tag-versions). + +### Tag versions + +The HCP Terraform private registry uses Git tags to identify component configuration versions. Tags must follow semantic versioning format: `x.y.z`. The registry ignores tags that don't match this format. + +When you push a new semantic version tag to your repository, the registry automatically imports it as a new version. + +## Publish a component configuration + +To publish a Stack component configuration, complete the following steps: + +1. In HCP Terraform, navigate to your organization. +1. Select **Registry** from the sidebar, then **Private Library**. +1. Click **Publish** and choose **Stack component configuration** from the menu. +1. Select your VCS provider from the list. +1. Choose the repository that contains your component configuration. You can also search by typing part of the repository name. +1. If your component configuration is not at your repository's root, you can optionally specify a path in the **Source Directory** field. +1. You can optionally specify **Tag Prefix** if you are publishing [multiple component configurations from the same repository](#publish-multiple-configurations-from-one-repository). +1. Click **Next**. +1. In the **Stack component configuration source address** field, enter a name for the component configuration. Users reference this name in [stack blocks](/terraform/language/block/stack/tfcomponent/stack#source). +1. Click **Create**. + +HCP Terraform imports your component configuration and redirects you back to the main private registry page. Click the name of your component configuration to view its details page. + +### Publish multiple configurations from one repository + +If your repository contains multiple component configurations, use tag prefixes to publish them individually. For example, you can add GitHub tags such as `database-v1.0.0` and `network-v1.0.0`, then specify `database-` or `network-` as tag prefixes when you publish each component configuration. + +Without a tag prefix, HCP Terraform publishes new versions for all component configurations whenever you create a new tag in GitHub. + +## Release new versions + +To release a new version of a component configuration, push a new release tag to the associated VCS repository. The HCP Terraform private registry automatically imports the configuration and creates a new version for that tag. Refer to [Tag versions](#tag-versions) to learn about tag requirements. + +## View and manage published configurations + +You can view the following information about a component configuration on its details page: + +- Versions +- Source repository +- Providers +- Inputs +- Outputs +- Components +- Documentation from a `README` file in the repository + +Refer to [Define configuration](/terraform/language/stacks/component/config) to learn more about Stack component configurations. + +You can use the **Manage component configuration** menu to perform the following actions: + +- View version history +- Delete a specific version of the component configuration +- Delete the entire component configuration diff --git a/content/terraform-docs-common/docs/cloud-docs/registry/using.mdx b/content/terraform-docs-common/docs/cloud-docs/registry/using.mdx index 0daeff3f3f..bb840af4b3 100644 --- a/content/terraform-docs-common/docs/cloud-docs/registry/using.mdx +++ b/content/terraform-docs-common/docs/cloud-docs/registry/using.mdx @@ -1,15 +1,15 @@ --- -page_title: Use providers and modules from the HCP Terraform private registry -description: Learn how to use providers and modules from the HCP Terraform private registry in your Terraform configuration. +page_title: Use artifacts from the HCP Terraform private registry +description: Learn how to use artifacts from the HCP Terraform private registry in your Terraform configuration. --- -# Use providers and modules from the HCP Terraform private registry +# Use artifacts from the HCP Terraform private registry -All users in an organization can view the HCP Terraform private registry and use the available providers and modules. A private registry has some key requirements and differences from the [public Terraform Registry](/terraform/registry): +All users in an organization can view the HCP Terraform private registry and use the available providers, Stacks component configurations, and modules. A private registry has some key requirements and differences from the [public Terraform Registry](/terraform/registry): -- **Location:** Search for providers, modules, and usage examples in the HCP Terraform private registry UI. +- **Location:** Search for providers, modules, Stacks, and usage examples in the HCP Terraform private registry UI. - **Provider and Module block `source` argument:** Private providers and modules use a different format. -- **Terraform version:** HCP Terraform workspaces using version 0.11 and higher can automatically access your private modules during Terraform runs, and workspaces using version 0.13 and higher can also automatically access private providers. +- **Terraform version:** HCP Terraform workspaces and Stacks using version 0.11 and higher can automatically access private modules during Terraform runs. Workspaces and Stacks using version 0.13 and higher can also automatically access private providers. - **Authentication:** If you run Terraform on the command line, you must [authenticate](#authentication) to HCP Terraform or your instance to use providers and modules in your organization’s private registry. HCP Terraform supports using modules in written configuration or through the [no-code provisioning workflow](/terraform/cloud-docs/workspaces/no-code-provisioning/provisioning). diff --git a/content/terraform-docs-common/docs/cloud-docs/users-teams-organizations/permissions/organization.mdx b/content/terraform-docs-common/docs/cloud-docs/users-teams-organizations/permissions/organization.mdx index ecc088b327..3aa2c619b7 100644 --- a/content/terraform-docs-common/docs/cloud-docs/users-teams-organizations/permissions/organization.mdx +++ b/content/terraform-docs-common/docs/cloud-docs/users-teams-organizations/permissions/organization.mdx @@ -249,8 +249,9 @@ The following permissions control access to the organization's [private registry | Permission name | Description | |-----------------|-------------| -| [Manage modules](#manage-private-modules) | Publish and delete modules in private registry | -| [Manage providers](#manage-private-providers) | Publish and delete providers in private registry | +| [Manage modules](#manage-private-modules) | Publish and delete modules in the private registry | +| [Manage providers](#manage-private-providers) | Publish and delete providers in the private registry | +| [Manage Stack component configurations](#manage-private-stack-component-configurations) | Publish and delete Stack component configurations in the private registry | ### Manage private modules @@ -260,6 +261,10 @@ Allow members to publish and delete modules in the organization's private regist Allow members to publish and delete providers in the organization's private registry. +### Manage Stack component configurations + +Allow members to [publish and delete Stack component configurations](/terraform/cloud-docs/registry/publish-stack-configuration) in the organization's private registry. + ## Public registry permissions diff --git a/content/terraform/v1.14.x/docs/language/block/stack/tfcomponent/stack.mdx b/content/terraform/v1.14.x/docs/language/block/stack/tfcomponent/stack.mdx new file mode 100644 index 0000000000..893eae0342 --- /dev/null +++ b/content/terraform/v1.14.x/docs/language/block/stack/tfcomponent/stack.mdx @@ -0,0 +1,124 @@ +--- +page_title: stack block reference for Terraform Stack component configurations +description: Use the `stack` block to source component configurations from the HCP Terraform private registry. Each `stack` block represents a reusable component configuration that you can publish, version, and reuse. +--- + +# `stack` block reference + +Use the `stack` block to source component configurations from the [HCP Terraform private registry](/terraform/cloud-docs/registry). Each `stack` block represents a reusable component configuration that you can publish, version, and reuse. + +## Background + +Stacks are made up of individual `component` blocks that each source from a Terraform module. You define components in the `.tfcomponent.hcl` file, which is the component configuration file for your Stack. + +In the HCP Terraform private registry, you can publish and manage entire component configuration files to simplify sharing Stacks across your organization. Unlike [`component` blocks](/terraform/language/block/stack/tfcomponent/component) which source individual Terraform modules, the `stack` block sources an entire component configuration. Refer to [Publish Stack component configurations](/terraform/cloud-docs/registry/publish-stack-configuration) to learn more about publishing Stack configurations to the private registry. + +When you define a `stack` block in a `.tfcomponent.hcl` file, the `stack` block sources the entire component configuration, including all of the Stack's components and providers. Refer to [Use artifacts from the HCP Terraform private registry](/terraform/cloud-docs/registry/using) to learn more about using the stack block to define a new Stack. + +## Configuration model + +The `stack` block supports the following arguments: + +- [`stack "