@@ -29,6 +29,25 @@ func resourceelkAliasesIndex() *schema.Resource {
29
29
Elem : & schema.Schema {Type : schema .TypeString },
30
30
Required : true ,
31
31
},
32
+ "data_stream" : {
33
+ Type : schema .TypeList ,
34
+ MaxItems : 1 ,
35
+ Optional : true ,
36
+ Elem : & schema.Resource {
37
+ Schema : map [string ]* schema.Schema {
38
+ "allow_custom_routing" : {
39
+ Type : schema .TypeBool ,
40
+ Optional : true ,
41
+ Default : false ,
42
+ },
43
+ "hidden" : {
44
+ Type : schema .TypeBool ,
45
+ Optional : true ,
46
+ Default : false ,
47
+ },
48
+ },
49
+ },
50
+ },
32
51
"template" : {
33
52
Type : schema .TypeList ,
34
53
MaxItems : 1 ,
@@ -109,6 +128,15 @@ func resourceelkAliasesIndexCreate(d *schema.ResourceData, m interface{}) error
109
128
"composed_of" : composedOf ,
110
129
}
111
130
131
+ // Convert data_stream
132
+ if value , ok := d .GetOk ("data_stream" ); ok {
133
+ content := value .([]any )[0 ].(map [string ]any )
134
+ templateBody ["data_stream" ] = map [string ]any {
135
+ "allow_custom_routing" : content ["allow_custom_routing" ],
136
+ "hidden" : content ["hidden" ],
137
+ }
138
+ }
139
+
112
140
// Convert templateBody to JSON
113
141
body , err := json .Marshal (templateBody )
114
142
if err != nil {
@@ -182,6 +210,22 @@ func resourceelkAliasesIndexRead(d *schema.ResourceData, m interface{}) error {
182
210
d .Set ("composed_of" , composedOf )
183
211
}
184
212
213
+ // Handle data_stream
214
+ if dataStream , ok := templateDetails ["data_stream" ].(map [string ]any ); ok {
215
+ dataSteamTemplate := make (map [string ]any )
216
+ if routing , ok := dataStream ["allow_custom_routing" ]; ok {
217
+ dataSteamTemplate ["allow_custom_routing" ] = routing
218
+ }
219
+
220
+ if hidden , ok := dataStream ["hidden" ]; ok {
221
+ dataSteamTemplate ["hidden" ] = hidden
222
+ }
223
+
224
+ d .Set ("data_stream" , []any {dataSteamTemplate })
225
+ } else {
226
+ d .Set ("data_stream" , nil )
227
+ }
228
+
185
229
// Extract and handle template components
186
230
if templateContent , ok := templateDetails ["template" ].(map [string ]interface {}); ok {
187
231
// Handle mappings
0 commit comments