Skip to content

Commit 286afbf

Browse files
authored
test: added variable values directly in the example main file (#354)
1 parent 5bef836 commit 286afbf

File tree

2 files changed

+42
-78
lines changed

2 files changed

+42
-78
lines changed

examples/complete/main.tf

+42-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,48 @@ module "event_streams" {
1818
source = "../../"
1919
resource_group_id = module.resource_group.resource_group_id
2020
es_name = "${var.prefix}-es"
21-
schemas = var.schemas
22-
tags = var.resource_tags
23-
access_tags = var.access_tags
24-
topics = var.topics
25-
metrics = []
26-
quotas = []
21+
schemas = [
22+
{
23+
schema_id = "my-es-schema_1"
24+
schema = {
25+
type = "string"
26+
name = "name_1"
27+
}
28+
},
29+
{
30+
schema_id = "my-es-schema_2"
31+
schema = {
32+
type = "string"
33+
name = "name_2"
34+
}
35+
}
36+
]
37+
tags = var.resource_tags
38+
access_tags = var.access_tags
39+
topics = [
40+
{
41+
name = "topic-1"
42+
partitions = 1
43+
config = {
44+
"cleanup.policy" = "delete"
45+
"retention.ms" = "86400000"
46+
"retention.bytes" = "10485760"
47+
"segment.bytes" = "10485760"
48+
}
49+
},
50+
{
51+
name = "topic-2"
52+
partitions = 1
53+
config = {
54+
"cleanup.policy" = "compact,delete"
55+
"retention.ms" = "86400000"
56+
"retention.bytes" = "1073741824"
57+
"segment.bytes" = "536870912"
58+
}
59+
}
60+
]
61+
metrics = []
62+
quotas = []
2763
service_credential_names = {
2864
"es_writer" : "Writer",
2965
"es_reader" : "Reader",

examples/complete/variables.tf

-72
Original file line numberDiff line numberDiff line change
@@ -33,75 +33,3 @@ variable "access_tags" {
3333
description = "The list of access tags associated with the Event Steams instance."
3434
default = []
3535
}
36-
37-
variable "schemas" {
38-
type = list(object(
39-
{
40-
schema_id = string
41-
schema = object({
42-
type = string
43-
name = string
44-
fields = optional(list(object({
45-
name = string
46-
type = string
47-
})))
48-
})
49-
}
50-
))
51-
description = "The list of schema objects. Includes the `schema_id` and the `type` and `name` of the schema in the `schema` object."
52-
default = [{
53-
schema_id = "my-es-schema_1"
54-
schema = {
55-
type = "string"
56-
name = "name_1"
57-
}
58-
},
59-
{
60-
schema_id = "my-es-schema_2"
61-
schema = {
62-
type = "string"
63-
name = "name_2"
64-
}
65-
},
66-
{
67-
schema_id = "my-es-schema_3"
68-
schema = {
69-
type = "string"
70-
name = "name_3"
71-
}
72-
}
73-
]
74-
}
75-
76-
variable "topics" {
77-
type = list(object(
78-
{
79-
name = string
80-
partitions = number
81-
config = map(string)
82-
}
83-
))
84-
description = "The list of topics to apply to resources. Only one topic is allowed for Lite plan instances."
85-
default = [
86-
{
87-
name = "topic-1"
88-
partitions = 1
89-
config = {
90-
"cleanup.policy" = "delete"
91-
"retention.ms" = "86400000"
92-
"retention.bytes" = "10485760"
93-
"segment.bytes" = "10485760"
94-
}
95-
},
96-
{
97-
name = "topic-2"
98-
partitions = 1
99-
config = {
100-
"cleanup.policy" = "compact,delete"
101-
"retention.ms" = "86400000"
102-
"retention.bytes" = "1073741824"
103-
"segment.bytes" = "536870912"
104-
}
105-
}
106-
]
107-
}

0 commit comments

Comments
 (0)