GithubHelp home page GithubHelp logo

hashicorp / terraform-config-inspect Goto Github PK

View Code? Open in Web Editor NEW
369.0 280.0 76.0 166 KB

A helper library for shallow inspection of Terraform configurations

License: Mozilla Public License 2.0

Go 99.31% HCL 0.69%

terraform-config-inspect's Introduction

terraform-config-inspect

This repository contains a helper library for extracting high-level metadata about Terraform modules from their source code. It processes only a subset of the information Terraform itself would process, and in return it's able to be broadly compatible with modules written for many different versions of Terraform.

$ go install github.com/hashicorp/terraform-config-inspect@latest
import "github.com/hashicorp/terraform-config-inspect/tfconfig"

// ...

module, diags := tfconfig.LoadModule(dir)

// ...

Due to the Terraform v1.0 Compatibility Promises, this library should be able to parse Terraform configurations written in the language as defined with Terraform v1.0, although it may not immediately expose new additions to the language added during the v1.x series.

This library can also interpret valid Terraform configurations targeting Terraform v0.10 through v0.15, although the level of detail returned may be lower in older language versions.

Command Line Tool

The primary way to use this repository is as a Go library, but as a convenience it also contains a CLI tool called terraform-config-inspect, installed automatically by the go get command above, that allows viewing module information in either a Markdown-like format or in JSON format.

$ terraform-config-inspect path/to/module
# Module `path/to/module`

Provider Requirements:

- **null:** (any version)

## Input Variables

- `a` (default `"a default"`)
- `b` (required): The b variable

## Output Values

- `a`
- `b`: I am B

## Managed Resources

- `null_resource.a` from `null`
- `null_resource.b` from `null`
$ terraform-config-inspect --json path/to/module
{
  "path": "path/to/module",
  "variables": {
    "A": {
      "name": "A",
      "default": "A default",
      "pos": {
        "filename": "path/to/module/basics.tf",
        "line": 1
      }
    },
    "B": {
      "name": "B",
      "description": "The B variable",
      "pos": {
        "filename": "path/to/module/basics.tf",
        "line": 5
      }
    }
  },
  "outputs": {
    "A": {
      "name": "A",
      "pos": {
        "filename": "path/to/module/basics.tf",
        "line": 9
      }
    },
    "B": {
      "name": "B",
      "description": "I am B",
      "pos": {
        "filename": "path/to/module/basics.tf",
        "line": 13
      }
    }
  },
  "required_providers": {
    "null": []
  },
  "managed_resources": {
    "null_resource.A": {
      "mode": "managed",
      "type": "null_resource",
      "name": "A",
      "provider": {
        "name": "null"
      },
      "pos": {
        "filename": "path/to/module/basics.tf",
        "line": 18
      }
    },
    "null_resource.B": {
      "mode": "managed",
      "type": "null_resource",
      "name": "B",
      "provider": {
        "name": "null"
      },
      "pos": {
        "filename": "path/to/module/basics.tf",
        "line": 19
      }
    }
  },
  "data_resources": {},
  "module_calls": {}
}

Contributing

This library and tool are intentionally focused on only extracting simple top-level metadata about a single Terraform module. This is to reduce the maintenance burden of keeping this codebase synchronized with changes to Terraform itself: the features extracted by this package are unlikely to change significantly in future versions.

For that reason, we cannot accept external PRs for this codebase that add support for additional Terraform language features.

Furthermore, we consider this package feature-complete; if there is a feature you wish to see added, please open a GitHub issue first so we can discuss the feasability and design before submitting a pull request. We are unlikely to accept PRs that add features without discussion first.

We would be happy to review PRs to fix bugs in existing functionality or to improve the usability of the Go package API, however. We will be hesitant about any breaking changes to the API, since this library is used by a number of existing tools and systems.

To work on this codebase you will need a recent version of Go installed. Please ensure all files match the formatting rules applied by go fmt and that all unit tests are passing.

terraform-config-inspect's People

Contributors

abbydeng avatar alisdair avatar andy-caruso avatar apparentlymart avatar bflad avatar brompwnie avatar crw avatar dependabot[bot] avatar hashicorp-copywrite[bot] avatar hashicorp-tsccr[bot] avatar jbardin avatar jstewmon avatar kylecarbs avatar liamcervante avatar mdeggies avatar mildwonkey avatar radditude avatar radeksimko avatar schneiderl avatar tsubasaogawa avatar xiehan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-config-inspect's Issues

Add terraform-config-inspect to hashicorp releases

Hello,

This tool is useful, but having to setup a whole Go environment to install it is really a problem.

Would it be possible to release the CLI tool on hashicorp releases, or at least on github ?

Thanks in advance

Feature: Docker Container

It would be great if we could package this module into a docker container. That would be easy to use.

Incompatible types using embed.FS type in LoadModuleFromFilesystem

I'm trying to use LoadModuleFromFilesystem on an FS object obtained from the embed package, but since that function uses a custom FS module I get the following error that the FS i supplied does not implement the custom FS:

cannot use fs (type fs.FS) as type tfconfig.FS in assignment:
	fs.FS does not implement tfconfig.FS (wrong type for Open method)
		have Open(string) (fs.File, error)
		want Open(string) (tfconfig.File, error)

I wrote up a simple example showing what I'm trying to do. I also tested against an afero.FS and got the same result.

package main

import (
	"embed"
	"fmt"
	"github.com/hashicorp/terraform-config-inspect/tfconfig"
)

//go.embed ./*
var dotFS embed.FS

func main() {
	fmt.Printf("%T\n", dotFS) // embed.FS
	mod, _ := tfconfig.LoadModuleFromFilesystem(dotFS, "module/test")
	fmt.Println(mod)
}

Change requests for segmentio/terraform-docs

We are currently integrating support for Terraform 0.12's HCL 2 into terraform-docs while trying our best to retain as much functionality of our existing integration with (legacy) HCL as possible via segmentio/terraform-docs #62.

Since terraform-config-inspect supports parsing HCL and HCL 2 configurations, it would be a very valuable integration layer for terraform-docs to support existing and future Terraform versions. I could see that external PRs are currently not welcome, however, you may want to consider the following changes we consider necessary to keep up support for our existing functionality:

  1. Reading variables in the order they are defined. This feature is used by those who create forms or Jenkins pipeline parameter lists using terraform-docs where the order of variables is important. For this, tfconfig/module.go would need to support an additional ordered list of variables.
    Update: not necessary. We can derive the order from the line number reported through this library.

  2. Our users make use of lead comments for modules, variables and outputs. While the latter support description fields for this purpose, some of our users have been using it to provide random metadata, such as regular expressions for validation of variables.

If those changes are accepted, we can provide pull requests for these features.

Thanks! Thoughts?

FYI @khos2ow @moatra

Add CLI Version flag

I would like to be able to check the locally installed version. Something like

> terraform-config-inspect --version
v1.0.0-beta3

Accessing output types (in addition to name and description)

I wanted to see if there were a way to add support for exposing not just the name and description of output blocks, but also their types. It could be a "simple" type like string, number, map, list… or it could be a "complex" provider object like aws_arn, newrelic_alert_channel, pagerduty_user, etc.

Since you can now set output values to objects (in Terraform 0.12), I end up having to go digging through the source code to figure out what the object type is, then go to the documentation page to look-up which attributes are available. It's a PITA.

If there is a strong spec for HCL2 which describes which things are in-scope vs out-of-scope with regard to what you will/won't add support for, I would be happy to educate myself. Based on the terminal output for output blocks, I am led to believe that HCL has access to at least the "simple" types (string, number, map, list…).

From what I can tell, this feature would be additive and not backwards-incompatible.


terraform-docs/terraform-docs#269

Fail to install under go version 1.17

Environment: go 1.17.0 x64

We are using windows-latest hosted agent in AzureDevOps. During pipeline execution, it fail to install terraform-config-inspect using go 1.17, however it works in go 1.18.

Below is the error message using go 1.17:

go version go1.17 windows/amd64
Cloning into 'terraform-config-inspect'...
go: downloading github.com/spf13/pflag v1.0.3
go: downloading github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f
go: downloading github.com/hashicorp/hcl/v2 v2.0.0
go: downloading github.com/zclconf/go-cty v1.1.0
go: downloading github.com/agext/levenshtein v1.2.2
go: downloading github.com/apparentlymart/go-textseg v1.0.0
go: downloading github.com/mitchellh/go-wordwrap v1.0.0
go: downloading golang.org/x/text v0.3.2
go: downloading github.com/google/go-cmp v0.3.0

github.com/hashicorp/terraform-config-inspect/tfconfig

tfconfig\filesystem.go:93:37: undefined: any
note: module requires Go 1.18

May I ask whether terraform-config-inspect still support install under go 1.17?

Use finalized io/fs.FS interface definitions

The fs.FS interfaces have been published in Go 1.16. I suggest updating the interface definitions defined in filesystem.go to align with the finalized design of FS.

This project defines custom FS/File interfaces (reproduced below) that match an early draft of the FS interface design. I'm happy to see the attempt to match the coming spec, but unfortunately the spec had a few changes between the referenced draft and final design. Luckily it seems that the draft was still pretty close and I expect would require minimal changes to conform.

// FS represents a minimal filesystem implementation
// See io/fs.FS in http://golang.org/s/draft-iofs-design
type FS interface {
	Open(name string) (File, error)
	ReadFile(name string) ([]byte, error)
	ReadDir(dirname string) ([]os.FileInfo, error)
}

Thoughts?

Can I embed and modify this project within segmentio/terraform-docs

We are currently trying to fix terraform-docs/terraform-docs#176 which internally would have depended on #24 but since terraform-config-inspect is considered to be feature-complete and it appears #24 is stalled and will not get merged, we've decided to move github.com/hashicorp/terraform-config-inspect as an internal package (github.com/segmentio/terraform-docs/internal/tfconfig) rather than it being an external vendor dependency and apply the changes in #24 directly in there (the change is done in terraform-docs/terraform-docs#221).

I want to double check that we would be able to do this in-project fork and modification considering the license terraform-config-inspect is being released under. I've read the MPL-2.0 LICENSE and I believe we'd be able to do that but I want to be absolutely sure that this would be ok. I'd really appreciate it if you can advise on the matter.

'go get ...' install method fails on MacOS/homebrew

I am unfamiliar with Go, but the generic installation instructions in README.md don't work on my Macbook:

# uname -a
Darwin <snipped> 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64 x86_64

# brew info go
go: stable 1.17, HEAD
...
  Built from source on 2021-09-01 at 14:39:49
...

# which go
/Users/<snipped>/homebrew/bin/go

# go version
go version go1.17 darwin/amd64

# go get github.com/hashicorp/terraform-config-inspect
go get: installing executables with 'go get' in module mode is deprecated.
  Use 'go install pkg@version' instead.
  For more information, see https://golang.org/doc/go-get-install-deprecation
  or run 'go help get' or 'go help install'.

Error: Invalid expression

Hi,

I'm getting the following error when running terraform-config-inspect:

...
## Problems

## Error: Invalid expression

(at `main.tf` line 164)

Expected the start of an expression, but found an invalid expression token.

The line in question is:

resource "aws_instance" "squid" {
  count         = length(var.availability_zones)
  ami           = var.ami_id != "" ? var.ami_id : data.aws_ami.amzn2.id
  instance_type = var.instance_type
  key_name      = var.aws_key_name
  user_data     = data.template_cloudinit_config.squid.rendered
  monitoring    = true
  ebs_optimized = true

  dynamic "network_interface" {
    iterator = interface
>>>    for_each = length(var.network_interface_ids) > 0 ? list(element(var.network_interface_ids, count.index)) : list(element(aws_network_interface.squid[*].id, count.index))                                                                                                                                                

    content {
      device_index         = 0
      network_interface_id = interface.value
    }
  }
...

The above code works fine in terraform plan and terraform apply.

Support for reading terraform backend configuration

I have a need to be able to read the terraform backend configuration as a validation step before executing terraform. Does it make sense for me to build that into this library?

Looking through the code, it looks like I would need to add to tfconfig/module.go:Module a string property to store the backend type (s3, consul, etc) and a map property to store the backend configuration settings. Then I would need to update tfconfig/load_hcl.go:loadModule and tfconfig/load_legacy.go:loadModuleLegacyHCL to support reading the values, and finally update main.go:showModuleMarkdown to display the values.

Does all that make sense? Am I missing anything?

unable to install

Maybe I am doing something wrong, but the instructions from the README do not work for installing this library.

 $ go get github.com/hashicorp/terraform-config-inspect
cannot find package "github.com/hashicorp/hcl/v2" in any of:
	/usr/local/Cellar/go/1.15.2/libexec/src/github.com/hashicorp/hcl/v2 (from $GOROOT)
	/Users/rking/go/src/github.com/hashicorp/hcl/v2 (from $GOPATH)
cannot find package "github.com/hashicorp/hcl/v2/gohcl" in any of:
	/usr/local/Cellar/go/1.15.2/libexec/src/github.com/hashicorp/hcl/v2/gohcl (from $GOROOT)
	/Users/rking/go/src/github.com/hashicorp/hcl/v2/gohcl (from $GOPATH)
cannot find package "github.com/hashicorp/hcl/v2/hclparse" in any of:
	/usr/local/Cellar/go/1.15.2/libexec/src/github.com/hashicorp/hcl/v2/hclparse (from $GOROOT)
	/Users/rking/go/src/github.com/hashicorp/hcl/v2/hclparse (from $GOPATH)
cannot find package "github.com/hashicorp/hcl/v2/hclsyntax" in any of:
	/usr/local/Cellar/go/1.15.2/libexec/src/github.com/hashicorp/hcl/v2/hclsyntax (from $GOROOT)
	/Users/rking/go/src/github.com/hashicorp/hcl/v2/hclsyntax (from $GOPATH)

Terraform variable with type object - type value not converted into json format

Use-case:
I'm using the CLI from terraform-config-inspect (json output) to generate documentation for modules using json parsing in the output.

Problem:
When using object type into variables the default is converted json but the type is not converted to json format.

Terraform Code Example:

variable "cors_rule" {
  description = "default cors rule defined for s3 bucket"
  type = object({
    max_age_seconds = number
    allowed_origins = list(string)
    allowed_methods = list(string)
    allowed_headers = list(string)
  })
  default = {
    max_age_seconds = 3000
    allowed_origins = [
      "*"]
    allowed_methods = [
      "GET",
      "PUT"]
    allowed_headers = [
      "*"]
  }
}

Output:

"cors_rule": {
      "name": "cors_rule",
      "type": "object({\n    max_age_seconds = number\n    allowed_origins = list(string)\n    allowed_methods = list(string)\n    allowed_headers = list(string)\n  })",
      "description": "default cors rule defined for s3 bucket",
      "default": {
        "allowed_headers": [
          "*"
        ],
        "allowed_methods": [
          "GET",
          "PUT"
        ],
        "allowed_origins": [
          "*"
        ],
        "max_age_seconds": 3000
      },
      "pos": {
        "filename": "variables.tf",
        "line": 121
      }
    }

Module directory main.tf does not exist or cannot be read.

I can't read the main.tf

e.g. Expected is returned value, though got:
$ ~/go/bin/terraform-config-inspect --json | grep FarmProjects > null

Testing with grep works:
$ grep FarmProjects main.tf -A 2 -B 2

resource "aws_dynamodb_table" "projects_table" {
  name = "FarmProjects"
  billing_mode = "PAY_PER_REQUEST"
  hash_key = "ProjectId"

After all it seems main.tf isn't processed at all:
~/go/bin/terraform-config-inspect --json main.tf

{
  "path": "main.tf",
  "variables": {},
  "outputs": {},
  "required_providers": {},
  "managed_resources": {},
  "data_resources": {},
  "module_calls": {},
  "diagnostics": [
    {
      "severity": "error",
      "summary": "Failed to read module directory",
      "detail": "Module directory main.tf does not exist or cannot be read."
    }
  ]
}

Panic when calling LoadModuleFromFile

Terraform Configuration rds.tf is as below.

module "rds" {
  source = "terraform-alicloud-modules/rds/alicloud"
  engine = "MySQL"
  engine_version = "8.0"
  instance_type = "rds.mysql.c1.large"
  instance_storage = "20"
  instance_name = var.instance_name
  account_name = var.account_name
  password = var.password
}

output "DB_NAME" {
  value = module.rds.this_db_instance_name
}
output "DB_USER" {
  value = module.rds.this_db_database_account
}
output "DB_PORT" {
  value = module.rds.this_db_instance_port
}
output "DB_HOST" {
  value = module.rds.this_db_instance_connection_string
}
output "DB_PASSWORD" {
  value = module.rds.this_db_instance_port
}


variable "instance_name" {
  default = "poc"
  type = string
}

variable "account_name" {
  default = "oam"
}

variable "password" {
  default = "Xyfff83jfewGGfaked"
}

Try to get all variable information but panic happended.

func main()  {
	p := hclparse.NewParser()
	hclFile, _ := p.ParseHCLFile("./rds.tf")
	mod := tfconfig.Module{Variables: map[string]*tfconfig.Variable{}}
	tfconfig.LoadModuleFromFile(hclFile, &mod)
	for _, v := range mod.Variables {
		fmt.Println(v.Name, v.Type)
	}
}

It seems that all fields of tfconfig.Module has to be set even though I just variable from it, or panic will happen.

panic: assignment to entry in nil map

goroutine 1 [running]:
github.com/hashicorp/terraform-config-inspect/tfconfig.LoadModuleFromFile(0xc00010bd00, 0xc0001b7f00, 0x0, 0x0, 0x0)
	/Users/zhouzhengxi/go/pkg/mod/github.com/hashicorp/[email protected]/tfconfig/load_hcl.go:336 +0x1d12
main.main()
	/Users/zhouzhengxi/Programming/golang/src/github.com/zzxwill/try-cloudnative/homework/hcl.go:66 +0x246

JSON output causes parsing error

I run the terraform-config-inspect program from the Terraform's local-exec provisioner. I use the JSON output to automatically update the README file for a target Terraform code. My team all use my tool on their local machine and all reported errors from JSON parsing after they updated the config-inspect program to your latest PR #46 commit. We didn't have this problem using your PR #43 commit. Can you review the difference in JSON output format between these two PRs?

Support for table output

Is there any chance of implementing support for table output (either md/html) for the variables in markdown output? Or is this left for terraform-docs and other unofficial tools..?

Recursive child modules?

Either I am missing something or this feature isn't implemented... How do I get list of child modules downstream?

for example:

MODULE A > MODULE B > MODULE C
MODULE A > MODULE D > MODULE E
MODULE A > MODULE F > MODULE B > MODULE C

Add "profile" information on AWS provider

hello,

I was wondering if we could add an information about the profile used for example as below in the ProviderConfigs:

provider "aws" {
  profile = "my-profile"
}

Some context about this request: we are using Atlantis and we would like to check dynamically if we are running a plan/Apply on a production environment or not, in order to apply different governance rules based on this.

I understand that this is provider specific; and that you may not agree with this feature. In such case, would you please be able to give me some pointers on where to start in the codebase anyway (since I may go for a fork with my own modifications)?

Thanks for your help

Regression: Wrong type during markdown rendering

After c6ae626 landed, rendering markdown now appears to fail with the following:

error rendering template: template: md:15:47: executing "md" at <$versions>: wrong type for value; expected []string; got *tfconfig.ProviderRequirement

Variable validation block is not parsed

The validation block in variables is not parsed.

For example:

variable "location" {
  type        = string
  default     = "westeurope"
  validation {
    condition = contains(["westeurope", "northeurope", "global"], var.location)
    error_message = "Unsupported location."
  }
}

Is parsed as

 "location": {
      "name": "location",
      "type": "string",
      "default": "westeurope",
      "required": false,
      "pos": {
        "filename": "<file-path>",
        "line": 1
      }
    }

Failed to get modules

$ go get github.com/hashicorp/terraform-config-inspect
package github.com/hashicorp/hcl/v2: cannot find package "github.com/hashicorp/hcl/v2" in any of:
        /usr/local/go/src/github.com/hashicorp/hcl/v2 (from $GOROOT)
package github.com/hashicorp/hcl/v2/gohcl: cannot find package "github.com/hashicorp/hcl/v2/gohcl" in any of:              /usr/local/go/src/github.com/hashicorp/hcl/v2/gohcl (from $GOROOT)
package github.com/hashicorp/hcl/v2/hclparse: cannot find package "github.com/hashicorp/hcl/v2/hclparse" in any of:        /usr/local/go/src/github.com/hashicorp/hcl/v2/hclparse (from $GOROOT)
package github.com/hashicorp/hcl/v2/hclsyntax: cannot find package "github.com/hashicorp/hcl/v2/hclsyntax" in any of:
        /usr/local/go/src/github.com/hashicorp/hcl/v2/hclsyntax (from $GOROOT)

I see the lastest commit updated the module to hcl/v2.
But I didn't see it in github.com/hashicorp/hcl

Add Binary Releases

what

  • Add semver releases
  • Attach precompiled binaries to the releases

why

  • Not everyone has a go setup
  • GitHub actions make it trivial to build and distribute binary releases (happy to provide example)

Support rich provider configurations

I noticed, that only very basic provider configurations are resolved (only name and alias actually). Would it be in scope of the project to include the specific provider configurations (e.g. "host", "client_certificate", etc. from the Kubernetes provider)?

display raw value from output

Hi there,
I'm trying to add printout of the raw value from the output.
So from this

output "val_a" {
  value = "${var.a}"
}

I'd like to get output like this

  "outputs": {
    "val_a": {
      "name": "val_a",
      "raw_value": "${var.a}",
      "pos": {
        "filename": "test.tf",
        "line": 5
      }
    }
  }

The trouble I have is that I don't know how to force attr.Expr to return raw value, it seems to try to evaluate the attribute when I access it.
Any tips would be appreciated.

Thank you

DUMP


(*hcl.Block)(0xc00015e5b0)({
 Type: (string) (len=6) "output",
 Labels: ([]string) (len=1 cap=1) {
  (string) (len=5) "val_a"
 },
 Body: (*hclsyntax.Body)(0xc0001840b0)({
  Attributes: (hclsyntax.Attributes) (len=1) {
   (string) (len=5) "value": (*hclsyntax.Attribute)(0xc0001820e0)({
    Name: (string) (len=5) "value",
    Expr: (*hclsyntax.TemplateWrapExpr)(0xc00015a190)({
     Wrapped: (*hclsyntax.ScopeTraversalExpr)(0xc00014d800)({
      Traversal: (hcl.Traversal) (len=2 cap=2) {
       (hcl.TraverseRoot) {
        isTraverser: (hcl.isTraverser) {
        },
        Name: (string) (len=3) "var",
        SrcRange: (hcl.Range) test.tf:6,14-17
       },
       (hcl.TraverseAttr) {
        isTraverser: (hcl.isTraverser) {
        },
        Name: (string) (len=1) "a",
        SrcRange: (hcl.Range) test.tf:6,17-19
       }
      },
      SrcRange: (hcl.Range) test.tf:6,14-19
     }),
     SrcRange: (hcl.Range) test.tf:6,11-21
    }),
    SrcRange: (hcl.Range) test.tf:6,3-21,
    NameRange: (hcl.Range) test.tf:6,3-8,
    EqualsRange: (hcl.Range) test.tf:6,9-10
   })
  },

Support _override.tf files

Currently this library does not support _override.tf and _override.tf.json files.

Since our goal with this library is to be as liberal as possible in what we accept (at the expense of catching fewer errors that Terraform itself would raise), we could actually just treat all files as override files, and remove the error checking for duplicate definitions. Valid configurations (as defined by Terraform) will never have such definitions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.