diff --git a/docs/getting-started/csharp.md b/docs/getting-started/csharp.md index 66e9d4f373..676b843b18 100644 --- a/docs/getting-started/csharp.md +++ b/docs/getting-started/csharp.md @@ -122,6 +122,30 @@ namespace MyCompany.MyApp } ``` +## Using Terraform Providers + +As you can see in the example above we want to deploy AWS resources, therefore we need to use the [Terraform AWS Provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs). The default way to work with a provider is to specify it in your local `cdktf.json` file, like this: + +```jsonc +{ + "language": "csharp", + "app": "dotnet run -p MyTerraformStack.csproj", + "terraformProviders": [ + // Terraform Providers with version constraint go here + "aws@~> 3.45" + ], + "terraformModules": [ + // Terraform Modules with version constraint go here + ], + "context": { + "excludeStackIdFromLogicalIds": "true" + } +} +``` + +Next you need to run `cdktf get` which generates provider-specific bindings. +To save some time you can also use pre-built provider, please visit the ["Using Providers and Modules"-Guide](../working-with-cdk-for-terraform/using-providers-and-modules.md) for more on that topic. + ## Synthesize Application When you are ready you can run the `synthesize` command to generate Terraform JSON configuration for the application. diff --git a/docs/getting-started/go.md b/docs/getting-started/go.md index 99cdeb528e..4dfc01dd98 100644 --- a/docs/getting-started/go.md +++ b/docs/getting-started/go.md @@ -132,6 +132,30 @@ JSII [is using pointers](https://github.com/aws/aws-cdk-rfcs/blob/master/text/20 to be able to represent an unset optional value as `nil`. Hence the helper functions `jsii.String()` and `jsii.Number()` are used in the example to get pointers to the corresponding types which can are passed as inputs. +## Using Terraform Providers + +As you can see in the example above we want to deploy AWS resources, therefore we need to use the [Terraform AWS Provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs). The default way to work with a provider is to specify it in your local `cdktf.json` file, like this: + +```jsonc +{ + "language": "go", + "app": "go run main.go", + "terraformProviders": [ + // Terraform Providers with version constraint go here + "aws@~> 3.45" + ], + "terraformModules": [ + // Terraform Modules with version constraint go here + ], + "context": { + "excludeStackIdFromLogicalIds": "true" + } +} +``` + +Next you need to run `cdktf get` which generates provider-specific bindings. +To save some time you can also use pre-built provider, please visit the ["Using Providers and Modules"-Guide](../working-with-cdk-for-terraform/using-providers-and-modules.md) for more on that topic. + ## Generating Go provider bindings For the above example to work, we need to add the `kreuzwerker/docker` Terraform provider to the `cdktf.json`. diff --git a/docs/getting-started/java.md b/docs/getting-started/java.md index 40d79993da..6f8289aa32 100644 --- a/docs/getting-started/java.md +++ b/docs/getting-started/java.md @@ -127,6 +127,30 @@ public class Main extends TerraformStack } ``` +## Using Terraform Providers + +As you can see in the example above we want to deploy AWS resources, therefore we need to use the [Terraform AWS Provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs). The default way to work with a provider is to specify it in your local `cdktf.json` file, like this: + +```jsonc +{ + "language": "java", + "app": "mvn -e -q compile exec:java", + "terraformProviders": [ + // Terraform Providers with version constraint go here + "aws@~> 3.45" + ], + "terraformModules": [ + // Terraform Modules with version constraint go here + ], + "context": { + "excludeStackIdFromLogicalIds": "true" + } +} +``` + +Next you need to run `cdktf get` which generates provider-specific bindings. +To save some time you can also use pre-built provider, please visit the ["Using Providers and Modules"-Guide](../working-with-cdk-for-terraform/using-providers-and-modules.md) for more on that topic. + ## Synthesize Application When you are ready you can run the `synthesize` command to generate Terraform JSON configuration for the application. diff --git a/docs/getting-started/python.md b/docs/getting-started/python.md index c95604c862..9507f9b0a7 100644 --- a/docs/getting-started/python.md +++ b/docs/getting-started/python.md @@ -114,6 +114,30 @@ MyStack(app, "hello-terraform") app.synth() ``` +## Using Terraform Providers + +As you can see in the example above we want to deploy AWS resources, therefore we need to use the [Terraform AWS Provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs). The default way to work with a provider is to specify it in your local `cdktf.json` file, like this: + +```jsonc +{ + "language": "python", + "app": "pipenv run python main.py", + "terraformProviders": [ + // Terraform Providers with version constraint go here + "aws@~> 3.45" + ], + "terraformModules": [ + // Terraform Modules with version constraint go here + ], + "context": { + "excludeStackIdFromLogicalIds": "true" + } +} +``` + +Next you need to run `cdktf get` which generates provider-specific bindings. +To save some time you can also use pre-built provider, please visit the ["Using Providers and Modules"-Guide](../working-with-cdk-for-terraform/using-providers-and-modules.md) for more on that topic. + ## Synthesize Application When you are ready you can run the `synthesize` command to generate Terraform JSON configuration for the application. diff --git a/docs/getting-started/typescript.md b/docs/getting-started/typescript.md index 8f1b93bf2d..daebd11123 100644 --- a/docs/getting-started/typescript.md +++ b/docs/getting-started/typescript.md @@ -92,6 +92,30 @@ new MyStack(app, "hello-terraform"); app.synth(); ``` +## Using Terraform Providers + +As you can see in the example above we want to deploy AWS resources, therefore we need to use the [Terraform AWS Provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs). The default way to work with a provider is to specify it in your local `cdktf.json` file, like this: + +```jsonc +{ + "language": "typescript", + "app": "npm run --silent compile && node main.js", + "terraformProviders": [ + // Terraform Providers with version constraint go here + "aws@~> 3.45" + ], + "terraformModules": [ + // Terraform Modules with version constraint go here + ], + "context": { + "excludeStackIdFromLogicalIds": "true" + } +} +``` + +Next you need to run `cdktf get` which generates provider-specific bindings. +To save some time you can also use pre-built provider, please visit the ["Using Providers and Modules"-Guide](../working-with-cdk-for-terraform/using-providers-and-modules.md) for more on that topic. + **Synthesize Application** When you are ready you can run the `synthesize` command to generate Terraform JSON configuration for the application.