Skip to content

Add AutoStopEcsClusterTasks to other stacks. #5566

@Rob9786

Description

@Rob9786

Description / Background

Parent issue:

A new custom resource lambda has been created to stop ECS tasks when an ECS cluster is deleted within a CDK/CloudFormation stack, in the following issue:

The lambda has been applied to IngestStack in the following issue:

We'd like to apply this to all ECS clusters we deploy, so that ECS tasks are stopped before the CDK deletes the cluster.

Acceptance Criteria

Gherkin format example:

Given deploy a BulkExportStack, a CompactionStack or SystemTestClusterStack.
When the stack is deleted from AWS
Then the tasks on the ECS cluster are stopped before the cluster is deleted.

Technical Notes / Implementation Details

Use the CDK IngestStack.java code as a guide.

Here's a list of other classes that currently deploy ECS clusters:

  • BulkExportTaskResources
  • CompactionTaskResources
  • SystemTestClusterStack

Add the AutoStopEcsClusterTasks lambda into the above stacks so that they will correctly stop tasks cleanly in the event of the stack being deleted.

New log group references will need to be created in the LoggingStack so the lambda events are output to the correct logs.

Dependencies / Blockers

It would be worth completing #5565 before starting this task.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions