-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
34 lines (29 loc) · 777 Bytes
/
main.tf
File metadata and controls
34 lines (29 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
terraform {
required_providers {
null = {
source = "hashicorp/null"
version = "3.1.1"
}
}
}
provider "null" {
# Configuration options
}
/* a list of local variables */
locals {
jones = ["indy", "henry", "marian", "steve"]
}
/* The null_resource implements the standard resource lifecycle but takes no more action */
resource "null_resource" "jones" {
for_each = toset(local.jones)
/* triggers allows specifying a random set of values that when
changed will cause the resource to be replaced */
triggers = {
name = each.value // a special variable, "each" created by terraform
// the object has "each.key" and "each.value"
}
}
/* We want these outputs */
output "jones" {
value = null_resource.jones
}