Skip to content

Commit a847094

Browse files
committed
ci/semgrep/ecs: Remove exclusion
1 parent 1644f01 commit a847094

File tree

10 files changed

+291
-293
lines changed

10 files changed

+291
-293
lines changed

.semgrep-configs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ rules:
1717
- internal/service/configservice
1818
- internal/service/dax
1919
- internal/service/dms
20-
- internal/service/ecs
2120
- internal/service/elasticache
2221
- internal/service/kinesis
2322
- internal/service/lambda

internal/generate/servicesemgrep/configs.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ rules:
1717
- internal/service/configservice
1818
- internal/service/dax
1919
- internal/service/dms
20-
- internal/service/ecs
2120
- internal/service/elasticache
2221
- internal/service/kinesis
2322
- internal/service/lambda

internal/service/ecs/account_setting_default_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestAccECSAccountSettingDefault_containerInstanceLongARNFormat(t *testing.T
2525
CheckDestroy: testAccCheckAccountSettingDefaultDestroy,
2626
Steps: []resource.TestStep{
2727
{
28-
Config: testAccAccountSettingDefaultConfig(settingName),
28+
Config: testAccAccountSettingDefaultConfig_basic(settingName),
2929
Check: resource.ComposeTestCheckFunc(
3030
resource.TestCheckResourceAttr(resourceName, "name", settingName),
3131
resource.TestCheckResourceAttr(resourceName, "value", "enabled"),
@@ -53,7 +53,7 @@ func TestAccECSAccountSettingDefault_serviceLongARNFormat(t *testing.T) {
5353
CheckDestroy: testAccCheckAccountSettingDefaultDestroy,
5454
Steps: []resource.TestStep{
5555
{
56-
Config: testAccAccountSettingDefaultConfig(settingName),
56+
Config: testAccAccountSettingDefaultConfig_basic(settingName),
5757
Check: resource.ComposeTestCheckFunc(
5858
resource.TestCheckResourceAttr(resourceName, "name", settingName),
5959
resource.TestCheckResourceAttr(resourceName, "value", "enabled"),
@@ -81,7 +81,7 @@ func TestAccECSAccountSettingDefault_taskLongARNFormat(t *testing.T) {
8181
CheckDestroy: testAccCheckAccountSettingDefaultDestroy,
8282
Steps: []resource.TestStep{
8383
{
84-
Config: testAccAccountSettingDefaultConfig(settingName),
84+
Config: testAccAccountSettingDefaultConfig_basic(settingName),
8585
Check: resource.ComposeTestCheckFunc(
8686
resource.TestCheckResourceAttr(resourceName, "name", settingName),
8787
resource.TestCheckResourceAttr(resourceName, "value", "enabled"),
@@ -109,7 +109,7 @@ func TestAccECSAccountSettingDefault_vpcTrunking(t *testing.T) {
109109
CheckDestroy: testAccCheckAccountSettingDefaultDestroy,
110110
Steps: []resource.TestStep{
111111
{
112-
Config: testAccAccountSettingDefaultConfig(settingName),
112+
Config: testAccAccountSettingDefaultConfig_basic(settingName),
113113
Check: resource.ComposeTestCheckFunc(
114114
resource.TestCheckResourceAttr(resourceName, "name", settingName),
115115
resource.TestCheckResourceAttr(resourceName, "value", "enabled"),
@@ -137,7 +137,7 @@ func TestAccECSAccountSettingDefault_containerInsights(t *testing.T) {
137137
CheckDestroy: testAccCheckAccountSettingDefaultDestroy,
138138
Steps: []resource.TestStep{
139139
{
140-
Config: testAccAccountSettingDefaultConfig(settingName),
140+
Config: testAccAccountSettingDefaultConfig_basic(settingName),
141141
Check: resource.ComposeTestCheckFunc(
142142
resource.TestCheckResourceAttr(resourceName, "name", settingName),
143143
resource.TestCheckResourceAttr(resourceName, "value", "enabled"),
@@ -198,7 +198,7 @@ func testAccCheckAccountSettingDefaultDestroy(s *terraform.State) error {
198198
return nil
199199
}
200200

201-
func testAccAccountSettingDefaultConfig(settingName string) string {
201+
func testAccAccountSettingDefaultConfig_basic(settingName string) string {
202202
return fmt.Sprintf(`
203203
resource "aws_ecs_account_setting_default" "test" {
204204
name = %[1]q

internal/service/ecs/capacity_provider_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestAccECSCapacityProvider_basic(t *testing.T) {
2626
CheckDestroy: testAccCheckCapacityProviderDestroy,
2727
Steps: []resource.TestStep{
2828
{
29-
Config: testAccCapacityProviderConfig(rName),
29+
Config: testAccCapacityProviderConfig_basic(rName),
3030
Check: resource.ComposeTestCheckFunc(
3131
testAccCheckCapacityProviderExists(resourceName, &provider),
3232
resource.TestCheckResourceAttr(resourceName, "name", rName),
@@ -64,7 +64,7 @@ func TestAccECSCapacityProvider_disappears(t *testing.T) {
6464
CheckDestroy: testAccCheckCapacityProviderDestroy,
6565
Steps: []resource.TestStep{
6666
{
67-
Config: testAccCapacityProviderConfig(rName),
67+
Config: testAccCapacityProviderConfig_basic(rName),
6868
Check: resource.ComposeTestCheckFunc(
6969
testAccCheckCapacityProviderExists(resourceName, &provider),
7070
acctest.CheckResourceDisappears(acctest.Provider, tfecs.ResourceCapacityProvider(), resourceName),
@@ -87,7 +87,7 @@ func TestAccECSCapacityProvider_managedScaling(t *testing.T) {
8787
CheckDestroy: testAccCheckCapacityProviderDestroy,
8888
Steps: []resource.TestStep{
8989
{
90-
Config: testAccCapacityProviderManagedScalingConfig(rName, ecs.ManagedScalingStatusEnabled, 300, 10, 1, 50),
90+
Config: testAccCapacityProviderConfig_managedScaling(rName, ecs.ManagedScalingStatusEnabled, 300, 10, 1, 50),
9191
Check: resource.ComposeTestCheckFunc(
9292
testAccCheckCapacityProviderExists(resourceName, &provider),
9393
resource.TestCheckResourceAttr(resourceName, "name", rName),
@@ -107,7 +107,7 @@ func TestAccECSCapacityProvider_managedScaling(t *testing.T) {
107107
ImportStateVerify: true,
108108
},
109109
{
110-
Config: testAccCapacityProviderManagedScalingConfig(rName, ecs.ManagedScalingStatusDisabled, 400, 100, 10, 100),
110+
Config: testAccCapacityProviderConfig_managedScaling(rName, ecs.ManagedScalingStatusDisabled, 400, 100, 10, 100),
111111
Check: resource.ComposeTestCheckFunc(
112112
testAccCheckCapacityProviderExists(resourceName, &provider),
113113
resource.TestCheckResourceAttr(resourceName, "name", rName),
@@ -136,7 +136,7 @@ func TestAccECSCapacityProvider_managedScalingPartial(t *testing.T) {
136136
CheckDestroy: testAccCheckCapacityProviderDestroy,
137137
Steps: []resource.TestStep{
138138
{
139-
Config: testAccCapacityProviderManagedScalingPartialConfig(rName),
139+
Config: testAccCapacityProviderConfig_managedScalingPartial(rName),
140140
Check: resource.ComposeTestCheckFunc(
141141
testAccCheckCapacityProviderExists(resourceName, &provider),
142142
resource.TestCheckResourceAttr(resourceName, "name", rName),
@@ -171,7 +171,7 @@ func TestAccECSCapacityProvider_tags(t *testing.T) {
171171
CheckDestroy: testAccCheckCapacityProviderDestroy,
172172
Steps: []resource.TestStep{
173173
{
174-
Config: testAccCapacityProviderTags1Config(rName, "key1", "value1"),
174+
Config: testAccCapacityProviderConfig_tags1(rName, "key1", "value1"),
175175
Check: resource.ComposeTestCheckFunc(
176176
testAccCheckCapacityProviderExists(resourceName, &provider),
177177
resource.TestCheckResourceAttr(resourceName, "tags.%", "1"),
@@ -185,7 +185,7 @@ func TestAccECSCapacityProvider_tags(t *testing.T) {
185185
ImportStateVerify: true,
186186
},
187187
{
188-
Config: testAccCapacityProviderTags2Config(rName, "key1", "value1updated", "key2", "value2"),
188+
Config: testAccCapacityProviderConfig_tags2(rName, "key1", "value1updated", "key2", "value2"),
189189
Check: resource.ComposeTestCheckFunc(
190190
testAccCheckCapacityProviderExists(resourceName, &provider),
191191
resource.TestCheckResourceAttr(resourceName, "tags.%", "2"),
@@ -194,7 +194,7 @@ func TestAccECSCapacityProvider_tags(t *testing.T) {
194194
),
195195
},
196196
{
197-
Config: testAccCapacityProviderTags1Config(rName, "key2", "value2"),
197+
Config: testAccCapacityProviderConfig_tags1(rName, "key2", "value2"),
198198
Check: resource.ComposeTestCheckFunc(
199199
testAccCheckCapacityProviderExists(resourceName, &provider),
200200
resource.TestCheckResourceAttr(resourceName, "tags.%", "1"),
@@ -303,7 +303,7 @@ resource "aws_autoscaling_group" "test" {
303303
`, rName)
304304
}
305305

306-
func testAccCapacityProviderConfig(rName string) string {
306+
func testAccCapacityProviderConfig_basic(rName string) string {
307307
return testAccCapacityProviderBaseConfig(rName) + fmt.Sprintf(`
308308
resource "aws_ecs_capacity_provider" "test" {
309309
name = %q
@@ -315,7 +315,7 @@ resource "aws_ecs_capacity_provider" "test" {
315315
`, rName)
316316
}
317317

318-
func testAccCapacityProviderManagedScalingConfig(rName, status string, warmup, max, min, cap int) string {
318+
func testAccCapacityProviderConfig_managedScaling(rName, status string, warmup, max, min, cap int) string {
319319
return testAccCapacityProviderBaseConfig(rName) + fmt.Sprintf(`
320320
resource "aws_ecs_capacity_provider" "test" {
321321
name = %[1]q
@@ -335,7 +335,7 @@ resource "aws_ecs_capacity_provider" "test" {
335335
`, rName, warmup, max, min, status, cap)
336336
}
337337

338-
func testAccCapacityProviderManagedScalingPartialConfig(rName string) string {
338+
func testAccCapacityProviderConfig_managedScalingPartial(rName string) string {
339339
return testAccCapacityProviderBaseConfig(rName) + fmt.Sprintf(`
340340
resource "aws_ecs_capacity_provider" "test" {
341341
name = %[1]q
@@ -352,7 +352,7 @@ resource "aws_ecs_capacity_provider" "test" {
352352
`, rName)
353353
}
354354

355-
func testAccCapacityProviderTags1Config(rName, tag1Key, tag1Value string) string {
355+
func testAccCapacityProviderConfig_tags1(rName, tag1Key, tag1Value string) string {
356356
return testAccCapacityProviderBaseConfig(rName) + fmt.Sprintf(`
357357
resource "aws_ecs_capacity_provider" "test" {
358358
name = %[1]q
@@ -368,7 +368,7 @@ resource "aws_ecs_capacity_provider" "test" {
368368
`, rName, tag1Key, tag1Value)
369369
}
370370

371-
func testAccCapacityProviderTags2Config(rName, tag1Key, tag1Value, tag2Key, tag2Value string) string {
371+
func testAccCapacityProviderConfig_tags2(rName, tag1Key, tag1Value, tag2Key, tag2Value string) string {
372372
return testAccCapacityProviderBaseConfig(rName) + fmt.Sprintf(`
373373
resource "aws_ecs_capacity_provider" "test" {
374374
name = %[1]q

internal/service/ecs/cluster_capacity_providers_test.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestAccECSClusterCapacityProviders_basic(t *testing.T) {
2525
CheckDestroy: testAccCheckClusterDestroy,
2626
Steps: []resource.TestStep{
2727
{
28-
Config: testAccClusterCapacityProvidersConfig(rName),
28+
Config: testAccClusterCapacityProvidersConfig_basic(rName),
2929
Check: resource.ComposeTestCheckFunc(
3030
testAccCheckClusterExists("aws_ecs_cluster.test", &cluster),
3131
resource.TestCheckResourceAttr(resourceName, "capacity_providers.#", "1"),
@@ -60,7 +60,7 @@ func TestAccECSClusterCapacityProviders_disappears(t *testing.T) {
6060
CheckDestroy: testAccCheckClusterDestroy,
6161
Steps: []resource.TestStep{
6262
{
63-
Config: testAccClusterCapacityProvidersConfig(rName),
63+
Config: testAccClusterCapacityProvidersConfig_basic(rName),
6464
Check: resource.ComposeTestCheckFunc(
6565
testAccCheckClusterExists("aws_ecs_cluster.test", &cluster),
6666
acctest.CheckResourceDisappears(acctest.Provider, tfecs.ResourceCluster(), resourceName),
@@ -117,7 +117,7 @@ func TestAccECSClusterCapacityProviders_destroy(t *testing.T) {
117117
CheckDestroy: testAccCheckClusterDestroy,
118118
Steps: []resource.TestStep{
119119
{
120-
Config: testAccClusterCapacityProvidersConfig_destroy_before(rName),
120+
Config: testAccClusterCapacityProvidersConfig_destroyBefore(rName),
121121
Check: resource.ComposeTestCheckFunc(
122122
testAccCheckClusterExists("aws_ecs_cluster.test", &cluster),
123123
func(s *terraform.State) error {
@@ -130,7 +130,7 @@ func TestAccECSClusterCapacityProviders_destroy(t *testing.T) {
130130
),
131131
},
132132
{
133-
Config: testAccClusterCapacityProvidersConfig_destroy_after(rName),
133+
Config: testAccClusterCapacityProvidersConfig_destroyAfter(rName),
134134
},
135135
},
136136
})
@@ -148,7 +148,7 @@ func TestAccECSClusterCapacityProviders_Update_capacityProviders(t *testing.T) {
148148
CheckDestroy: testAccCheckClusterDestroy,
149149
Steps: []resource.TestStep{
150150
{
151-
Config: testAccClusterCapacityProvidersConfig_withCapacityProviders1(rName, "FARGATE"),
151+
Config: testAccClusterCapacityProvidersConfig_1(rName, "FARGATE"),
152152
Check: resource.ComposeTestCheckFunc(
153153
testAccCheckClusterExists("aws_ecs_cluster.test", &cluster),
154154
resource.TestCheckResourceAttr(resourceName, "capacity_providers.#", "1"),
@@ -161,7 +161,7 @@ func TestAccECSClusterCapacityProviders_Update_capacityProviders(t *testing.T) {
161161
ImportStateVerify: true,
162162
},
163163
{
164-
Config: testAccClusterCapacityProvidersConfig_withCapacityProviders2(rName, "FARGATE", "FARGATE_SPOT"),
164+
Config: testAccClusterCapacityProvidersConfig_2(rName, "FARGATE", "FARGATE_SPOT"),
165165
Check: resource.ComposeTestCheckFunc(
166166
testAccCheckClusterExists("aws_ecs_cluster.test", &cluster),
167167
resource.TestCheckResourceAttr(resourceName, "capacity_providers.#", "2"),
@@ -175,7 +175,7 @@ func TestAccECSClusterCapacityProviders_Update_capacityProviders(t *testing.T) {
175175
ImportStateVerify: true,
176176
},
177177
{
178-
Config: testAccClusterCapacityProvidersConfig_withCapacityProviders0(rName),
178+
Config: testAccClusterCapacityProvidersConfig_0(rName),
179179
Check: resource.ComposeTestCheckFunc(
180180
testAccCheckClusterExists("aws_ecs_cluster.test", &cluster),
181181
resource.TestCheckResourceAttr(resourceName, "capacity_providers.#", "0"),
@@ -187,7 +187,7 @@ func TestAccECSClusterCapacityProviders_Update_capacityProviders(t *testing.T) {
187187
ImportStateVerify: true,
188188
},
189189
{
190-
Config: testAccClusterCapacityProvidersConfig_withCapacityProviders1(rName, "FARGATE"),
190+
Config: testAccClusterCapacityProvidersConfig_1(rName, "FARGATE"),
191191
Check: resource.ComposeTestCheckFunc(
192192
testAccCheckClusterExists("aws_ecs_cluster.test", &cluster),
193193
resource.TestCheckResourceAttr(resourceName, "capacity_providers.#", "1"),
@@ -215,7 +215,7 @@ func TestAccECSClusterCapacityProviders_Update_defaultStrategy(t *testing.T) {
215215
CheckDestroy: testAccCheckClusterDestroy,
216216
Steps: []resource.TestStep{
217217
{
218-
Config: testAccClusterCapacityProvidersConfig_withDefaultCapacityProviderStrategy1(rName),
218+
Config: testAccClusterCapacityProvidersConfig_defaultProviderStrategy1(rName),
219219
Check: resource.ComposeTestCheckFunc(
220220
testAccCheckClusterExists("aws_ecs_cluster.test", &cluster),
221221
resource.TestCheckResourceAttr(resourceName, "default_capacity_provider_strategy.#", "1"),
@@ -232,7 +232,7 @@ func TestAccECSClusterCapacityProviders_Update_defaultStrategy(t *testing.T) {
232232
ImportStateVerify: true,
233233
},
234234
{
235-
Config: testAccClusterCapacityProvidersConfig_withDefaultCapacityProviderStrategy2(rName),
235+
Config: testAccClusterCapacityProvidersConfig_defaultProviderStrategy2(rName),
236236
Check: resource.ComposeTestCheckFunc(
237237
testAccCheckClusterExists("aws_ecs_cluster.test", &cluster),
238238
resource.TestCheckResourceAttr(resourceName, "default_capacity_provider_strategy.#", "2"),
@@ -254,7 +254,7 @@ func TestAccECSClusterCapacityProviders_Update_defaultStrategy(t *testing.T) {
254254
ImportStateVerify: true,
255255
},
256256
{
257-
Config: testAccClusterCapacityProvidersConfig_withDefaultCapacityProviderStrategy3(rName),
257+
Config: testAccClusterCapacityProvidersConfig_defaultProviderStrategy3(rName),
258258
Check: resource.ComposeTestCheckFunc(
259259
testAccCheckClusterExists("aws_ecs_cluster.test", &cluster),
260260
resource.TestCheckResourceAttr(resourceName, "default_capacity_provider_strategy.#", "2"),
@@ -276,7 +276,7 @@ func TestAccECSClusterCapacityProviders_Update_defaultStrategy(t *testing.T) {
276276
ImportStateVerify: true,
277277
},
278278
{
279-
Config: testAccClusterCapacityProvidersConfig_withDefaultCapacityProviderStrategy4(rName),
279+
Config: testAccClusterCapacityProvidersConfig_defaultProviderStrategy4(rName),
280280
Check: resource.ComposeTestCheckFunc(
281281
testAccCheckClusterExists("aws_ecs_cluster.test", &cluster),
282282
resource.TestCheckResourceAttr(resourceName, "default_capacity_provider_strategy.#", "0"),
@@ -291,7 +291,7 @@ func TestAccECSClusterCapacityProviders_Update_defaultStrategy(t *testing.T) {
291291
})
292292
}
293293

294-
func testAccClusterCapacityProvidersConfig(rName string) string {
294+
func testAccClusterCapacityProvidersConfig_basic(rName string) string {
295295
return fmt.Sprintf(`
296296
resource "aws_ecs_cluster" "test" {
297297
name = %[1]q
@@ -323,7 +323,7 @@ resource "aws_ecs_cluster_capacity_providers" "test" {
323323
`, rName)
324324
}
325325

326-
func testAccClusterCapacityProvidersConfig_withCapacityProviders0(rName string) string {
326+
func testAccClusterCapacityProvidersConfig_0(rName string) string {
327327
return fmt.Sprintf(`
328328
resource "aws_ecs_cluster" "test" {
329329
name = %[1]q
@@ -337,7 +337,7 @@ resource "aws_ecs_cluster_capacity_providers" "test" {
337337
`, rName)
338338
}
339339

340-
func testAccClusterCapacityProvidersConfig_withCapacityProviders1(rName, provider1 string) string {
340+
func testAccClusterCapacityProvidersConfig_1(rName, provider1 string) string {
341341
return fmt.Sprintf(`
342342
resource "aws_ecs_cluster" "test" {
343343
name = %[1]q
@@ -351,7 +351,7 @@ resource "aws_ecs_cluster_capacity_providers" "test" {
351351
`, rName, provider1)
352352
}
353353

354-
func testAccClusterCapacityProvidersConfig_withCapacityProviders2(rName, provider1, provider2 string) string {
354+
func testAccClusterCapacityProvidersConfig_2(rName, provider1, provider2 string) string {
355355
return fmt.Sprintf(`
356356
resource "aws_ecs_cluster" "test" {
357357
name = %[1]q
@@ -365,7 +365,7 @@ resource "aws_ecs_cluster_capacity_providers" "test" {
365365
`, rName, provider1, provider2)
366366
}
367367

368-
func testAccClusterCapacityProvidersConfig_withDefaultCapacityProviderStrategy1(rName string) string {
368+
func testAccClusterCapacityProvidersConfig_defaultProviderStrategy1(rName string) string {
369369
return fmt.Sprintf(`
370370
resource "aws_ecs_cluster" "test" {
371371
name = %[1]q
@@ -385,7 +385,7 @@ resource "aws_ecs_cluster_capacity_providers" "test" {
385385
`, rName)
386386
}
387387

388-
func testAccClusterCapacityProvidersConfig_withDefaultCapacityProviderStrategy2(rName string) string {
388+
func testAccClusterCapacityProvidersConfig_defaultProviderStrategy2(rName string) string {
389389
return fmt.Sprintf(`
390390
resource "aws_ecs_cluster" "test" {
391391
name = %[1]q
@@ -410,7 +410,7 @@ resource "aws_ecs_cluster_capacity_providers" "test" {
410410
`, rName)
411411
}
412412

413-
func testAccClusterCapacityProvidersConfig_withDefaultCapacityProviderStrategy3(rName string) string {
413+
func testAccClusterCapacityProvidersConfig_defaultProviderStrategy3(rName string) string {
414414
return fmt.Sprintf(`
415415
resource "aws_ecs_cluster" "test" {
416416
name = %[1]q
@@ -435,7 +435,7 @@ resource "aws_ecs_cluster_capacity_providers" "test" {
435435
`, rName)
436436
}
437437

438-
func testAccClusterCapacityProvidersConfig_withDefaultCapacityProviderStrategy4(rName string) string {
438+
func testAccClusterCapacityProvidersConfig_defaultProviderStrategy4(rName string) string {
439439
return fmt.Sprintf(`
440440
resource "aws_ecs_cluster" "test" {
441441
name = %[1]q
@@ -449,7 +449,7 @@ resource "aws_ecs_cluster_capacity_providers" "test" {
449449
`, rName)
450450
}
451451

452-
func testAccClusterCapacityProvidersConfig_destroy_before(rName string) string {
452+
func testAccClusterCapacityProvidersConfig_destroyBefore(rName string) string {
453453
return fmt.Sprintf(`
454454
data "aws_ami" "test" {
455455
most_recent = true
@@ -609,7 +609,7 @@ resource "aws_autoscaling_group" "test" {
609609
`, rName)
610610
}
611611

612-
func testAccClusterCapacityProvidersConfig_destroy_after(rName string) string {
612+
func testAccClusterCapacityProvidersConfig_destroyAfter(rName string) string {
613613
return fmt.Sprintf(`
614614
resource "aws_vpc" "test" {
615615
cidr_block = "10.0.0.0/16"

0 commit comments

Comments
 (0)