-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
81 lines (69 loc) · 1.53 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
terraform {
required_providers {
config = {
version = "0.2.8"
source = "alabuel/config"
}
}
}
provider "config" {}
data "config_workbook" "excel" {
excel = "files/data.xlsx"
worksheet = "Config"
headers = ["config_name","data2","data3"]
}
data "config_workbook" "vexcel" {
excel = "files/data.xlsx"
worksheet = "Sheet1"
orientation = "vertical"
configuration_item = "my_vertical"
}
data "config_workbook" "vert" {
excel = "files/event.xlsx"
password = "1234"
worksheet = "event_target"
orientation = "vertical"
configuration_item = "event_target"
}
data "config_workbook" "lookup" {
excel = "files/event.xlsx"
password = "1234"
worksheet = "cloudwatch_event_rule"
configuration_item = "cloudwatch_event_rule"
lookup {
excel = "files/event.xlsx"
password = "1234"
worksheet = "event_target"
column = "command"
key_column = "name"
value_column = "script"
}
lookup {
ini = file("files/event.ini")
section = "event"
column = "dependents"
key_column = "name"
value_column = "script"
}
}
data "config_ini" "ini" {
ini = file("files/event.ini")
}
data "config_workbook" "csv" {
csv = file("files/test.csv")
schema = file("files/config.yaml")
filter {
name = "name"
values = ["item_name1"]
}
}
data "config_workbook" "vm" {
csv = file("files/deployVM.csv")
configuration_item = "virtual_machine"
}
output "lookup" {
value = jsondecode(data.config_workbook.lookup.json)
}
output "ini" {
value = jsondecode(data.config_ini.ini.json)
}