Skip to content

Commit bd82a3d

Browse files
committed
Revert changes to the examples/fixtures, concat patent_type and parent_id for the example invocation
1 parent 55fe8aa commit bd82a3d

File tree

7 files changed

+29
-11
lines changed

7 files changed

+29
-11
lines changed

examples/simple_example/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ provider "google" {
2121
module "folders" {
2222
source = "../.."
2323

24-
parent = var.parent
24+
parent = "${var.parent_type}/${var.parent_id}"
2525
names = var.names
2626
set_roles = true
2727
per_folder_admins = var.per_folder_admins

examples/simple_example/variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "parent" {
17+
variable "parent_id" {
1818
type = string
19-
description = "The resource name of the parent Folder or Organization. Must be of the form folders/folder_id or organizations/org_id"
19+
description = "Id of the resource under which the folder will be placed."
20+
}
21+
22+
variable "parent_type" {
23+
type = string
24+
description = "Type of the parent reosurce, defaults to organization."
25+
default = "folders"
2026
}
2127

2228
variable "names" {

test/fixtures/simple_example/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ provider "random" {
2121
module "example" {
2222
source = "../../../examples/simple_example"
2323

24-
parent = var.parent
24+
parent_id = var.parent_id
25+
parent_type = var.parent_type
2526
names = var.names
2627
per_folder_admins = var.per_folder_admins
2728
all_folder_admins = var.all_folder_admins

test/fixtures/simple_example/outputs.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ output "names_and_ids" {
1919
value = module.example.names_and_ids
2020
}
2121

22-
output "parent" {
23-
description = "The resource name of the parent Folder or Organization. Must be of the form folders/folder_id or organizations/org_id"
24-
value = var.parent
22+
output "parent_id" {
23+
description = "Id of the resource under which the folder will be placed."
24+
value = var.parent_id
25+
}
26+
27+
output "parent_type" {
28+
description = "Type of the parent reosurce, defaults to organization."
29+
value = var.parent_type
2530
}
2631

2732
output "names" {

test/fixtures/simple_example/variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "parent" {
17+
variable "parent_id" {
1818
type = string
19-
description = "The resource name of the parent Folder or Organization. Must be of the form folders/folder_id or organizations/org_id"
19+
description = "Id of the resource under which the folder will be placed."
20+
}
21+
22+
variable "parent_type" {
23+
type = string
24+
description = "Type of the parent reosurce, defaults to organization."
25+
default = "folders"
2026
}
2127

2228
variable "names" {

test/integration/simple_example/controls/gcloud.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
control "gcloud" do
1616
title "gcloud"
1717

18-
describe command("gcloud resource-manager folders list --folder=#{attribute("parent").split('/')[1]}") do
18+
describe command("gcloud resource-manager folders list --folder=#{attribute("parent_id")}") do
1919
its(:exit_status) { should eq 0 }
2020
its(:stderr) { should eq "" }
2121
its(:stdout) { should include "#{attribute("names")[0]}" }

test/integration/simple_example/inspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ depends:
44
git: https://github.com/inspec/inspec-gcp.git
55
tag: v0.10.0
66
attributes:
7-
- name: parent
7+
- name: parent_id
88
required: true
99
type: string
1010
- name: names

0 commit comments

Comments
 (0)