Skip to content
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

ecs: Add ability to export target group created by FargateService (EC2Service etc..) #28083

Closed
1 of 2 tasks
pitayapj opened this issue Nov 21, 2023 · 3 comments
Closed
1 of 2 tasks
Labels
@aws-cdk/aws-codedeploy Related to AWS CodeDeploy effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@pitayapj
Copy link

pitayapj commented Nov 21, 2023

Describe the feature

An option to export target group from FargateService.
Needed for CodeDeploy ECS blue green deployment

Use Case

I'm having trouble when create CodeDeploy EcsDeploymentGroup,
it needs to specify 2 target groups for deployment config.

One of them is a secondary target group, which could be created by new lines of code.
But one of them should be a target group that was created by FargateService.
Currently there is no option to export the target group FargateService created.

Proposed Solution

Maybe we can do this could be via property or method

const service = new cdk.aws_ecs.FargateService(this, 'fargate-cluster', {
  cluster: this.cluster,
  taskDefinition: taskDefinition,
  serviceName: "fargate-service-ex",
  deploymentController: {
    type: cdk.aws_ecs.DeploymentControllerType.CODE_DEPLOY,
  },
});

const ecsDeployGroup = new cdk.aws_codedeploy.EcsDeploymentGroup(this, 'blueGreenDG', {
  service: service,
  blueGreenDeploymentConfig: {
    blueTargetGroup: service.targetgroup, //Or service.targetgroup(), need ITargetGroup return
    greenTargetGroup: secondaryTargetGroup,
    listener: httpsListener,
  },
  deploymentConfig: cdk.aws_codedeploy.EcsDeploymentConfig.ALL_AT_ONCE,
});

Other Information

I know we can get target group of service if using ApplicationLoadBalancedFargateService.
Since ApplicationLoadBalancedFargateService doesn't have priority option. Which is important to some cases
Can we do it with FargateService as well ?

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.103.1

Environment details (OS name and version, etc.)

MacOS

@pitayapj pitayapj added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 21, 2023
@github-actions github-actions bot added the @aws-cdk/aws-codedeploy Related to AWS CodeDeploy label Nov 21, 2023
@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Nov 21, 2023
@pahud pahud changed the title Add ability to export target group created by FargateService (EC2Service etc..) ecs: Add ability to export target group created by FargateService (EC2Service etc..) Nov 21, 2023
@pahud
Copy link
Contributor

pahud commented Nov 21, 2023

Looks like you need to provide a elbv2.ITargetGroup but looking at the FargateService, does it always come with a target group?

@pahud pahud added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Nov 21, 2023
@pitayapj
Copy link
Author

@pahud yes, sorry about that.
addTargets() do return TargetGroup so I am able to config CodeDeploy now.

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codedeploy Related to AWS CodeDeploy effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants