-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
66 lines (60 loc) · 1.67 KB
/
main.tf
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
terraform {
required_providers {
scalr = {
source = "registry.scalr.dev/scalr/scalr"
version = "1.0.0-rc-develop"
}
}
}
variable "account_id" {
type = string
default = "acc-svrcncgh453bi8g"
}
resource "scalr_environment" "pre_init_hook_test" {
name = "hook-test"
account_id = var.account_id
cost_estimation_enabled = false
}
data "scalr_vcs_provider" "test" {
name = "hook_test"
account_id = var.account_id
}
resource "scalr_workspace" "hook_generates_tf" {
name = "hook_with_tf"
environment_id = scalr_environment.pre_init_hook_test.id
auto_apply = true
vcs_provider_id = data.scalr_vcs_provider.test.id
working_directory = "workspace_source"
hooks {
pre_init = "chmod +x create_tf.sh && ./create_tf.sh"
}
vcs_repo {
identifier = "DayS1eeper/pre-init-hook-test"
branch = "master"
}
}
resource "scalr_workspace" "hook_noop" {
name = "hook_without_tf"
environment_id = scalr_environment.pre_init_hook_test.id
auto_apply = true
vcs_provider_id = data.scalr_vcs_provider.test.id
working_directory = "workspace_source"
hooks {
pre_init = "chmod +x echo.sh && ./echo.sh"
}
vcs_repo {
identifier = "DayS1eeper/pre-init-hook-test"
branch = "master"
}
}
resource "scalr_workspace" "without_hook" {
name = "no_hooks"
environment_id = scalr_environment.pre_init_hook_test.id
auto_apply = true
vcs_provider_id = data.scalr_vcs_provider.test.id
working_directory = "workspace_source"
vcs_repo {
identifier = "DayS1eeper/pre-init-hook-test"
branch = "master"
}
}