Skip to content

Commit

Permalink
Added terraform command: providers
Browse files Browse the repository at this point in the history
Readme has been extended with terraform commands and options.
  • Loading branch information
willikisser committed Dec 1, 2023
1 parent 14059cd commit f0544c9
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,29 @@ nx g @nx-extend/terraform:init

## Usage

### Setup
```sh
nx g @nx-extend/terraform:init
```

#### Available options:

| name | type | required | default | description |
|-------------------|----------|----------|---------|------------------------------------------------------------------|
| **`--name`** | `string` | `true` | | Terraform project name |
| **`--directory`** | `string` | `false` | | A directory where the project is placed, based on the sourceRoot |
| **`--tags`** | `string` | `false` | `empty` | Comma separated list for tags |

### Terraform execution

```sh
nx run consent-service-infra-accounts-dev:initialize
nx run consent-service-infra-accounts-dev:providers
nx run consent-service-infra-accounts-dev:plan
nx run consent-service-infra-accounts-dev:apply
nx run consent-service-infra-accounts-dev:destroy
```

#### Available options:

| name | type | default | description |
Expand Down
10 changes: 10 additions & 0 deletions packages/terraform/executors.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
"implementation": "./src/executors/destroy/destroy.impl",
"schema": "./src/executors/destroy/schema.json",
"description": "destroy executor"
},
"providers": {
"implementation": "./src/executors/providers/providers.impl",
"schema": "./src/executors/providers/schema.json",
"description": "providers executor"
}
},
"builders": {
Expand Down Expand Up @@ -51,6 +56,11 @@
"implementation": "./src/executors/destroy/destroy.impl",
"schema": "./src/executors/destroy/schema.json",
"description": "destroy executor"
},
"providers": {
"implementation": "./src/executors/providers/providers.impl",
"schema": "./src/executors/providers/schema.json",
"description": "providers executor"
}
}
}
5 changes: 5 additions & 0 deletions packages/terraform/src/executors/providers/compat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { convertNxExecutor } from '@nx/devkit'

import providersExecutor from './providers.impl'

export default convertNxExecutor(providersExecutor)
3 changes: 3 additions & 0 deletions packages/terraform/src/executors/providers/providers.impl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createExecutor } from '../../utils/create-executor'

export default createExecutor('providers')
9 changes: 9 additions & 0 deletions packages/terraform/src/executors/providers/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": 2,
"outputCapture": "direct-nodejs",
"$schema": "http://json-schema.org/schema",
"type": "object",
"title": "Providers executor",
"description": "Providers",
"properties": {}
}
6 changes: 6 additions & 0 deletions packages/terraform/src/generators/init/init.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export default async function (
ciMode: true
}
},
providers: {
executor: '@nx-extend/terraform:providers',
options: {
ciMode: true
}
},
apply: {
executor: '@nx-extend/terraform:apply',
options: {
Expand Down

0 comments on commit f0544c9

Please sign in to comment.