Skip to content

Commit

Permalink
Add name var to example; randomly name in fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-lane committed Feb 21, 2019
1 parent 1541a67 commit 2713cd1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 1 addition & 5 deletions examples/automatic_labelling/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
* limitations under the License.
*/

resource "random_pet" "main" {
separator = "-"
}

module "event_function" {
source = "../../"

Expand All @@ -41,7 +37,7 @@ module "event_function" {
)
}"

name = "${random_pet.main.id}"
name = "${var.name}"
project_id = "${var.project_id}"
region = "${var.region}"
}
5 changes: 5 additions & 0 deletions examples/automatic_labelling/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
* limitations under the License.
*/

variable "name" {
type = "string"
description = "The name to apply to any nameable resources."
}

variable "project_id" {
type = "string"
description = "The ID of the project to which resources will be applied."
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/automatic_labelling/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ provider "null" {
version = "~> 1.0"
}

resource "random_pet" "main" {
separator = "-"
}

module "automatic_labelling" {
source = "../../../examples/automatic_labelling"

project_id = "${var.project_id}"
name = "automatic-labelling-${random_pet.main.id}"
region = "${var.region}"
}

Expand Down

0 comments on commit 2713cd1

Please sign in to comment.