@@ -182,31 +182,24 @@ func ResourceService() *schema.Resource {
182
182
Optional : true ,
183
183
Elem : & schema.Resource {
184
184
Schema : map [string ]* schema.Schema {
185
- "elb_name" : {
186
- Type : schema .TypeString ,
187
- Optional : true ,
188
- ForceNew : true ,
189
- },
190
-
191
- "target_group_arn" : {
192
- Type : schema .TypeString ,
193
- Optional : true ,
194
- ForceNew : true ,
195
- ValidateFunc : verify .ValidARN ,
196
- },
197
-
198
185
"container_name" : {
199
186
Type : schema .TypeString ,
200
187
Required : true ,
201
- ForceNew : true ,
202
188
},
203
-
204
189
"container_port" : {
205
190
Type : schema .TypeInt ,
206
191
Required : true ,
207
- ForceNew : true ,
208
192
ValidateFunc : validation .IntBetween (0 , 65536 ),
209
193
},
194
+ "elb_name" : {
195
+ Type : schema .TypeString ,
196
+ Optional : true ,
197
+ },
198
+ "target_group_arn" : {
199
+ Type : schema .TypeString ,
200
+ Optional : true ,
201
+ ValidateFunc : verify .ValidARN ,
202
+ },
210
203
},
211
204
},
212
205
Set : resourceLoadBalancerHash ,
@@ -222,6 +215,11 @@ func ResourceService() *schema.Resource {
222
215
MaxItems : 1 ,
223
216
Elem : & schema.Resource {
224
217
Schema : map [string ]* schema.Schema {
218
+ "assign_public_ip" : {
219
+ Type : schema .TypeBool ,
220
+ Optional : true ,
221
+ Default : false ,
222
+ },
225
223
"security_groups" : {
226
224
Type : schema .TypeSet ,
227
225
Optional : true ,
@@ -234,11 +232,6 @@ func ResourceService() *schema.Resource {
234
232
Elem : & schema.Schema {Type : schema .TypeString },
235
233
Set : schema .HashString ,
236
234
},
237
- "assign_public_ip" : {
238
- Type : schema .TypeBool ,
239
- Optional : true ,
240
- Default : false ,
241
- },
242
235
},
243
236
},
244
237
},
@@ -248,11 +241,6 @@ func ResourceService() *schema.Resource {
248
241
MaxItems : 5 ,
249
242
Elem : & schema.Resource {
250
243
Schema : map [string ]* schema.Schema {
251
- "type" : {
252
- Type : schema .TypeString ,
253
- Required : true ,
254
- ValidateFunc : validation .StringInSlice (ecs .PlacementStrategyType_Values (), false ),
255
- },
256
244
"field" : {
257
245
Type : schema .TypeString ,
258
246
Optional : true ,
@@ -267,6 +255,11 @@ func ResourceService() *schema.Resource {
267
255
return strings .EqualFold (old , new )
268
256
},
269
257
},
258
+ "type" : {
259
+ Type : schema .TypeString ,
260
+ Required : true ,
261
+ ValidateFunc : validation .StringInSlice (ecs .PlacementStrategyType_Values (), false ),
262
+ },
270
263
},
271
264
},
272
265
},
@@ -319,24 +312,20 @@ func ResourceService() *schema.Resource {
319
312
Schema : map [string ]* schema.Schema {
320
313
"container_name" : {
321
314
Type : schema .TypeString ,
322
- ForceNew : true ,
323
315
Optional : true ,
324
316
},
325
317
"container_port" : {
326
318
Type : schema .TypeInt ,
327
- ForceNew : true ,
328
319
Optional : true ,
329
320
ValidateFunc : validation .IntBetween (0 , 65536 ),
330
321
},
331
322
"port" : {
332
323
Type : schema .TypeInt ,
333
- ForceNew : true ,
334
324
Optional : true ,
335
325
ValidateFunc : validation .IntBetween (0 , 65536 ),
336
326
},
337
327
"registry_arn" : {
338
328
Type : schema .TypeString ,
339
- ForceNew : true ,
340
329
Required : true ,
341
330
ValidateFunc : verify .ValidARN ,
342
331
},
@@ -1081,7 +1070,9 @@ func resourceServiceUpdate(d *schema.ResourceData, meta interface{}) error {
1081
1070
}
1082
1071
1083
1072
if d .HasChange ("load_balancer" ) {
1084
- input .LoadBalancers = expandLoadBalancers (d .Get ("load_balancer" ).([]interface {}))
1073
+ if v , ok := d .Get ("load_balancer" ).(* schema.Set ); ok && v != nil {
1074
+ input .LoadBalancers = expandLoadBalancers (v .List ())
1075
+ }
1085
1076
}
1086
1077
1087
1078
if d .HasChange ("propagate_tags" ) {
0 commit comments