Skip to content

Conversation

@Rob9786
Copy link
Collaborator

@Rob9786 Rob9786 commented Aug 15, 2025

Make sure you have checked all steps below.

Issue

  • My PR fully resolves the following issues. I've referenced an issue in the PR title, for example "Issue 1234 - My
    Feature". Note that before an issue is finished, you can still make a pull request by raising a separate issue
    for your progress.

Tests

  • My PR adds the following tests based on our test strategy OR does not need testing for this extremely good reason:
    • No new tests

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it, or I have linked to a
    separate issue for that below.
  • If I have added new Java code, I have added Javadoc that explains it following our conventions and style.
  • If I have added or removed any dependencies from the project, I have updated the NOTICES file.

Related tasks

@Rob9786 Rob9786 linked an issue Aug 15, 2025 that may be closed by this pull request
@Rob9786 Rob9786 changed the title 5425: Initial commit of new class Issue 5425 - Add new shut down ECS cluster Lambda into the CDK Aug 15, 2025
@Rob9786
Copy link
Collaborator Author

Rob9786 commented Aug 22, 2025

Although stop tasks code is running when a cluster delete is requested, the cluster is still failing to delete cleanly.
I've attached screenshots showing what is happening:

Autostop was requested at 08:03:12:
image

The task is stopped on the cluster:
image

The delete cluster fails with the following error:
image

This is reported at 09:03:08 (ignore the hour difference), but this is reported before the task actually stopped.
IngestClusterAutoStop event (on CloudTrail) was triggered at 09:03:07.

If you retry deleting the CloudFormation stack it will now delete cleanly, so there is some sort of timing issue where AWS attempts to delete the cluster before the task has fully stopped.

This particular stack and logs is stevecc-0822

@Rob9786
Copy link
Collaborator Author

Rob9786 commented Aug 22, 2025

Attempted another run. I've attached the Cloudwatch Log Insights download. I've observed this before where the task has been stopped but then records have still been output afterwards.
logs-insights-results.xlsx

@Rob9786 Rob9786 added the needs-reviewer Pull requests that need a reviewer to be assigned label Aug 29, 2025
@Rob9786
Copy link
Collaborator Author

Rob9786 commented Aug 29, 2025

Adding a dependency between the lambda and the stack has corrected the issue. The stack is now deleting cleanly on AWS.

@Rob9786 Rob9786 marked this pull request as ready for review August 29, 2025 08:26
@patchwork01 patchwork01 removed the needs-reviewer Pull requests that need a reviewer to be assigned label Aug 29, 2025
Copy link
Collaborator

@patchwork01 patchwork01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much.

@patchwork01 patchwork01 merged commit 106137a into develop Sep 1, 2025
8 checks passed
@patchwork01 patchwork01 deleted the 5425-add-new-shut-down-ecs-cluster-lambda-into-the-cdk branch September 1, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new shut down ECS cluster Lambda into the CDK

3 participants