mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
Move command/ to internal/command/
This is part of a general effort to move all of Terraform's non-library package surface under internal in order to reinforce that these are for internal use within Terraform only. If you were previously importing packages under this prefix into an external codebase, you could pin to an earlier release tag as an interim solution until you've make a plan to achieve the same functionality some other way.
This commit is contained in:
36
internal/command/testdata/show-json-state/basic/output.json
vendored
Normal file
36
internal/command/testdata/show-json-state/basic/output.json
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"format_version": "0.1",
|
||||
"terraform_version": "0.12.0",
|
||||
"values": {
|
||||
"root_module": {
|
||||
"resources": [
|
||||
{
|
||||
"address": "test_instance.example[0]",
|
||||
"mode": "managed",
|
||||
"type": "test_instance",
|
||||
"name": "example",
|
||||
"index": 0,
|
||||
"provider_name": "registry.terraform.io/hashicorp/test",
|
||||
"schema_version": 0,
|
||||
"values": {
|
||||
"ami": null,
|
||||
"id": "621124146446964903"
|
||||
}
|
||||
},
|
||||
{
|
||||
"address": "test_instance.example[1]",
|
||||
"mode": "managed",
|
||||
"type": "test_instance",
|
||||
"name": "example",
|
||||
"index": 1,
|
||||
"provider_name": "registry.terraform.io/hashicorp/test",
|
||||
"schema_version": 0,
|
||||
"values": {
|
||||
"ami": null,
|
||||
"id": "4330206298367988603"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
34
internal/command/testdata/show-json-state/basic/terraform.tfstate
vendored
Normal file
34
internal/command/testdata/show-json-state/basic/terraform.tfstate
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"version": 4,
|
||||
"terraform_version": "0.12.0",
|
||||
"serial": 1,
|
||||
"lineage": "00bfda35-ad61-ec8d-c013-14b0320bc416",
|
||||
"outputs": {},
|
||||
"resources": [
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "test_instance",
|
||||
"name": "example",
|
||||
"each": "list",
|
||||
"provider": "provider[\"registry.terraform.io/hashicorp/test\"]",
|
||||
"instances": [
|
||||
{
|
||||
"index_key": 0,
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "621124146446964903"
|
||||
},
|
||||
"private": "bnVsbA=="
|
||||
},
|
||||
{
|
||||
"index_key": 1,
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "4330206298367988603"
|
||||
},
|
||||
"private": "bnVsbA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
3
internal/command/testdata/show-json-state/empty/output.json
vendored
Normal file
3
internal/command/testdata/show-json-state/empty/output.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"format_version": "0.1"
|
||||
}
|
||||
11
internal/command/testdata/show-json-state/modules/bar/main.tf
vendored
Normal file
11
internal/command/testdata/show-json-state/modules/bar/main.tf
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
variable "test_var" {
|
||||
default = "bar-var"
|
||||
}
|
||||
|
||||
output "test" {
|
||||
value = var.test_var
|
||||
}
|
||||
|
||||
resource "test_instance" "test" {
|
||||
ami = var.test_var
|
||||
}
|
||||
14
internal/command/testdata/show-json-state/modules/foo/main.tf
vendored
Normal file
14
internal/command/testdata/show-json-state/modules/foo/main.tf
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
variable "test_var" {
|
||||
default = "foo-var"
|
||||
}
|
||||
|
||||
resource "test_instance" "test" {
|
||||
ami = var.test_var
|
||||
count = 1
|
||||
}
|
||||
|
||||
output "test" {
|
||||
value = var.test_var
|
||||
}
|
||||
|
||||
provider "test" {}
|
||||
13
internal/command/testdata/show-json-state/modules/main.tf
vendored
Normal file
13
internal/command/testdata/show-json-state/modules/main.tf
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
module "module_test_foo" {
|
||||
source = "./foo"
|
||||
test_var = "baz"
|
||||
}
|
||||
|
||||
module "module_test_bar" {
|
||||
source = "./bar"
|
||||
}
|
||||
|
||||
output "test" {
|
||||
value = module.module_test_foo.test
|
||||
depends_on = [module.module_test_foo]
|
||||
}
|
||||
51
internal/command/testdata/show-json-state/modules/output.json
vendored
Normal file
51
internal/command/testdata/show-json-state/modules/output.json
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"format_version": "0.1",
|
||||
"terraform_version": "0.12.0",
|
||||
"values": {
|
||||
"outputs": {
|
||||
"test": {
|
||||
"sensitive": false,
|
||||
"value": "baz"
|
||||
}
|
||||
},
|
||||
"root_module": {
|
||||
"child_modules": [
|
||||
{
|
||||
"resources": [
|
||||
{
|
||||
"address": "module.module_test_bar.test_instance.example",
|
||||
"mode": "managed",
|
||||
"type": "test_instance",
|
||||
"name": "example",
|
||||
"provider_name": "registry.terraform.io/hashicorp/test",
|
||||
"schema_version": 0,
|
||||
"values": {
|
||||
"ami": "bar-var",
|
||||
"id": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"address": "module.module_test_bar"
|
||||
},
|
||||
{
|
||||
"resources": [
|
||||
{
|
||||
"address": "module.module_test_foo.test_instance.example[0]",
|
||||
"mode": "managed",
|
||||
"type": "test_instance",
|
||||
"name": "example",
|
||||
"index": 0,
|
||||
"provider_name": "registry.terraform.io/hashicorp/test",
|
||||
"schema_version": 0,
|
||||
"values": {
|
||||
"ami": "foo-var",
|
||||
"id": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"address": "module.module_test_foo"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
48
internal/command/testdata/show-json-state/modules/terraform.tfstate
vendored
Normal file
48
internal/command/testdata/show-json-state/modules/terraform.tfstate
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"version": 4,
|
||||
"terraform_version": "0.12.0",
|
||||
"serial": 8,
|
||||
"lineage": "00bfda35-ad61-ec8d-c013-14b0320bc416",
|
||||
"outputs": {
|
||||
"test": {
|
||||
"value": "baz",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"module": "module.module_test_foo",
|
||||
"mode": "managed",
|
||||
"type": "test_instance",
|
||||
"name": "example",
|
||||
"each": "list",
|
||||
"provider": "provider[\"registry.terraform.io/hashicorp/test\"]",
|
||||
"instances": [
|
||||
{
|
||||
"index_key": 0,
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"ami": "foo-var"
|
||||
},
|
||||
"private": "bnVsbA=="
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"module": "module.module_test_bar",
|
||||
"mode": "managed",
|
||||
"type": "test_instance",
|
||||
"name": "example",
|
||||
"provider": "provider[\"registry.terraform.io/hashicorp/test\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"ami": "bar-var"
|
||||
},
|
||||
"private": "bnVsbA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
22
internal/command/testdata/show-json-state/sensitive-variables/output.json
vendored
Normal file
22
internal/command/testdata/show-json-state/sensitive-variables/output.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"format_version": "0.1",
|
||||
"terraform_version": "0.14.0",
|
||||
"values": {
|
||||
"root_module": {
|
||||
"resources": [
|
||||
{
|
||||
"address": "test_instance.test",
|
||||
"mode": "managed",
|
||||
"type": "test_instance",
|
||||
"name": "test",
|
||||
"provider_name": "registry.terraform.io/hashicorp/test",
|
||||
"schema_version": 0,
|
||||
"values": {
|
||||
"id": "621124146446964903",
|
||||
"ami": "abc"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
33
internal/command/testdata/show-json-state/sensitive-variables/terraform.tfstate
vendored
Normal file
33
internal/command/testdata/show-json-state/sensitive-variables/terraform.tfstate
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"version": 4,
|
||||
"terraform_version": "0.14.0",
|
||||
"serial": 1,
|
||||
"lineage": "d7a6880b-6875-288f-13a9-696a65c73036",
|
||||
"outputs": {},
|
||||
"resources": [
|
||||
{
|
||||
"mode": "managed",
|
||||
"type": "test_instance",
|
||||
"name": "test",
|
||||
"provider": "provider[\"registry.terraform.io/hashicorp/test\"]",
|
||||
"instances": [
|
||||
{
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"id": "621124146446964903",
|
||||
"ami": "abc"
|
||||
},
|
||||
"sensitive_attributes": [
|
||||
[
|
||||
{
|
||||
"type": "get_attr",
|
||||
"value": "ami"
|
||||
}
|
||||
]
|
||||
],
|
||||
"private": "bnVsbA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user