Skip to content

Commit

Permalink
Merge pull request #165 from MitocGroup/dev
Browse files Browse the repository at this point in the history
Fixed json null object and added missing dependency
  • Loading branch information
euliancom authored Dec 30, 2019
2 parents 74a190c + 133c369 commit eb18cf7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To get started, simply include `main.tf` into your terraform codebase:
```hcl
module "landing_zone" {
source = "MitocGroup/landing-zone/aws"
version = "0.2.3"
version = "0.2.4"
landing_zone_providers = var.landing_zone_providers
landing_zone_components = var.landing_zone_components
terraform_backend = var.terraform_backend
Expand Down
5 changes: 4 additions & 1 deletion modules/landing_zone/data.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
data "local_file" "landing_zone_output_file" {
depends_on = [null_resource.landing_zone_apply]
depends_on = [
null_resource.terraform_output,
null_resource.landing_zone_apply
]
filename = pathexpand(var.terraform_output_path)
}
2 changes: 2 additions & 0 deletions modules/landing_zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ resource "null_resource" "terraform_output" {

resource "null_resource" "terraform_config" {
depends_on = [null_resource.terraform_output]
count = length(var.landing_zone_components) == 0 ? 0 : 1

triggers = {
config = var.terraform_config
sample = ".terrahub.yml.sample"
Expand Down
2 changes: 1 addition & 1 deletion modules/landing_zone/output.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
output "landing_zone" {
depends_on = [data.local_file.landing_zone_output_file]
sensitive = true
value = data.local_file.landing_zone_output_file.content == "" ? jsondecode("\"null\":{\"default\":[\"null\"]}") : jsondecode(data.local_file.landing_zone_output_file.content)
value = data.local_file.landing_zone_output_file.content == "" ? jsondecode("{\"null\":{\"default\":[\"null\"]}}") : jsondecode(data.local_file.landing_zone_output_file.content)
description = "The map of all output variables from components."
}
2 changes: 1 addition & 1 deletion modules/landing_zone/terraform.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
backend "local" {
path = "/tmp/.terrahub/local_backend/terraform-aws-landing_zone/landing_zone/terraform.tfstate"
path = "/tmp/.terrahub/local_backend/terraform-aws-landing-zone/landing_zone/terraform.tfstate"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "terraform-aws-landing-zone",
"version": "0.2.3",
"version": "0.2.4",
"author": "Mitoc Group Team",
"license": "MPL-2.0",
"private": true,
Expand Down

0 comments on commit eb18cf7

Please sign in to comment.