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

feat(docs): document Token.nullValue() #2297

Merged
merged 3 commits into from
Dec 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -105,3 +106,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.
DanielMSchmidt marked this conversation as resolved.
Show resolved Hide resolved

<CodeTabs>
DanielMSchmidt marked this conversation as resolved.
Show resolved Hide resolved
```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>