Skip to content

Commit

Permalink
feat(docs): document Token.nullValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarm committed Nov 16, 2022
1 parent 823f343 commit 5f60e02
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions website/docs/cdktf/concepts/tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -59,3 +60,35 @@ Later in synthesis, CDKTF will resolve the token to `${module.<module id>.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.

<CodeTabs>
```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()
```

</CodeTabs>

0 comments on commit 5f60e02

Please sign in to comment.