-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstate_tasks.hcl
84 lines (67 loc) · 1.81 KB
/
state_tasks.hcl
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
resource "task" "viewing_state" {
prerequisites = [
resource.chapter.providers
]
config {
user = "root"
target = resource.container.ubuntu
}
condition "show_command" {
description = "The Terraform state is viewed"
setup {
script = "scripts/state/viewing_state/setup"
}
check {
script = "scripts/state/viewing_state/show_command"
failure_message = "The terraform show command was not used to view the state"
}
solve {
script = "scripts/state/viewing_state/solve"
}
}
condition "json_flag" {
description = "The state is in a machine-readable format"
check {
script = "scripts/state/viewing_state/json_flag"
failure_message = "The terraform state was not viewed in a machine-readable format such as JSON"
}
}
}
resource "task" "list_state" {
prerequisites = [
resource.task.viewing_state
]
config {
user = "root"
target = resource.container.ubuntu
}
condition "list_command" {
description = "The state for all resources is listed"
check {
script = "scripts/state/list_state/list_command"
failure_message = "The terraform state list command was not used"
}
solve {
script = "scripts/state/list_state/solve"
}
}
}
resource "task" "show_state" {
prerequisites = [
resource.task.list_state
]
config {
user = "root"
target = resource.container.ubuntu
}
condition "show_command" {
description = "The state of the Vault Docker container was shown"
check {
script = "scripts/state/show_state/show_command"
failure_message = "The terraform state show command was not used to view the state for docker_container.vault"
}
solve {
script = "scripts/state/show_state/solve"
}
}
}