I am deploying containers on ECS (fargate) with platform versions 1.4.0 (Latest) in the private subnet using GitHub action. I have routed the traffic through the NAT gateway and have the ECS task Execution role with the secret manager's full access policy. When I bind ECS service to only one private subnet then the containers getting deployed over ECS with no error, but once I bind two private subnets for making ECS service more available then the task gets stopped with an error below error.
ResourceInitializationError: unable to pull secrets or registry auth: execution resource retrieval failed: unable to retrieve secret from asm: service call has been retried 5 time(s): failed to fetch secret arn:aws:secretsmanager:ap-south-1:27XXXXX...
I have tried every possible solution mentioned here but none is worked for me.