Skip to content
Closed
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
71 changes: 45 additions & 26 deletions content/terraform-docs-common/data/cloud-docs-nav-data.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[
{ "heading": "HCP Terraform" },
{ "title": "Overview", "path": "" },
{ "title": "Plans and Features",
{ "title": "Plans and Features",
"routes": [
{
"title": "Overview",
"path": "overview"
"path": "overview"
},
{
"title": "Estimate HCP Terraform Cost",
Expand Down Expand Up @@ -359,8 +359,8 @@
"routes": [
{"title": "Overview","path": "users-teams-organizations/organizations"},
{
"title": "Manage reserved tag keys",
"path": "users-teams-organizations/organizations/manage-reserved-tags"
"title": "Manage reserved tag keys",
"path": "users-teams-organizations/organizations/manage-reserved-tags"
},
{ "title": "VCS Status Checks", "path": "users-teams-organizations/organizations/vcs-status-checks" },
{ "title": "Automatically cancel plan-only runs", "path": "users-teams-organizations/organizations/vcs-speculative-plan-management" }
Expand Down Expand Up @@ -493,6 +493,25 @@
"title": "Configuration Designer",
"path": "registry/design"
}
]
},
{ "title": "Public Registry Namespaces", "routes": [
{
"title": "Overview",
"path": "public-namespace"
},
{
"title": "Create or claim a namespace",
"path": "public-namespace/create_or_claim"
},
{
"title": "Manage namespaces",
"path": "public-namespace/manage"
},
{
"title": "Manage namespace artifacts",
"path": "public-namespace/artifacts"
}
]
},
{
Expand All @@ -509,13 +528,13 @@
]
},
{
"title": "Policy enforcement",
"title": "Policy Enforcement",
"routes": [
{
"title": "Overview",
"path": "policy-enforcement"
{
"title": "Overview",
"path": "policy-enforcement"
},
{
{
"title": "Define policies",
"routes": [
{
Expand All @@ -529,8 +548,8 @@
{
"title": "OPA policies",
"path": "policy-enforcement/define-policies/opa"
}
]
}
]
},
{
"title": "Create and manage policy sets",
Expand All @@ -552,7 +571,7 @@
{
"title": "Run pre-written Sentinel policies",
"path": "policy-enforcement/prewritten-sentinel"
},
},
{
"title": "Test Sentinel policies",
"path": "policy-enforcement/test-sentinel"
Expand Down Expand Up @@ -581,33 +600,33 @@
"title": "Overview",
"path": "policy-enforcement/import-reference"
},
{
"title": "tfconfig",
"path": "policy-enforcement/import-reference/tfconfig"
{
"title": "tfconfig",
"path": "policy-enforcement/import-reference/tfconfig"
},
{
"title": "tfconfig/v2",
"path": "policy-enforcement/import-reference/tfconfig-v2"
},
{
"title": "tfplan",
"path": "policy-enforcement/import-reference/tfplan"
{
"title": "tfplan",
"path": "policy-enforcement/import-reference/tfplan"
},
{
"title": "tfplan/v2",
"path": "policy-enforcement/import-reference/tfplan-v2"
},
{
"title": "tfstate",
"path": "policy-enforcement/import-reference/tfstate"
{
"title": "tfstate",
"path": "policy-enforcement/import-reference/tfstate"
},
{
"title": "tfstate/v2",
"path": "policy-enforcement/import-reference/tfstate-v2"
},
{
"title": "tfrun",
"path": "policy-enforcement/import-reference/tfrun"
{
"title": "tfrun",
"path": "policy-enforcement/import-reference/tfrun"
}
]
}
Expand All @@ -626,7 +645,7 @@
"title": "Integrations",
"routes": [
{
"title": "Overview",
"title": "Overview",
"path": "integrations"
},
{
Expand Down Expand Up @@ -687,7 +706,7 @@
"title": "Service Graph Connector for Terraform",
"routes": [
{
"title": "Overview",
"title": "Overview",
"path": "integrations/service-now/service-graph"
},
{
Expand Down
32 changes: 31 additions & 1 deletion content/terraform-docs-common/data/docs-nav-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,36 @@
"title": "Integration Program",
"path": "partnerships"
},
{ "title": "Terraform Tools", "path": "terraform-tools" },
{
"title": "Terraform Tools",
"routes": [
{
"title": "Overview",
"path": "tools"
},
{
"title": "Terraform MCP server",
"badge": {
"text": "BETA",
"type": "outlined",
"color": "neutral"
},
"routes": [
{
"title": "Overview",
"path": "tools/mcp-server"
},
{
"title": "Deploy server",
"path": "tools/mcp-server/deploy"
},
{
"title": "Prompt model",
"path": "tools/mcp-server/prompt"
}
]
}
]
},
{ "title": "Glossary", "path": "glossary" }
]
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,10 @@ _With Key/Value Tags_
"type": "workspaces",
"relationships": {
"tag-bindings": {
{
"data": [{
"type": "tag-bindings",
"attributes": { "key": "env", "value": "test"}
}]
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If your Terraform files are stored in GitHub, you must configure an API token th

If your Terraform files are stored in GitLab Cloud, you must configure an API token that meets the following requirements:

- The token must be a personal access token. Refer to the [GitHub documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) for additional information.
- The token must be a personal access token. Refer to the [GitLab documentation](https://docs.gitlab.com/user/profile/personal_access_tokens) for additional information.
- The token must be have `read_repository` and `write_repository` scopes.

## Install
Expand Down Expand Up @@ -101,7 +101,6 @@ To configure your API token, set the `TF_GIT_PAT_TOKEN` environment variable
$ export TF_GIT_PAT_TOKEN=<TOKEN>
```


## Supported backends

The `tf-migrate` tool supports migrating state from the following backends to HCP Terraform or Terraform Enterprise:
Expand All @@ -119,6 +118,20 @@ The `tf-migrate` tool supports migrating state from the following backends to HC

`tf-migrate` does not support migrating state from an existing `cloud` integration or `remote` backend.

## Supported workspace workflows

Versions 1.1.0 and newer of `tf-migrate` can create CLI- or VCS-driven HCP Terraform workspaces.

The `tf-migrate` tool will only prompt you to create a VCS-driven workspace if you meet the following requirements:

- Your local configuration is a Git repository.
- Your local Git repository has either GitHub or GitLab configured as a remote.
- Your HCP Terraform organization has at least one VCS OAuth connection configured for GitHub or GitLab.

If your HCP Terraform organization has more than one VCS connection configured, `tf-migrate` will ask you to choose which VCS connection to use.

If your local configuration does not meet all of the above requirements, `tf-migrate` automatically creates a CLI-driven workspace instead.

## Enable logging

You can enable detailed logging by setting the `TF_MIGRATE_ENABLE_LOG` environment variable to `true`. When you enable this setting, `tf-migrate` writes the logs to the following locations, depending on your operating system:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The `tf-migrate prepare` command prompts you for the following information:
- The HCP Terraform or Terraform Enterprise organization to migrate your state to.
- If you would like to create a new branch named `hcp-migrate-<BRANCH>` where `<BRANCH>` is the name of the branch you currently have checked out.
- If you would like it to automatically create a pull request with the updated code change when the migration is complete.
- If you would like to create a CLI or VCS-driven workspace. Refer to [supported workspace workflows](/terraform/cloud-docs/migrate/tf-migrate#supported-workspace-workflows) for the requirements your configuration must meet to support a VCS-driven workspace.

The `tf-migrate prepare` command generates a new Terraform configuration in the `_hcp-migrate-configs` directory to perform the migration. This configuration creates the following resources:

Expand All @@ -29,7 +30,7 @@ The `tf-migrate prepare` command generates a new Terraform configuration in the
- A new local git branch if you responded to the prompt to create a new branch with `yes`.
- A new pull request in the remote git repository if you responded to the prompt to create a pull request with `yes`.

The `tf-migrate` CLI tool adds the generated configuration to the `.gitignore` file so that the configuration is not committed to source control.
The `tf-migrate` tool adds the generated configuration to the `.gitignore` file so that the configuration is not committed to source control.

The `tf-migrate` tool creates the following structure in HCP Terraform or Terraform Enterprise depending on your local configuration:

Expand Down Expand Up @@ -61,6 +62,22 @@ $ tf-migrate prepare
└────────────────────────────┘
Enter the name of the HCP Terraform organization to migrate to: my-org-1
✓ You have selected organization my-org-1 for migration

Current repository was found on github.com. Do you want to create VCS-driven workspaces ... ?

Enter a value: yes

✓ Found 4 VCS providers
┌────────────────────────────┬──────────────────┬─────────────────┐
│ Available VCS Providers │ Service Provider │ OAuth Client ID │
├────────────────────────────┤──────────────────┤─────────────────┤
│ github-dev │ GitHub │ oc-ABC123DEF456 │
│ github-internal │ GitHub │ oc-GHI789JKL012 │
└───────────────────────────────────────────────┴─────────────────┘

Enter the OAuth client ID of the VCS provider from the above list to create the VCS-driven workspace: oc-ABC123DEF456

✓ You have selected VCS provider GitHub for migration
✓ Found 2 directories with Terraform files
┌────────────────────────────────┐
│ Terraform File Directories │
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
page_title: Manage namespace artifacts
description: Learn to manage a public namespace’s available modules, and providers.
tfc_only: true
---

# Manage namespace artifacts

Namespaces let you connect a GitHub account to an HCP Terraform organization, letting organization members collectively manage that GitHub account’s existing and future public registry artifacts.

<Note>

Namespaces do not support publishing or managing [policy libraries](/terraform/registry/policy-libraries/publishing) in the public registry. To publish or manage policy libraries with a namespace, continue to use the [existing registry workflows](/terraform/registry/policy-libraries/publishing#publishing-to-the-registry).

</Note>

## Requirements

The following permissions are necessary to manage a namespace's artifacts:
- Organization owners or members with [**Manage public modules** permissions](/terraform/cloud-docs/users-teams-organizations/permissions#manage-public-registry) can manage modules in the public registry
- Organization owners or members with [**Manage public providers** permissions](/terraform/cloud-docs/users-teams-organizations/permissions#manage-public-registry) can manage providers in the public registry

## Publish artifacts

You can publish new modules and providers to the public registry under your organization’s claimed namespace. The following workflow should be familiar to existing public registry users:

1. Set up a GitHub repository following the conventions and instructions outlined for the type of artifact you want to publish.
- For [modules](/terraform/registry/modules/publish), ensure your repository meets the [requirements](/terraform/registry/modules/publish#requirements).
- For [providers](/terraform/registry/providers/publishing), follow all of the steps up to the [Publishing to the Registry](/terraform/registry/providers/publishing#publishing-to-the-registry) section.
- If you have not installed the [Terraform Cloud GitHub App](/terraform/cloud-docs/vcs/github-app) globally in your GitHub account, install the app in the repository you want to publish.
1. Sign in to [HCP Terraform](https://app.terraform.io/) and navigate to your organization, then select **Registry** in the sidebar, then **Public namespaces** and select the namespace you want to publish from.
1. Click **Publish** and select the type of artifact, provider or module, you want to publish.
1. Select the repository you want to publish.
1. If you are publishing a provider, choose a **Category.**
1. Check the box to agree to the terms of service.
1. Click **Publish provider** or **Publish module.**

HCP Terraform then displays a list of all the versions of your provider or module currently in your repository, and the status of each version that the public registry creates. If you navigate away from this page before processing is complete, it continues in the background.

## Publish new artifact versions

You can create new versions of public registry artifacts using the same workflow as individual GitHub accounts. Add a properly formatted tag for modules, or release for providers, to your artifact's GitHub repository. GitHub notifies HCP Terraform that a new version or release is available and instructs the public registry to create a new version.

Once the public registry creates the new version it appears in your namespace in HCP Terraform. You can view artifact versions by clicking the ellipsis **…** next to an artifact and selecting **View version history**. New versions are also visible on your artifact's page in the public registry.

If the new version creates errors, a notification appears on your organization's **Public namespaces** page. The notification includes an error, and after you fix the problem we recommend [creating a new tag or release](/terraform/registry/faq#how-do-i-correct-bugs-in-published-versions).

## View artifacts

On the **Public namespaces** page, you can click the ellipsis **…** next to an artifact to list the available actions you can take on that artifact:

- **View in public registry** links to the artifact’s page on [`https://registry.terraform.io`](https://registry.terraform.io).
- **View downloads** has the download metrics for the selected artifact.
- View the number of times users have downloaded multiple versions, or select a single version to view the number of times users have downloaded it.
- You can also download a CSV file that summarizes the monthly downloads of each artifact version.
- **View version history** lists the artifact's published versions.
- **Add to private library** adds the artifact to your organization’s [private registry](/terraform/cloud-docs/registry).

## Delete artifacts or artifact versions

On the **Public namespaces** page, you can delete modules, providers, and module and provider versions if you have the [correct permissions](#requirements) and an artifact meets specific deletion requirements.

### Deletion requirements

To delete a provider, module, or a provider or module version, one of the following must be true:

- Someone published the artifact less than 48 hours ago.
- No version of the artifact was downloaded by users more than 100 times.

### Delete a module or provider

If your provider or module meets [the deletion requirements](#deletion-requirements), you delete it by doing the following:

- Clicking on the ellipsis **…** next to the artifact and choosing **Delete.**
- Confirm by entering `delete` and click **Delete.**

### Delete a module or provider version

If your provider or module meets [the deletion requirements](#deletion-requirements), you delete a version by doing the following:

- Clicking on the ellipsis **…** next to the artifact and choosing to **Delete version.**
- Entering the exact version of the provider or module to delete.
- Confirm by entering `delete` and click **Delete version.**

## Resync artifacts

Resyncing an artifact checks for discrepancies between the versions of an artifact on GitHub and the versions available within the public registry. Resyncing attempts to reconcile any differences by changing versions available in the public registry to match GitHub.

If an artifact version exists in GitHub but not in the registry, HCP Terraform attempts to create new versions in the registry. If an artifact version exists in the registry but not in GitHub, HCP Terraform deletes the registry versions that [meet the deletion requirements](#deletion-requirements).

To resync an artifact:

1. Click the ellipsis **…** next to the artifact you want to resync.
1. Select **Resync**.
1. HCP Terraform lists the versions it intends to create or delete, click **Resync** to confirm.

You can then see the public registry's progress as it performs each operation. If you navigate away from this page before processing is complete it continues in the background
Loading
Loading