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

chore: Add links and headers #3594

Merged
merged 10 commits into from
Apr 24, 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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ contact_links:
- name: ❓ Question
url: https://discuss.hashicorp.com/c/terraform-core/cdk-for-terraform/47
about: 🙋 For usage questions that may not require a core maintainer to answer, post in our community forum
- name: Terraform Cloud/Enterprise Troubleshooting
- name: HCP Terraform/Terraform Enterprise Troubleshooting
url: https://support.hashicorp.com/hc/en-us/requests/new
about: For issues related to the Terraform Cloud/Enterprise platform, please submit a HashiCorp support request or email [email protected]
about: For issues related to the HCP Terraform/Terraform Enterprise platform, please submit a HashiCorp support request or email [email protected]
2 changes: 1 addition & 1 deletion .github/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ If you have questions about CDK for Terraform (CDKTF) usage, please feel free to

## Enterprise/Commercial Support

If you are an existing Terraform Enterprise or Terraform Cloud for Business customer, please submit a HashiCorp support request or email [email protected]
If you are an existing Terraform Enterprise or HCP Terraform for Business customer, please submit a HashiCorp support request or email [email protected]
2 changes: 1 addition & 1 deletion examples/python/aws-eks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Commands:
cdktf diff [OPTIONS] Perform a diff (terraform plan) for the given stack
cdktf get [OPTIONS] Generate CDK Constructs for Terraform providers and modules.
cdktf init [OPTIONS] Create a new cdktf project from a template.
cdktf login Retrieves an API token to connect to Terraform Cloud.
cdktf login Retrieves an API token to connect to HCP Terraform.
cdktf synth [OPTIONS] Synthesizes Terraform code for the given app in a directory.
```

Expand Down
4 changes: 2 additions & 2 deletions website/data/cdktf-nav-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
"path": "create-and-deploy/environment-variables"
},
{
"title": "Terraform Cloud",
"path": "create-and-deploy/terraform-cloud"
"title": "HCP Terraform",
"path": "create-and-deploy/hcp-terraform"
},
{
"title": "Deployment Patterns",
Expand Down
4 changes: 2 additions & 2 deletions website/docs/cdktf/cli-reference/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ $ cdktf init --template="typescript" --from-terraform-project /path/to/terraform

## login

This command helps log in to Terraform Cloud by fetching a Terraform Cloud API token.
This command helps log in to HCP Terraform by fetching a HCP Terraform API token.

```bash
$ cdktf login --help
Expand Down Expand Up @@ -510,7 +510,7 @@ Please note that we currently expect custom TFE instances to be using the `https

**Examples**

Fetch an API token from Terraform Cloud.
Fetch an API token from HCP Terraform.

```bash
$ cdktf login
Expand Down
2 changes: 1 addition & 1 deletion website/docs/cdktf/concepts/assets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Assets are especially useful for:

The following example uses `TerraformAsset` to upload the contents of the specified directory into an S3 Bucket. The `TerraformAsset` is responsible for making sure the directory ends up in the correct output folder as a zip file that the `S3BucketObject` can reference.

The stack output directory in `cdktf.out` contains all of the assets that `TerraformAsset` needs. This is important for workflows where you use synthesized configurations with Terraform directly. For example, you would only need to upload the contents of the stack output folder to Terraform Cloud or Terraform Enterprise.
The stack output directory in `cdktf.out` contains all of the assets that `TerraformAsset` needs. This is important for workflows where you use synthesized configurations with Terraform directly. For example, you would only need to upload the contents of the stack output folder to HCP Terraform or Terraform Enterprise.

<!-- #NEXT_CODE_BLOCK_SOURCE:ts examples/typescript/documentation#assets -->
<!-- #NEXT_CODE_BLOCK_SOURCE:python examples/python/documentation#assets -->
Expand Down
8 changes: 4 additions & 4 deletions website/docs/cdktf/concepts/remote-backends.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description: >-

Terraform stores [state](/terraform/language/state) about managed infrastructure to map real-world resources to the configuration, keep track of metadata, and improve performance. Terraform stores this state in a local file by default, but you can also use a Terraform [remote backend](/terraform/language/settings/backends/remote) to store state remotely.

By default, `cdktf init` will configure a Terraform Cloud workspace and a corresponding remote backend to store state for the new project. If you run `cdktf init --local` to configure your new project to use a local backend to store state, you can still [migrate the state](#migrate-local-state-storage-to-remote) to a remote backend later.
By default, `cdktf init` will configure a HCP Terraform workspace and a corresponding remote backend to store state for the new project. If you run `cdktf init --local` to configure your new project to use a local backend to store state, you can still [migrate the state](#migrate-local-state-storage-to-remote) to a remote backend later.

You can configure your CDK for Terraform (CDKTF) remote backend to be [Terraform Cloud](https://cloud.hashicorp.com/products/terraform), another Terraform [supported backend](#supported-backends), or a custom location.
You can configure your CDK for Terraform (CDKTF) remote backend to be [HCP Terraform](https://cloud.hashicorp.com/products/terraform), another Terraform [supported backend](#supported-backends), or a custom location.

## When to Use Remote Backends

Expand Down Expand Up @@ -345,7 +345,7 @@ func main() {

</CodeTabs>

3. Run `cdktf diff <stack name> --migrate-state` to migrate the state into Terraform Cloud / Terraform Enterprise.
3. Run `cdktf diff <stack name> --migrate-state` to migrate the state into HCP Terraform or Terraform Enterprise.

```bash
Initializing Terraform Cloud...
Expand All @@ -372,7 +372,7 @@ func main() {

# Supported Backends

In addition to Terraform Cloud, Terraform and CDKTF support the following backends.
In addition to HCP Terraform, Terraform and CDKTF support the following backends.

- [local](/terraform/language/settings/backends/local)
```typescript
Expand Down
2 changes: 1 addition & 1 deletion website/docs/cdktf/concepts/stacks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ Accessing a value from a different stack causes the value to be exported as `Ter
The value is then accessed through a `TerraformRemoteState` in the target stack.
Both are automatically added to the respective stacks to make the process seemless.

When you are using Terraform Cloud, each stack must be its own workspace.
When you are using HCP Terraform, each stack must be its own workspace.
This means that you need to create a separate workspace for each stack and you need to [set the permissions to allow access between the stacks](/terraform/cloud-docs/workspaces/state#remote-state-access-controls).

### Stack Dependencies
Expand Down
2 changes: 1 addition & 1 deletion website/docs/cdktf/concepts/variables-and-outputs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can define [Terraform variables](/terraform/language/values/variables) as in

### When to use Input Variables

Variables are useful when you plan to synthesize your CDKTF application into a JSON configuration file for Terraform. For example, when you are planning to store configurations and run Terraform inside [Terraform Cloud](https://cloud.hashicorp.com/products/terraform).
Variables are useful when you plan to synthesize your CDKTF application into a JSON configuration file for Terraform. For example, when you are planning to store configurations and run Terraform inside [HCP Terraform](https://cloud.hashicorp.com/products/terraform).

If you plan to use CDKTF to manage your infrastructure, we recommend using your language's APIs to consume the data you would normally pass through Terraform variables. You can read from disk (synchronously) or from the environment variables, just as you would in any normal program.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/cdktf/create-and-deploy/best-practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ new MyResource(this, "hello", {

To pass a [Terraform variable through environment variables](/terraform/cli/config/environment-variables#tf_var_name), name the environment variable `TF_VAR_NAME`. For example, set `TF_VAR_adminPassword='<your password>'` in the execution environment.

If you use Terraform Cloud with [remote execution](/terraform/cloud-docs/run/remote-operations#remote-operations), you can store your secrets in Terraform Cloud. Refer to the Terraform Cloud documentation about [workspace variables](/terraform/cloud-docs/workspaces/variables/managing-variables#workspace-specific-variables) for more details.
If you use HCP Terraform with [remote execution](/terraform/cloud-docs/run/remote-operations#remote-operations), you can store your secrets in HCP Terraform. Refer to the HCP Terraform documentation about [workspace variables](/terraform/cloud-docs/workspaces/variables/managing-variables#workspace-specific-variables) for more details.

We recommend using `TerraformVariable` only at the Stack level. Nesting them in custom constructs makes the interface unclear because some information may be passed into the constructor of the construct, while other data may be passed through a `TerraformVariable`. Nesting also changes the logical ID and makes it difficult to understand which `TerraformVariable` instances you must configure for the CDKTF program to run.

Expand Down
26 changes: 13 additions & 13 deletions website/docs/cdktf/create-and-deploy/deployment-patterns.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can configure your Continuous Integration/Continuous Deployment (CI/CD) envi

## Deployment Methods

You can provision your infrastructure using either CDKTF CLI commands (e.g., `cdktf deploy`) or by synthesizing your application into a Terraform configuration file and using Terraform directly. Both approaches allow you to use Terraform Cloud and integrate with a CI/CD pipeline.
You can provision your infrastructure using either CDKTF CLI commands (e.g., `cdktf deploy`) or by synthesizing your application into a Terraform configuration file and using Terraform directly. Both approaches allow you to use HCP Terraform and integrate with a CI/CD pipeline.

### Run CDKTF CLI Commands

Expand All @@ -22,13 +22,13 @@ We recommend using [CDKTF CLI commands](/terraform/cdktf/cli-reference/commands)

### Run `cdktf synth` and Use Terraform Directly

We recommend synthesizing your CDKTF application and using Terraform directly when you need to integrate into existing Terraform workflows. Your organization may already use Terraform Cloud or have integrated Terraform into CI pipelines. In these cases, you may want to run `cdktf synth` and set the output folder to a particular directory that you can reference in your existing workflows.
We recommend synthesizing your CDKTF application and using Terraform directly when you need to integrate into existing Terraform workflows. Your organization may already use HCP Terraform or have integrated Terraform into CI pipelines. In these cases, you may want to run `cdktf synth` and set the output folder to a particular directory that you can reference in your existing workflows.

## Using Terraform Cloud
## Using HCP Terraform

Terraform Cloud lets you review the current state of your infrastructure and run progress in the Terraform Cloud UI. You can also use Terraform Cloud as the source of secrets.
HCP Terraform lets you review the current state of your infrastructure and run progress in the HCP Terraform UI. You can also use HCP Terraform as the source of secrets.

Refer to [Set Up CDKTF With Terraform Cloud](/terraform/cdktf/create-and-deploy/terraform-cloud#set-up-cdktf-with-terraform-cloud) for details. Refer to [Example Workflows](#example-workflows) for several examples of connecting your CDKTF application to Terraform Cloud and using Terraform Cloud in a Continuous Integration pipeline.
Refer to [Set Up CDKTF With HCP Terraform](/terraform/cdktf/create-and-deploy/hcp-terraform#set-up-cdktf-with-hcp-terraform) for details. Refer to [Example Workflows](#example-workflows) for several examples of connecting your CDKTF application to HCP Terraform and using HCP Terraform in a Continuous Integration pipeline.

## Managing Secrets and Sensitive Data

Expand All @@ -38,26 +38,26 @@ You should [read secrets with Terraform Variables](/terraform/cdktf/create-and-d

The following examples demonstrate common deployment workflows for your CDKTF application.

### Deploy with Terraform and Terraform Cloud
### Deploy with Terraform and HCP Terraform

Connect your synthesized CDKTF configuration to a Terraform Cloud workspace with the following steps:
Connect your synthesized CDKTF configuration to a HCP Terraform workspace with the following steps:

1. Add a pre-commit step in your CDKTF application that runs `cdktf synth`. This creates Terraform configuration files in the `cdktf.out/stacks/<stack-name>` directory.
2. [Configure the VCS integration](/terraform/cloud-docs/workspaces/settings/vcs) for a Terraform cloud workspace to point to the directory with the synthesized configuration files. To deploy multiple independent stacks, configure one Terraform Cloud workspace to point to the output directory for each stack.
2. [Configure the VCS integration](/terraform/cloud-docs/workspaces/settings/vcs) for a HCP Terraform workspace to point to the directory with the synthesized configuration files. To deploy multiple independent stacks, configure one HCP Terraform workspace to point to the output directory for each stack.

Refer to [Automatic Run Triggering](/terraform/cloud-docs/workspaces/settings/vcs#automatic-run-triggering) in the Terraform Cloud documentation for details about how to trigger Terraform runs from merges and commits.
Refer to [Automatic Run Triggering](/terraform/cloud-docs/workspaces/settings/vcs#automatic-run-triggering) in the HCP Terraform documentation for details about how to trigger Terraform runs from merges and commits.

### Terraform CDK GitHub Action

You can use the [Terraform CDK GitHub Action](https://github.com/marketplace/actions/terraform-cdk-action) if you are using GitHub Actions and you want a default review / deployment workflow. The Terraform CDK GitHub Action runs the CDKTF CLI under the hood, it comments Terraform plans on your pull requests and provides a default review workflow. If you need more customization, refer to [GitHub Actions CI and Terraform Cloud](#github-actions-ci-and-terraform-cloud).
You can use the [Terraform CDK GitHub Action](https://github.com/marketplace/actions/terraform-cdk-action) if you are using GitHub Actions and you want a default review / deployment workflow. The Terraform CDK GitHub Action runs the CDKTF CLI under the hood, it comments Terraform plans on your pull requests and provides a default review workflow. If you need more customization, refer to [GitHub Actions CI and HCP Terraform](#github-actions-ci-and-hcp-terraform).

### GitHub Actions CI and Terraform Cloud
### GitHub Actions CI and HCP Terraform

Set the `TERRAFORM_CLOUD_TOKEN` environment variable to the [Terraform Cloud API token](/terraform/cloud-docs/users-teams-organizations/api-tokens). This allows the CDKTF stacks `CloudBackend` to connect to Terraform Cloud.
Set the `TERRAFORM_CLOUD_TOKEN` environment variable to the [HCP Terraform API token](/terraform/cloud-docs/users-teams-organizations/api-tokens). This allows the CDKTF stacks `CloudBackend` to connect to HCP Terraform.

You must create a job like this for every stack so that you can pass the stack name into `cdktf diff <stack name>`. None of the stacks can depend on each other because Terraform cannot reason about which stacks must be launched first to respect these dependencies.

The following example shows a GitHub Actions configuration where the CDKTF application is deployed from the `main` branch and uses Terraform Cloud. You could store this file in `.github/workflows/cdktf-deploy.yml`.
The following example shows a GitHub Actions configuration where the CDKTF application is deployed from the `main` branch and uses HCP Terraform. You could store this file in `.github/workflows/cdktf-deploy.yml`.

```yaml
name: CDKTF Deployment
Expand Down
Loading
Loading