This is my first time trying to use CDK to deploy a Fargate service stack with an ALB configured in a separate stack. I tried to follow this example https://github.com/aws-samples/aws-cdk-examples/blob/master/typescript/ecs/cross-stack-load-balancer/split-at-listener.ts
Note: By itself the task definition and the service is getting deployed perfectly, however when I try to add a listener/target group and register the service with the target group then it fails with this error.
Resource handler returned message: "Invalid request provided: UpdateService error: Health check grace period is only valid for services config
ured to use load balancers (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException; Request ID: c49473d9-f5d1-47c2-b113-3
0551d484d3f; Proxy: null)" (RequestToken: e68aef9e-ed8f-8d28-d29c-fec52c7339e0, HandlerErrorCode: InvalidRequest)
Thanks for your response.. Yeah, so I have been adding resources in this stack one at a time. I started with taskDefinition, then FargateService (started with just 1 desired count) with appropriate taskRole and executionRole. Once this deployed successfully I started adding ALB/TG connection. Basically I imported ALB and added listener/targetGroup... I guess it does not like this approach. Based on your response I thought let me delete the stack and recreate with all the resources that I need, and it appears to help.. Now I am further along.. the necessary plumbing between ALB/Listener/TG/Service seems to have been made.. Now the failure is that TargetGroup does not have healthy targets. I wonder if its the security group issue.