@serendipiaco/terrext

Tools para la creación y validación de archivos terraform a través de nodejs. -- Despliegue de terraform automatizado. Validación de tags basado en reglas.

Usage no npm install needed!

<script type="module">
  import serendipiacoTerrext from 'https://cdn.skypack.dev/@serendipiaco/terrext';
</script>

README

Terraform Tool

Terrext

Terrext is a tool that help you to validate terraform code base in a given rules

Only accepts *.tf.json.

Tools for terraform CI/CD

$ terrext --help
terrext [command]

Commands:
  terrext paths      Return all realpath for each .tf.json file in a folder.
  terrext resources  List all resource with their custom names.
  terrext tags       List all tags for each resource in a terraform file.

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]                                  [boolean]

EXAMPLES

terrext resources --file "/path/to/file.tf.json"

[
  {
    provider_instance: [ 'example1', 'example2' ]
  }
]

terrext paths --folder "/path/to/folder"

[
  '/path/to/folder/root.tf.json',
  '/path/to/folder/level-1-A/1-A.tf.json',
  '/path/to/folder/level-1-A/level-2-A/2-A-2.tf.json',
  '/path/to/folder/level-1-A/level-2-A/2-A.tf.json',
  '/path/to/folder/level-1-A/level-2-B/2-B.tf.json',
  '/path/to/folder/level-1-B/1-B.tf.json',
  '/path/to/folder/level-1-B/level-2-C/2-C.tf.json',
  '/path/to/folder/level-1-B/level-2-C/level-2-D/2-D.tf.json'
]

terrext tags --file "/path/to/file.tf.json" --provider "shortname"

[
  { example1: { tags: [ 'Name' ] } },
  { example2: { tags: [ 'Name' ] } }
]

{
  tags: {
    example1: [ 'Name' ],
    example2: [ 'Name' ]
  }
}