Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/petems/tfvar-to-tfevar


https://github.com/petems/tfvar-to-tfevar

Last synced: 1 day ago
JSON representation

Awesome Lists containing this project

README

        

# `tfvar-to-tfevar`

**tfvar-to-tfevar** is a way to export [Terraform](https://www.terraform.io/)'s [variable definitions](https://www.terraform.io/docs/configuration/variables.html#assigning-values-to-root-module-variables) to [Terraform Enteprise or Terraform Cloud variables](https://www.terraform.io/docs/cloud/workspaces/variables.html)

It is heavily based on the awesome original work in [tfvar](https://github.com/shihanng/tfvar)

For Terraform configuration that has input variables declared, e.g.,

```terraform
variable "image_id" {
type = string
}

variable "availability_zone_names" {
type = list(string)
default = ["us-west-1a"]
}

variable "docker_ports" {
type = list(object({
internal = number
external = number
protocol = string
}))
default = [
{
internal = 8300
external = 8300
protocol = "tcp"
}
]
}
```

It will create valid Terraform code for the TFE Provider as individual `tfe_variable` resources.

```
$ tfvar-to-tfevar .
resource "tfe_variable" "availability_zone_names" {
key = "availability_zone_names"
value = <