Conversation
|
Add review condition for running this workflow |
Enforced as part of the protection rules on the "production" environment @PaulLaux |
PaulLaux
left a comment
There was a problem hiding this comment.
Looks solid overall.
- Did you test it?
- Cleanup the PR description. Avoid redundant text.
- Explain the confirmation mechanism in the PR description. Who exactly can run? who exactly can confirm? where it is configured.
- Provide the minimal AWS IAM permissions required for this to work in the PR description.
.github/workflows/stop-ecs.yaml
Outdated
| - name: Validate confirmation | ||
| if: ${{ github.event.inputs.confirm != 'yes' }} | ||
| run: | | ||
| echo "Confirmation not provided. Please type 'yes' to confirm." |
There was a problem hiding this comment.
The message is not clear enough. Consider the context and where the message is being shown and provide a clearer message.
Tested it locally, it worked. |
|
No idea about the tests, I didn't change anything related. I re-ran them and they passed. |
Motivation
The Zebra running in ECS is not configured to save the state in the file system (under /persistence) but in memory (RAM) - meaning that upon a task restart the state will be removed and the running time for the tx-tool will be improved (nullified).
This PR adds a simple Github Actions Workflow to kill all the currently running ECS tasks (ECS will spawn automatically new tasks)
Minimal IAM permissions to run this task:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ListTasksInSpecificCluster", "Effect": "Allow", "Action": "ecs:ListTasks", "Resource": "*", "Condition": { "StringEquals": { "ecs:cluster": "arn:aws:ecs:eu-central-1:ACCOUNT_ID:cluster/dev-zebra-cluster" } } }, { "Sid": "StopTasksInSpecificCluster", "Effect": "Allow", "Action": "ecs:StopTask", "Resource": "arn:aws:ecs:eu-central-1:ACCOUNT_ID:task/dev-zebra-cluster/*", "Condition": { "StringEquals": { "ecs:cluster": "arn:aws:ecs:eu-central-1:ACCOUNT_ID:cluster/dev-zebra-cluster" } } }, { "Sid": "DescribeSpecificService", "Effect": "Allow", "Action": "ecs:DescribeServices", "Resource": "arn:aws:ecs:eu-central-1:ACCOUNT_ID:service/dev-zebra-cluster/dev-zebra" } ] }