I have a scenario where we have some AWS ECS clusters on Fargate and Secrets injected into those task definitions from Secrets Manager and AWS SSM Parameter store. Now, we want to create a Lambda function to automatically restart the specific task definition if the secrets or parameters are updated. We created AWS CloudWatch Log groups to create a log if there is an update, delete in the secrets and Parameters following this document: https://upstart.chrishic.com/updating-container-secrets-using-cloudwatch-events-lambda/
Now we want to implement a Lambda function which will respond to this LogGroup and verify the ARN of the secret or Parameter and restart (perform Force Deployment) of the respective ECS Service