-
Notifications
You must be signed in to change notification settings - Fork 116
Docs for Stacks in private registry #1417
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
Open
rkoron007
wants to merge
7
commits into
main
Choose a base branch
from
RK/stacks-in-private-registry
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e7cce8c
Start using section
rkoron007 6bb6df8
Done
rkoron007 85515b3
Forgot examples
rkoron007 96a559f
Merge branch 'main' into RK/stacks-in-private-registry
rkoron007 cf8ef50
Feedback
rkoron007 5179869
Added a crosslink to the registry docs
rkoron007 b01ff9f
Merge branch 'main' into RK/stacks-in-private-registry
rkoron007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
.../terraform-docs-common/docs/cloud-docs/registry/publish-stack-configuration.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| 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 `<NAME>.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 `<NAME>.tfcomponent.hcl` file. Refer to [Use artifacts from the HCP Terraform private registry](/terraform/cloud-docs/registry/using#use-a-stack-component-configuration) to learn more about using the `stack` block. | ||
|
|
||
| You can also publish component configurations to your private registry using the HCP Terraform API. To learn more, refer to the [Stack component configurations reference](/terraform/cloud-docs/api-docs/private-registry/stack-component-configurations#create-a-stack-component-configuration) | ||
|
|
||
| ## 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 `<NAME>.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. After the [tag prefix](#publish-multiple-configurations-from-one-repository), tags must follow semantic versioning, such as `1.2.3`. 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.