Skip to content

Commit 17bcec8

Browse files
committed
Apply changes from 7d7a15b.
1 parent 71308f6 commit 17bcec8

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

internal/service/ecs/express_gateway_service.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ func (r *expressGatewayServiceResource) Delete(ctx context.Context, req resource
463463
errs.IsAErrorMessageContains[*awstypes.ServiceNotActiveException](err, "Cannot perform this operation on a service in INACTIVE status") ||
464464
errs.IsAErrorMessageContains[*awstypes.ServiceNotActiveException](err, "Service is in DRAINING status") {
465465
// Service was already deleted/inactive/draining - deletion is already in progress or complete
466+
return
466467
} else {
467468
// Real error occurred
468469
smerr.AddError(ctx, &resp.Diagnostics, err, smerr.ID, serviceARN)

internal/service/ecs/express_gateway_service_test.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,45 @@ func TestAccECSExpressGatewayService_update(t *testing.T) {
238238
})
239239
}
240240

241+
func TestAccECSExpressGatewayService_waitForSteadyState(t *testing.T) {
242+
acctest.Skip(t, "Times out when running with full suite")
243+
ctx := acctest.Context(t)
244+
if testing.Short() {
245+
t.Skip("skipping long-running test in short mode")
246+
}
247+
248+
var service awstypes.ECSExpressGatewayService
249+
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
250+
resourceName := "aws_ecs_express_gateway_service.test"
251+
252+
resource.ParallelTest(t, resource.TestCase{
253+
PreCheck: func() {
254+
acctest.PreCheck(ctx, t)
255+
acctest.PreCheckPartitionHasService(t, names.ECSEndpointID)
256+
},
257+
ErrorCheck: acctest.ErrorCheck(t, names.ECSServiceID),
258+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
259+
CheckDestroy: testAccCheckExpressGatewayServiceDestroy(ctx),
260+
Steps: []resource.TestStep{
261+
{
262+
Config: testAccExpressGatewayServiceConfig_basic(rName, true),
263+
Check: resource.ComposeTestCheckFunc(
264+
testAccCheckExpressGatewayServiceExists(ctx, resourceName, &service),
265+
resource.TestCheckResourceAttr(resourceName, "wait_for_steady_state", acctest.CtTrue),
266+
resource.TestCheckResourceAttr(resourceName, "primary_container.0.image", "public.ecr.aws/nginx/nginx:1.28-alpine3.21-slim"),
267+
),
268+
},
269+
{
270+
Config: testAccExpressGatewayServiceConfig_updated(rName, true),
271+
Check: resource.ComposeTestCheckFunc(
272+
testAccCheckExpressGatewayServiceExists(ctx, resourceName, &service),
273+
resource.TestCheckResourceAttr(resourceName, "primary_container.0.image", "public.ecr.aws/nginx/nginx:latest"),
274+
),
275+
},
276+
},
277+
})
278+
}
279+
241280
func TestAccECSExpressGatewayService_networkConfiguration(t *testing.T) {
242281
ctx := acctest.Context(t)
243282
if testing.Short() {

0 commit comments

Comments
 (0)