Skip to content

Commit

Permalink
support for additional types for terraform output and cdktf synth (#88)
Browse files Browse the repository at this point in the history
* support for additional types for terraform output and cdktf synth

* version 0.0.6
  • Loading branch information
anubhavmishra authored May 15, 2020
1 parent 3a7391c commit baff569
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.6

- Typescript examples and template defaults for synthesize commands to compile application (#63)
- Terraform Output doesn't handle Optional Types (#83)

## 0.0.5

- Document Terraform outputs and remote backend (#64)
Expand Down
12 changes: 2 additions & 10 deletions docs/getting-started/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,11 @@ new MyStack(app, 'hello-terraform');
app.synth();
```

**Compile Application**

You can now compile the application by running `npm run compile` or `yarn compile`.

```bash
yarn compile
```

This will compile TypeScript to Javascript.

**Synthesize Application**

When you are ready you can run the `synthesize` command to generate Terraform JSON configuration for the application.
Running the command will compile the application `npm run compile` or `yarn compile` in the background for
you which will compile TypeScript to Javascript.

```bash
cdktf synth
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript-aws-cloudfront-proxy/cdktf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"language": "typescript",
"app": "node main.js",
"app": "yarn compile && node main.js",
"terraformProviders": ["aws@~> 2.0"]
}
2 changes: 1 addition & 1 deletion examples/typescript-aws/cdktf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"language": "typescript",
"app": "node main.js",
"app": "yarn compile && node main.js",
"terraformProviders": ["aws@~> 2.0"],
"terraformModules": ["terraform-aws-modules/eks/aws", "terraform-aws-modules/vpc/aws"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "root",
"version": "0.0.5",
"version": "0.0.6",
"private": true,
"scripts": {
"build": "lerna run build",
Expand Down
2 changes: 1 addition & 1 deletion packages/cdktf-cli/templates/typescript/cdktf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"language": "typescript",
"app": "node main.js",
"app": "yarn compile && node main.js",
"terraformProviders": ["aws@~> 2.0"]
}
4 changes: 2 additions & 2 deletions packages/cdktf/lib/terraform-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { TerraformResource } from "./terraform-resource"
import { keysToSnakeCase } from "./util"

export interface TerraformOutputConfig {
readonly value: string | number | boolean | any[] | {[key: string]: any};
readonly value: string | number | boolean | any[] | { [key: string]: any } | undefined;
readonly description?: string;
readonly sensitive?: boolean;
readonly dependsOn?: TerraformResource[];
}

export class TerraformOutput extends TerraformElement {
public value: string | number | boolean | any[] | {[key: string]: any};
public value: string | number | boolean | any[] | { [key: string]: any } | undefined;
public description?: string;
public sensitive?: boolean;
public dependsOn?: TerraformResource[];
Expand Down

0 comments on commit baff569

Please sign in to comment.