From 5f60e02891b5af40ff4557b507192ad014184f22 Mon Sep 17 00:00:00 2001 From: Ansgar Mertens Date: Wed, 16 Nov 2022 11:47:18 +0100 Subject: [PATCH] feat(docs): document Token.nullValue() --- website/docs/cdktf/concepts/tokens.mdx | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/website/docs/cdktf/concepts/tokens.mdx b/website/docs/cdktf/concepts/tokens.mdx index 93797fed09..9318025067 100644 --- a/website/docs/cdktf/concepts/tokens.mdx +++ b/website/docs/cdktf/concepts/tokens.mdx @@ -18,6 +18,7 @@ You may need to use Tokens for: - [Module outputs](/cdktf/concepts/modules) for boolean, string, lists, maps, and other complex types. - Resource attributes (such as `id`). - Terraform outputs based on resource attributes. +- Using Terraforms `null` type. ### Example @@ -59,3 +60,35 @@ Later in synthesis, CDKTF will resolve the token to `${module..public ``` Refer to the [AWS CDK documentation](https://docs.aws.amazon.com/cdk/latest/guide/tokens.html) for more detailed information about tokens. + +### Using Terraform's `null` value + +Some edge cases require passing the Terraform `null` value to for example an attribute of a resource. + + +```typescript +import { Token } from "cdktf"; +Token.nullValue() +``` + +```python +from cdktf import Token +Token.null_value() +``` + +```java +import com.hashicorp.cdktf.Token; +Token.nullValue() +``` + +```csharp +using HashiCorp.Cdktf; +Token.NullValue() +``` + +```go +import "github.com/hashicorp/terraform-cdk-go/cdktf" +cdktf.Token_NullValue() +``` + +