1 Answer
- Newest
- Most votes
- Most comments
0
Hi James.
I had some experience with a similar process to handle the migrations on RDS (Postgres). We use GitHub, GitHub Actions, and CDK. So it's almost similar.
Every new change in the repo will run a GitHub Action that will trigger a cdk deploy
and this will launch a Step-function that has a logic to validate if any change in the schema Is needed. This is done by triggering a container on ECS to run the migrations. If the execution goes well It will launch the app deployment.
Hope this gives you another idea to find the best workaround for you.
answered 5 months ago
Relevant content
- asked 4 years ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 months ago
It seems you are doing two steps as well. Not sure if cdk works the same as terraform in this use case. How do you tell if the migration run successfully?
Hi James!
I will copy the high-level logic from another answer which you can take a look at later:
Step Functions invokes ECS/Fargate with a task token Step function then pauses waiting for that token to be returned. ECS/Fargate sends back a SendTaskScucess with that same task token. You can use the code mentioned above as an example to scaffold a solution from. You can see from the code the following: const params = { output: ""Callback task completed successfully."", taskToken: taskToken }; where can modify “output” to have any type of message you’d like. They use "Callback task completed successfully." but you can change this to be whatever you like such as a location of where data is stored in S3/DynamoDB/elsewhere.
When the task token is received the workflow continues.
Here is the original question: https://repost.aws/questions/QUMyCGFjUwSqaGSlUk99J1fg/aws-step-function-output-for-container-services