Ecs blue/green deployment

Hi,
I`m wondering is there a way to perform ecs blue/green deployments via codedeploy using serverless.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/blue-green.html
I am using additional plugin to deploy ecs-fargate cluster.
The cloudformation template should include hooks and transform blocks outside resources block.
Is there a way to add hooks and transform blocks into the created cloudformation template during the deploy?
Thanks.