Skip to content

Releases: cloudposse/terraform-yaml-config

v1.0.2

18 Oct 17:22
dfdbd38
Compare
Choose a tag to compare
git.io->cloudposse.tools update @dylanbannon (#21)

what and why

Change all references to git.io/build-harness into cloudposse.tools/build-harness, since git.io redirects will stop working on April 29th, 2022.

References

  • DEV-143

🚀 Enhancements

Use cloudposse/template provider @nitrocode (#25)

what

  • Use cloudposse/template provider

why

  • The new cloudposse/template provider has a darwin arm binary for M1 laptops

references

v1.0.1

22 Apr 16:05
7a1e756
Compare
Choose a tag to compare

🚀 Enhancements

expose `append_list_enabled` and `deep_copy_list_enabled` to root module @Benbentwo (#20)

what

  • expose append_list_enabled and deep_copy_list_enabled to root module

why

  • allows variables to be passed through

v1.0.0

21 Apr 21:10
98287f8
Compare
Choose a tag to compare
Use Cloud Posse's Utils provider to deep merge @Benbentwo (#19)

what

  • Uses Cloudposse Utils Provider to allow deepmerges

why

  • Need a way to merge with merging lists (exposed via append_list variable)

v0.8.1

26 Aug 11:14
7b174de
Compare
Choose a tag to compare

🚀 Enhancements

Chore: update files affected by `make github/init` @korenyoni (#14)

what

  • Update files affected by make github/init.

why

  • This updates important files relating to GitHub Actions: CODEOWNERS, workflow files, release-drafter configuration.

references

0.8.0 Update `context.tf` to `null-label:0.25.0` in order to support `tenant` label.

24 Aug 15:49
e546dcd
Compare
Choose a tag to compare

what

  • Update context.tf to null-label:0.25.0 in order to support tenant label.

why

  • The auto-context workflow is not functioning properly.
  • The context.tf of null-label:0.25.0 is required in a stack configuration that uses the tenant label.

references

0.7.0 Regenerate max depth for `deepmerge` submodule. Add `deepmerge-generate` submodule. Remove README from submodules

19 Jan 18:57
fee0e0e
Compare
Choose a tag to compare

what

  • Regenerate max depth for deepmerge submodule
  • Add deepmerge-generate submodule
  • Remove README from submodules not supposed to be used separately from the main module

why

  • Make deep merging much faster (we don't need map depth of 100, and can easily regenerate it by using deepmerge-generate submodule)
  • Use deepmerge-generate submodule to regenerate the max depth for the deepmerge submodule
  • If submodules have README.md, Terraform considers them public modules and will show them in the registry

0.6.0 Use deep-merge for imports at the same level

17 Jan 19:08
0b88ac5
Compare
Choose a tag to compare

what

  • Use deep-merge for imports at the same level

why

  • When providing multiple imports at the same level, we need to deep-merge them as well in the declaration order
import:
  - imports-level-3
  - imports-level-3a
  • Don't use Terraform merge anywhere in the code since it does not do deep-merging

test

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

all_imports_list = [
  "imports-level-2.yaml",
  "imports-level-3.yaml",
  "imports-level-3a.yaml",
  "imports-level-4.yaml",
]
all_imports_map = {
  "1" = [
    "imports-level-2.yaml",
  ]
  "10" = []
  "2" = [
    "imports-level-3.yaml",
    "imports-level-3a.yaml",
  ]
  "3" = [
    "imports-level-4.yaml",
  ]
  "4" = []
  "5" = []
  "6" = []
  "7" = []
  "8" = []
  "9" = []
}
list_configs = []
map_configs = {
  "components" = {
    "helmfile" = {
      "nginx-ingress" = {
        "vars" = {
          "installed" = true
        }
      }
    }
    "terraform" = {
      "eks" = {
        "backend" = {
          "s3" = {
            "workspace_key_prefix" = "eks"
          }
        }
        "vars" = {
          "cluster_kubernetes_version" = "1.18"
        }
      }
      "vpc" = {
        "backend" = {
          "s3" = {
            "workspace_key_prefix" = "vpc"
          }
        }
        "vars" = {
          "cidr_block" = "10.102.0.0/18"
        }
      }
    }
  }
  "helmfile" = {
    "vars" = {
      "var_1" = 1
      "var_2" = 2
    }
  }
  "import" = [
    "imports-level-2",
  ]
  "terraform" = {
    "vars" = {
      "var_1" = "1_override"
      "var_2" = "2_override"
      "var_3" = "3a"
    }
  }
  "vars" = {
    "environment" = "ue2"
    "level" = 3
    "namespace" = "eg"
    "region" = "us-east-2"
    "stage" = "prod"
  }
}

0.5.0 Add `map_configs` variable

17 Jan 00:21
1afa46c
Compare
Choose a tag to compare

what

  • Add map_configs variable

why

  • map_configs variable is a list of existing configurations of map type. Deep-merging of the existing map configs takes precedence over the map configs loaded from YAML files
  • Allow deep-merging of Terraform maps without loading them from YAML files (e.g. when using stack configs from other modules, we need to deep-merge vars sections from different parts of YAML files)
  • Allow re-using the third-party deepmerge from other modules when they already use terraform-yaml-config (since Terraform does not support deep-merging natively) - and not copying the deepmerge module into every other module that need deep-merging

test

Input

map_config_paths = [
  "map-configs/*.yaml"
]

map_configs = [
  {
    key3 = {
      name  = "name3_override"
      param = "param3_override"
    },
    key4 = {
      name  = "name4"
      param = "param4"
      type  = "type4"
    },
    key5 = {
      name  = "name5"
      param = ["param5a", "param5b"]
      type  = "type5"
    }
  },
  {
    key6 = {
      name  = "name6"
      param = "param6"
      type  = "type6"
    },
    key1 = [
      {
        name  = "name1_override"
        param = "param1_override"
      }
    ]
  }
]

Output

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:


map_configs = {
  "key1" = [
    {
      "name" = "name1_override"
      "param" = "param1_override"
    },
  ]
  "key2" = [
    {
      "name" = "name2"
      "param" = "2"
      "type" = "type2"
    },
  ]
  "key3" = {
    "name" = "name3_override"
    "param" = "param3_override"
    "type" = "type3"
  }
  "key4" = {
    "name" = "name4"
    "param" = "param4"
    "type" = "type4"
  }
  "key5" = {
    "name" = "name5"
    "param" = [
      "param5a",
      "param5b",
    ]
    "type" = "type5"
  }
  "key6" = {
    "name" = "name6"
    "param" = "param6"
    "type" = "type6"
  }

0.4.0 Update `deep-merge`. Add 10 levels of imports. Update GitHub actions/workflows

12 Jan 14:51
fdd1f7d
Compare
Choose a tag to compare

what

  • Update deep-merge
  • Add 10 levels of imports
  • Update GitHub actions/workflows

why

  • Allow the module to work when only YAML configs of type list are provided (no map configs). Without this change, a list of empty maps provided to the deep-merge module caused the module to crash
  • Up 10 levels of imports required for some configurations (5 levels are not enough)
  • Update GitHub actions/workflows to the latest

0.3.0 Terraform 0.14 upgrade

05 Jan 19:03
b1639d7
Compare
Choose a tag to compare

what

  • Upgrade to support Terraform 0.14 and bring up to current Cloud Posse standard

why

  • Support Terraform 0.14