Skip to content

Commit

Permalink
mock output tests
Browse files Browse the repository at this point in the history
  • Loading branch information
denis256 committed Nov 10, 2022
1 parent a5f09da commit 6768e05
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
11 changes: 11 additions & 0 deletions module-mock-output/app1/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "content" {
}

resource "local_file" "file" {
content = "file: ${var.content}"
filename = "file.txt"
}

output "file" {
value = local_file.file.filename
}
12 changes: 12 additions & 0 deletions module-mock-output/app1/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dependency app2 {
config_path = "${path_relative_from_include()}/../app2"

mock_outputs = {
file = "test.txt"
}
mock_outputs_allowed_terraform_commands = ["validate"]
}

inputs = {
content = dependency.app2.outputs.file
}
11 changes: 11 additions & 0 deletions module-mock-output/app2/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "content" {
}

resource "local_file" "content" {
content = "Pass file: ${var.content}"
filename = "content.txt"
}

output "file" {
value = local_file.content.filename
}
3 changes: 3 additions & 0 deletions module-mock-output/app2/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
inputs = {
content = "test"
}

0 comments on commit 6768e05

Please sign in to comment.