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(docs): Proofreading edits #1150

Merged
merged 13 commits into from
Oct 15, 2021
2 changes: 1 addition & 1 deletion website/docs/cdktf/concepts/hcl-interoperability.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "Use configurations written in HCL and configurations written in CD

# HCL Interoperability

Terraform requires infrastructure configuration files written in either [HashiCorp Configuration Language (HCL)](https://www.terraform.io/docs/language/syntax/configuration.html) or JSON syntax. CDK for Terraform (CDKTF) works by translating configurations defined in a declarative programming language to JSON configuration files for Terraform.
Terraform requires infrastructure configuration files written in either [HashiCorp Configuration Language (HCL)](https://www.terraform.io/docs/language/syntax/configuration.html) or JSON syntax. CDK for Terraform (CDKTF) works by translating configurations defined in an imperative programming language to JSON configuration files for Terraform.

CDKTF may not be the right choice for every team and project within your organization. For example, some teams may already be very familiar with Terraform and have created HCL modules, providers, etc. To provide flexibility, CDKTF applications are interoperable with Terraform projects written in HCL. Specifically:

Expand Down
4 changes: 2 additions & 2 deletions website/docs/cdktf/concepts/modules.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ description: "Use both public and private modules in your CDKTF application to r

# Modules

[Terraform modules](https://www.terraform.io/docs/language/modules/index.html) are a single directory that contains one or more configuration files.
A [Terraform modules](https://www.terraform.io/docs/language/modules/index.html) is a single directory that contains one or more configuration files.
schersh marked this conversation as resolved.
Show resolved Hide resolved

Modules let you reuse configurations across projects and teams, saving time, enforcing consistency, and reducing errors. For example, you could create a module to describe the configuration for all of your organization's public website buckets. When you package and share this module, other users can incorporate it into their configurations. As requirements evolve, you can make changes to your module once, release a new version, and apply those changes everywhere that module is used.

You can specify any existing public or private module in your `cdktf.json` file, and CDK for Terraform (CDKTF) generates the necessary code bindings for you to use in your application.

## Install Modules

CDKTF lets you use modules from the [Terraform Registry](https://registry.terraform.io/) and other sources like GitHub local in your application. For example, the TypeScript project below has a `main.ts` file that defines AWS resources and uses the [AWS VPC module](https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest).
CDKTF lets you use modules from the [Terraform Registry](https://registry.terraform.io/) and other sources like GitHub in your application. For example, the TypeScript project below has a `main.ts` file that defines AWS resources and uses the [AWS VPC module](https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest).

```typescript
import { Construct } from "constructs";
Expand Down
8 changes: 5 additions & 3 deletions website/docs/cdktf/concepts/providers-and-resources.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ For example, this is how you could add [DNS Simple](https://www.terraform.io/doc
{
"language": "typescript",
"app": "npm run --silent compile && node main.js",
"terraformProviders": ["aws@~> 2.0", "dnsimple"]
"terraformProviders": ["aws@~> 2.0", "dnsimple/dnsimple"]
}
```

Expand All @@ -83,7 +83,7 @@ Import and use the generated classes in your application. The example below show

```typescript
import { Construct } from "constructs";
import { App, TerraformStack } from "cdktf";
import { App, TerraformStack, Token } from "cdktf";
import { AwsProvider, Instance } from "./.gen/providers/aws";
import { DnsimpleProvider, Record } from "./.gen/providers/dnsimple";

Expand Down Expand Up @@ -250,12 +250,14 @@ export class HelloTerra extends TerraformStack {

const region = new DataAwsRegion(this, "region");

const table = new DynamodbTable(this, "Hello", {
new DynamodbTable(this, "Hello", {
name: `my-first-table-${region.name}`,
hashKey: "temp",
attribute: [{ name: "id", type: "S" }],
billingMode: "PAY_PER_REQUEST",
});
}
}
```

The [Examples](/docs/cdktf/examples.html) page contains multiple example projects for every supported programming language.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/cdktf/concepts/remote-backends.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The TypeScript example below uses the `TerraformBackend` subclass `RemoteBackend

```typescript
import { Construct } from "constructs";
import { App, TerraformStack, TerraformOutput } from "cdktf";
import { App, RemoteBackend, TerraformStack, TerraformOutput } from "cdktf";

class MyStack extends TerraformStack {
constructor(scope: Construct, id: string) {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/cdktf/concepts/stacks.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ multiple-stacks-production-eu cdktf.out/stacks/multiple-stacks-production-eu

Currently, all Terraform operations are limited to a single stack. That means you must specify a target stack when you run `diff`, `deploy` or `destroy`. A deploy command like `cdktf deploy multiple-stacks-dev` will work and all Terraform operations will run in the folder `cdktf.out/stacks/multiple-stacks-dev`.

Omitting the target stack by running a plain `cdktf deploy` will result in error. This will change in future versions, where support for targeting all or a subset of stacks will be added. Please track this [issue](https://github.com/hashicorp/terraform-cdk/issues/650) when you're interested in this feature.
Omitting the target stack by running a plain `cdktf deploy` will result in error. This will change in future versions, where support for targeting all or a subset of stacks will be added. Please track this [issue](https://github.com/hashicorp/terraform-cdk/issues/650) if you're interested in this feature.

##### Cross Stack References

Expand Down
4 changes: 2 additions & 2 deletions website/docs/cdktf/concepts/variables-and-outputs.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ A [Terraform local](https://www.terraform.io/docs/configuration/locals.html) ass

### When to Use Local Values

Use local values when you need use [Terraform functions](/docs/cdktf/concepts/functions.html) to transform data that is only available when Terraform applies a configuration. For example, instance IDs tha cloud providers assign upon creation.
Use local values when you need use [Terraform functions](/docs/cdktf/concepts/functions.html) to transform data that is only available when Terraform applies a configuration. For example, instance IDs that cloud providers assign upon creation.

When values are available before [synthesizing your code](/docs/cdktf/cli-reference/commands.html#synth), we recommend using native programming language features to modify values instead.

Expand Down Expand Up @@ -126,7 +126,7 @@ app.synth();

### Define Outputs

To access outputs, use the `_output` suffix for python and the `Output` suffix for other languages.
To access outputs, use the `_output` suffix for Python and the `Output` suffix for other languages.

Outputs return an HCL expression representing the underlying Terraform resource, so the return type must always be `string`. When `TerraformOutput` is any other type than string, you must add a typecast to compile the application (e.g. `mod.numberOutput as number`). If a module returns a list, you must use an escape hatch to access items or loop over it. Refer to the [Resources page](/docs/cdktf/concepts/providers-and-resources.html) for more information about how to use escape hatches.

Expand Down
6 changes: 3 additions & 3 deletions website/docs/cdktf/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ CDK for Terraform is under active development; we’re still working out key wor

This tool can be used with Terraform Cloud and Terraform Enterprise, but is not eligible for commercial support, and is not officially recommended for production use cases. Like other HashiCorp pre-1.0 tools, some early-adopter users are already using CDK for Terraform in production, and we are working with those users to validate and improve workflows.

Early adopters of CDK for Terraform should expect to encounter and work around bugs occasionally, may need to refactor their codebase with each major release, and will intermittently need to use HCL and understand how JSON Terraform configurations are generated, for example to use [overrides](https://github.com/hashicorp/terraform-cdk/blob/main/docs/working-with-cdk-for-terraform/escape-hatch.md) to use Terraform functionality that cannot currently be expressed using CDK for Terraform. Our goal is to provide a user experience where this is an exceptional edge case. If you’re comfortable with this level of troubleshooting, we’re very interested in your feedback and practical experience. The [Community](./community.html) page explains how to ask questions, submit issues, and contribute to the project.
Early adopters of CDK for Terraform should expect to encounter and work around bugs occasionally, may need to refactor their codebase with each major release, and will intermittently need to use HCL and understand how JSON Terraform configurations are generated. For example, [overrides](https://github.com/hashicorp/terraform-cdk/blob/main/docs/working-with-cdk-for-terraform/escape-hatch.md) may be required to use Terraform functionality that cannot currently be expressed using CDK for Terraform. Our goal is to provide a user experience where this is an exceptional edge case. If you’re comfortable with this level of troubleshooting, we’re very interested in your feedback and practical experience. The [Community](./community.html) page explains how to ask questions, submit issues, and contribute to the project.

These caveats apply to CDK for Terraform itself, which generates Terraform configurations. Generated Terraform configurations are applied using Terraform Core, a well established / mature tool to provision infrastructure.

Expand All @@ -73,5 +73,5 @@ See the CHANGELOG in a given release for a description of any new feature flags
## Get Started

- [Install CDKTF](https://learn.hashicorp.com/tutorials/terraform/cdktf-install?in=terraform/cdktf) and set up your first project on HashiCorp Learn.
- Learn about [CDKTF application architecture](/docs/cdktf/concepts/cdktf-architecture.html)
- Learn how to use key CDKTF concepts like [providers](/docs/cdktf/concepts/providers-and-resources.html), [modules](/docs/cdktf/concepts/modules.html), and [resources](/docs/cdktf/concepts/providers-and-resources.html) to define infrastructure
- Learn about [CDKTF application architecture](/docs/cdktf/concepts/cdktf-architecture.html).
- Learn how to use key CDKTF concepts like [providers](/docs/cdktf/concepts/providers-and-resources.html), [modules](/docs/cdktf/concepts/modules.html), and [resources](/docs/cdktf/concepts/providers-and-resources.html) to define infrastructure.