Skip to content

Commit

Permalink
chore: Run prettier on hcl-iteroperability doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mutahhir committed Jan 26, 2024
1 parent ee6ffff commit f22cc24
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions website/docs/cdktf/concepts/hcl-interoperability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: >-

# HCL Interoperability

Terraform requires infrastructure configuration files written in either [HashiCorp Configuration Language (HCL)](/terraform/language/syntax/configuration) or JSON syntax. CDK for Terraform (CDKTF) works by translating configurations defined in an imperative programming language to JSON configuration files for Terraform.
Terraform requires infrastructure configuration files written in either [HashiCorp Configuration Language (HCL)](/terraform/language/syntax/configuration) or JSON syntax. CDK for Terraform (CDKTF) works by translating configurations defined in an imperative programming language to JSON configuration files for Terraform.
Starting from version 0.20, CDKTF can also generate Terraform HCL as output by setting the `--hcl` flag when running `cdktf synth`.

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 Expand Up @@ -202,7 +202,7 @@ func NewHclInteropStack(scope constructs.Construct, name string) cdktf.Terraform
</CodeTabs>

To use this as a Terraform module, run `cdktf synth` and copy the resulting `cdktf.out/stacks/random-pet-module/cdk.tf.json` file out to the module directory in your HCL project.
By default, `cdktf synth` generates Terraform JSON, but starting from version 0.20, CDKTF can also generate Terraform HCL output by passing the `--hcl` flag to `cdktf synth`.
By default, `cdktf synth` generates Terraform JSON, but starting from version 0.20, CDKTF can also generate Terraform HCL output by passing the `--hcl` flag to `cdktf synth`.

After you transfer the `cdk.tf.json` (or `cdk.tf`) file, you can reference the pet name module as you would any other HCL Terraform module.

Expand All @@ -226,8 +226,6 @@ output "name" {
}
```



## HCL to CDKTF

HCL can be used with Terraform CDK in two ways. Converting HCL code directly to a CDKTF language, and using Terraform modules directly within CDKTF projects.
Expand Down

0 comments on commit f22cc24

Please sign in to comment.