-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_ecs: Fargate service not created because NetworkConfiguration is not null with External deployment controller #26335
Comments
Thank you for your report and the workaround with addDeletionOverride(). Yes, we should fix that. |
…using EXTERNAL deployment controller (#26338) When using an external deployment controller, ECS Service creation fails because the `NetworkConfiguration` is output to the template. This fix prevents the output of `NetworkConfiguration` when using external deployment controller. Closes #26335 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…using EXTERNAL deployment controller (#26338) When using an external deployment controller, ECS Service creation fails because the `NetworkConfiguration` is output to the template. This fix prevents the output of `NetworkConfiguration` when using external deployment controller. Closes #26335 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…using EXTERNAL deployment controller (aws#26338) When using an external deployment controller, ECS Service creation fails because the `NetworkConfiguration` is output to the template. This fix prevents the output of `NetworkConfiguration` when using external deployment controller. Closes aws#26335 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
could this cause NetworkLoadBalancedFargateService.getService not to return a FargateService instance anymore? |
@analytically Thank you for notice. I would like to clarify. Is it means that you cannot get an instance with import * as cdk from 'aws-cdk-lib';
import { NetworkLoadBalancedFargateService } from 'aws-cdk-lib/aws-ecs-patterns';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'Stack');
const taskDefinition = new cdk.aws_ecs.FargateTaskDefinition(stack, 'FargateTaskDef');
taskDefinition.addContainer('web', {
image: cdk.aws_ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
memoryLimitMiB: 512,
portMappings: [ { containerPort: 80, } ],
});
const service = new NetworkLoadBalancedFargateService(stack, 'Service', {
deploymentController: {
type: cdk.aws_ecs.DeploymentControllerType.EXTERNAL,
},
taskDefinition: taskDefinition,
});
// --------------------------
// I could get the instance.
// --------------------------
console.debug(service.service); If your mention is not, could you please provide a reproduction step? |
Describe the bug
Creating a Fargate Service using an external deployment controller fails with following message:
Expected Behavior
When using an External deployment controller, it is expected that the Fargate Service will be deployed without network configuration.
Current Behavior
During the deployment process, getting following error:
This is because the generated template contains
NetworkConfiguration
.Reproduction Steps
It can be reproduced with the following code:
Possible Solution
In fargate-service.ts, if deploymentControllerType is external, skip network configuration generation.
The following modifications can be suggested:
In addition, the following unit tests will need to be modified:
aws-cdk/packages/aws-cdk-lib/aws-ecs/test/fargate/fargate-service.test.ts
Lines 603 to 658 in cad0635
Additional Information/Context
This problem does not occur with ECS on EC2.
Currently this problem can be avoided with an escape hatches as follows.
CDK CLI Version
2.87.0 (build 9fca790)
Framework Version
No response
Node.js Version
v16.14.0
OS
macOS 13.4
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: