(@aws-cdk/aws-ecs): CreateService error: NetworkConfiguration must be null #16981
Labels
@aws-cdk/aws-ecs
Related to Amazon Elastic Container
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
What is the problem?
Trying to achieve Perform ECS blue/green deployments through CodeDeploy using AWS CloudFormation via CDK.
Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/blue-green.html
Using the above link trying to create the Cloudformation template via CDK, as Cloudformation now supports ECS blue/green deployment.
I am not passing any NetworkConfiguration, but CDK is assuming by itself while creating the template, I had a session with the CDK support team in AWS, even they confirmed that the creation of NetworkConfiguration inside the "ECS Service" by itself during the synth process. When I try to deploy, it is throwing the below error's :
Resource handler returned message: "Invalid request provided: CreateService error: NetworkConfiguration must be null. (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException; Request ID: f3d3b359-32f3-4dad-bf56-abd2552af518; Proxy: null)" (RequestToken: 73935952-e726-0020-a399-c6518da2c124, HandlerErrorCode: InvalidRequest)
Resource handler returned message: "Invalid request provided: CreateService error: LaunchType must be blank. (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException; Request ID: 0e1f6d38-d0e8-4438-af67-68e0bf5caa48; Proxy: null)" (RequestToken: 3aab09c2-6cfa-3674-8ea0-300d2be1c4e3, HandlerErrorCode: InvalidRequest)
My End goal is to achieve Blue/Green Deployment but unable to achieve it in both cases there are errors, my primary focus is on using the "FargateService" Construct. I need an assist on how to rectify the error and also wanted to know whether it is a potential bug.
Reproduction Steps
Implementation 1 :
Implementation 2 :
const Service = new CfnService(this, 'Service', {
cluster: cluster.clusterName,
desiredCount: 3,
launchType: "FARGATE",
deploymentController: { type: DeploymentControllerType.EXTERNAL },
propagateTags: PropagatedTagSource.SERVICE,
});
Here it is throwing the error for launchType must be blank , if passed nothing it is assuming as EC2.
What did you expect to happen?
Implementation 1:
Expected to create an ECS Service Resource inside CloudFormation without NetworkConfiguration and create an ECS Service on console during deployment, but it is creating the template with NetworkConfiguration inside Service Resource Part and during the deployment of the stack it is throwing error and stack failed.
Implementation 2:
Expected to create an ECS Service on console during deployment with FARGATE Service but instead, it is creating with EC2 when the launchType property is not passed, but if passed as FARGATE in CDK it is throwing the error.
What actually happened?
Implementation 1 Error :
Resource handler returned message: "Invalid request provided: CreateService error: NetworkConfiguration must be null. (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException; Request ID: f3d3b359-32f3-4dad-bf56-abd2552af518; Proxy: null)" (RequestToken: 73935952-e726-0020-a399-c6518da2c124, HandlerErrorCode: InvalidRequest)
Implementation 2 Error:
Resource handler returned message: "Invalid request provided: CreateService error: LaunchType must be blank. (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException; Request ID: 0e1f6d38-d0e8-4438-af67-68e0bf5caa48; Proxy: null)" (RequestToken: 3aab09c2-6cfa-3674-8ea0-300d2be1c4e3, HandlerErrorCode: InvalidRequest)
CDK CLI Version
1.127.0
Framework Version
No response
Node.js Version
v16.8.0
OS
Linux
Language
Typescript
Language Version
4.4.3
Other information
No response
The text was updated successfully, but these errors were encountered: