Skip to content

Commit 2713cd1

Browse files
committed
Add name var to example; randomly name in fixture
1 parent 1541a67 commit 2713cd1

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

examples/automatic_labelling/main.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
resource "random_pet" "main" {
18-
separator = "-"
19-
}
20-
2117
module "event_function" {
2218
source = "../../"
2319

@@ -41,7 +37,7 @@ module "event_function" {
4137
)
4238
}"
4339

44-
name = "${random_pet.main.id}"
40+
name = "${var.name}"
4541
project_id = "${var.project_id}"
4642
region = "${var.region}"
4743
}

examples/automatic_labelling/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
* limitations under the License.
1515
*/
1616

17+
variable "name" {
18+
type = "string"
19+
description = "The name to apply to any nameable resources."
20+
}
21+
1722
variable "project_id" {
1823
type = "string"
1924
description = "The ID of the project to which resources will be applied."

test/fixtures/automatic_labelling/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,15 @@ provider "null" {
3030
version = "~> 1.0"
3131
}
3232

33+
resource "random_pet" "main" {
34+
separator = "-"
35+
}
36+
3337
module "automatic_labelling" {
3438
source = "../../../examples/automatic_labelling"
3539

3640
project_id = "${var.project_id}"
41+
name = "automatic-labelling-${random_pet.main.id}"
3742
region = "${var.region}"
3843
}
3944

0 commit comments

Comments
 (0)