Skip to content

Commit b338989

Browse files
committed
prettier
1 parent 348c289 commit b338989

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

examples/typescript/documentation/functions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AwsProvider } from "@cdktf/provider-aws/lib/aws-provider";
77
// DOCS_BLOCK_END:functions
88
// DOCS_BLOCK_START:conditional
99
import { Token } from "cdktf";
10-
import { Instance } from "@cdktf/provider-aws/lib/instance"
10+
import { Instance } from "@cdktf/provider-aws/lib/instance";
1111
// DOCS_BLOCK_END:conditional
1212
// DOCS_BLOCK_START:conditional,operators,functions,functions-raw
1313
import { Fn } from "cdktf";
@@ -46,11 +46,11 @@ export class FunctionsStack extends TerraformStack {
4646

4747
// DOCS_BLOCK_START:conditional
4848
new Instance(this, "web", {
49-
ami: "ami-2757f631",
50-
count: Token.asNumber(
51-
Fn.conditional(Op.eq(Token.asAny("terraform.workspace"), "prod"), 2, 1)
52-
),
53-
instanceType: "t2.micro",
49+
ami: "ami-2757f631",
50+
count: Token.asNumber(
51+
Fn.conditional(Op.eq(Token.asAny("terraform.workspace"), "prod"), 2, 1),
52+
),
53+
instanceType: "t2.micro",
5454
});
5555
// DOCS_BLOCK_END:conditional
5656

website/docs/cdktf/concepts/functions.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,13 @@ func NewFunctionsStack(scope constructs.Construct, name string) cdktf.TerraformS
160160
## Special functions
161161

162162
### Conditional Expressions
163+
163164
The ternary [conditional expression](/terraform/language/expressions/conditionals) is supported in CDKTF as a function. Its first argument for the condition or predicate is usually an [operator](/terraform/cdktf/concepts/functions#operators) such as `Op.eq()` to ensure a runtime comparison. Programming language operators like `==` will be evaluated at synthesis time and the result hardcoded into the generated JSON or HCL. Depending on usage, output and inputs may need their [Token](/terraform/cdktf/concepts/tokens) types specified.
164165

165166
<!-- #NEXT_CODE_BLOCK_SOURCE:python examples/typescript/documentation#functions-conditional -->
166167
<!-- #NEXT_CODE_BLOCK_SOURCE:python examples/python/documentation#functions-conditional -->
167168

168-
<CodeTabs>
169-
</CodeTabs>
170-
169+
<CodeTabs></CodeTabs>
171170

172171
### Property Access Helpers
173172

website/docs/cdktf/concepts/tokens.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ cdktf.Token_NullValue()
221221

222222
In the code below, the outer `Token.as_number()` avoids:
223223

224-
> TypeError: type of argument count must be one of (int, float, cdktf.TerraformCount, NoneType); got jsii._reference_map.InterfaceDynamicProxy instead
224+
> TypeError: type of argument count must be one of (int, float, cdktf.TerraformCount, NoneType); got jsii.\_reference_map.InterfaceDynamicProxy instead
225225
226226
The inner `Token.as_any()` avoids generating extra quotes `"terraform.workspace"` and extra dollar signs `"$${terraform.workspace}"`.
227227

@@ -242,7 +242,7 @@ The inner `Token.as_any()` avoids generating extra quotes `"terraform.workspace"
242242
```
243243

244244
```ts
245-
foo
245+
foo;
246246
```
247247

248248
```terraform
@@ -252,4 +252,5 @@ resource "aws_instance" "web" {
252252
instance_type = "t2.micro"
253253
}
254254
```
255+
255256
</CodeTabs>

0 commit comments

Comments
 (0)