-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from mdb/protect-against-no-outputs
Protect against error scenarios
- Loading branch information
Showing
15 changed files
with
156 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
dist | ||
testdata/terraform.tfstate.backup | ||
testdata/**/terraform.tfstate.backup | ||
testdata/**/.terraform* | ||
testdata/**/greeting.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# testdata | ||
|
||
The `testdata/terraform.tfstate` and `testdata/show.json` files in this directory are generated | ||
from the `testdata/main.tf` Terraform configuration via `make tfstate`. The `testdata/show.json` | ||
file is used by `terraputs`'s tests. | ||
The `testdata/**/terraform.tfstate` and `testdata/**/show.json` files in this directory are generated | ||
from the `testdata/**/main.tf` Terraform configuration via `make tfstate`. The `testdata/**/show.json` | ||
files are used by `terraputs`'s tests. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"format_version":"0.2","terraform_version":"1.0.1","values":{"outputs":{"a_basic_map":{"sensitive":false,"value":{"foo":"bar","number":42}},"a_list":{"sensitive":false,"value":["foo","bar"]},"a_nested_map":{"sensitive":false,"value":{"baz":{"bar":"baz","id":"123"},"foo":"bar","number":42}},"a_sensitive_value":{"sensitive":true,"value":"foo"},"a_string":{"sensitive":false,"value":"foo"}},"root_module":{}}} | ||
{"format_version":"0.2","terraform_version":"1.0.5","values":{"outputs":{"a_basic_map":{"sensitive":false,"value":{"foo":"bar","number":42}},"a_list":{"sensitive":false,"value":["foo","bar"]},"a_nested_map":{"sensitive":false,"value":{"baz":{"bar":"baz","id":"123"},"foo":"bar","number":42}},"a_sensitive_value":{"sensitive":true,"value":"foo"},"a_string":{"sensitive":false,"value":"foo"}},"root_module":{}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This is a sample Terraform configuration | ||
# used in terraputs tests. | ||
# | ||
# 'make testdata' offers a convenience make | ||
# target to generate terraform.tfstate and | ||
# show.json state state files from this | ||
# configuration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"format_version":"0.2"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"version": 4, | ||
"terraform_version": "1.0.5", | ||
"serial": 1, | ||
"lineage": "b270cd61-d9a3-aebf-af74-45d022a1efb0", | ||
"outputs": {}, | ||
"resources": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This is a sample Terraform configuration | ||
# used in terraputs tests. | ||
# | ||
# 'make testdata' offers a convenience make | ||
# target to generate terraform.tfstate and | ||
# show.json state state files from this | ||
# configuration. | ||
|
||
data "template_file" "greeting" { | ||
template = <<-EOT | ||
${var.greeting} | ||
EOT | ||
} | ||
|
||
resource "local_file" "greeting" { | ||
content = data.template_file.greeting.rendered | ||
filename = "${path.module}/greeting.txt" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"format_version":"0.2","terraform_version":"1.0.5","values":{"root_module":{"resources":[{"address":"data.template_file.greeting","mode":"data","type":"template_file","name":"greeting","provider_name":"registry.terraform.io/hashicorp/template","schema_version":0,"values":{"filename":null,"id":"5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03","rendered":"hello\n","template":"hello\n","vars":null},"sensitive_values":{}},{"address":"local_file.greeting","mode":"managed","type":"local_file","name":"greeting","provider_name":"registry.terraform.io/hashicorp/local","schema_version":0,"values":{"content":"hello\n","content_base64":null,"directory_permission":"0777","file_permission":"0777","filename":"./greeting.txt","id":"f572d396fae9206628714fb2ce00f72e94f2258f","sensitive_content":null,"source":null},"sensitive_values":{},"depends_on":["data.template_file.greeting"]}]}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"version": 4, | ||
"terraform_version": "1.0.5", | ||
"serial": 12, | ||
"lineage": "47d01279-eabc-fe8a-3aac-7135f7545e4c", | ||
"outputs": {}, | ||
"resources": [ | ||
{ | ||
"mode": "data", | ||
"type": "template_file", | ||
"name": "greeting", | ||
"provider": "provider[\"registry.terraform.io/hashicorp/template\"]", | ||
"instances": [ | ||
{ | ||
"schema_version": 0, | ||
"attributes": { | ||
"filename": null, | ||
"id": "5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03", | ||
"rendered": "hello\n", | ||
"template": "hello\n", | ||
"vars": null | ||
}, | ||
"sensitive_attributes": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"mode": "managed", | ||
"type": "local_file", | ||
"name": "greeting", | ||
"provider": "provider[\"registry.terraform.io/hashicorp/local\"]", | ||
"instances": [ | ||
{ | ||
"schema_version": 0, | ||
"attributes": { | ||
"content": "hello\n", | ||
"content_base64": null, | ||
"directory_permission": "0777", | ||
"file_permission": "0777", | ||
"filename": "./greeting.txt", | ||
"id": "f572d396fae9206628714fb2ce00f72e94f2258f", | ||
"sensitive_content": null, | ||
"source": null | ||
}, | ||
"sensitive_attributes": [], | ||
"private": "bnVsbA==", | ||
"dependencies": [ | ||
"data.template_file.greeting" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
variable greeting { | ||
description = "the greeting to print" | ||
default = "hello" | ||
} |