-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(ecs): enable default capacity provider strategy #23955
Conversation
git commit -m "merge the latest updates"
git commit -m "Merging updated main "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just a few small comments
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved with some tiny nits. Thanks for working through the feedback!
Thank You so much @bvtujo for reviewing my PR with lot of patience and guidance. |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
feat(aws-cdk):Adding Support for DefaultCapacityProviderStrategy for L2_cluster A capacity provider strategy determines whether ECS tasks are launched on EC2 instances or Fargate/Fargate Spot. It can be specified at the cluster, service, or task level, and consists of one or more capacity providers. You can specify an optional base and weight value for finer control of how tasks are launched. The `base` specifies a minimum number of tasks on one capacity provider, and the `weight`s of each capacity provider determine how tasks are distributed after `base` is satisfied. You can associate a default capacity provider strategy with an Amazon ECS cluster. After you do this, a default capacity provider strategy is used when creating a service or running a standalone task in the cluster and whenever a custom capacity provider strategy or a launch type isn't specified. We recommend that you define a default capacity provider strategy for each cluster. For more information visit https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html When the service does not have a capacity provider strategy, the cluster's default capacity provider strategy will be used. Default Capacity Provider Strategy can be added by using the method `addDefaultCapacityProviderStrategy`. A capacity provider strategy cannot contain a mix of EC2 Autoscaling Group capacity providers and Fargate providers. ```ts declare const capacityProvider: ecs.CapacityProvider; const cluster = new ecs.Cluster(stack, 'EcsCluster', { enableFargateCapacityProviders: true, }); cluster.addAsgCapacityProvider(capacityProvider); cluster.addDefaultCapacityProviderStrategy([ { capacityProvider: 'FARGATE', base: 10, weight: 50 }, { capacityProvider: 'FARGATE_SPOT', weight: 50 }, ]); ``` ```ts declare const capacityProvider: ecs.CapacityProvider; const cluster = new ecs.Cluster(stack, 'EcsCluster', { enableFargateCapacityProviders: true, }); cluster.addAsgCapacityProvider(capacityProvider); cluster.addDefaultCapacityProviderStrategy([ { capacityProvider: capacityProvider.capacityProviderName }, ]); ``` Related #15230 yarn build && yarn test results <img width="680" alt="image" src="https://user-images.githubusercontent.com/115483524/216092468-82864aea-b809-48de-9cec-f4b54ec1e541.png"> > Describe the reason for this change, what the solution is, and any > important design decisions you made. > > Remember to follow the [CONTRIBUTING GUIDE] and [DESIGN GUIDELINES] for any > code you submit. > > [CONTRIBUTING GUIDE]: https:/aws/aws-cdk/blob/main/CONTRIBUTING.md > [DESIGN GUIDELINES]: https:/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
feat(aws-cdk):Adding Support for DefaultCapacityProviderStrategy for L2_cluster A capacity provider strategy determines whether ECS tasks are launched on EC2 instances or Fargate/Fargate Spot. It can be specified at the cluster, service, or task level, and consists of one or more capacity providers. You can specify an optional base and weight value for finer control of how tasks are launched. The `base` specifies a minimum number of tasks on one capacity provider, and the `weight`s of each capacity provider determine how tasks are distributed after `base` is satisfied. You can associate a default capacity provider strategy with an Amazon ECS cluster. After you do this, a default capacity provider strategy is used when creating a service or running a standalone task in the cluster and whenever a custom capacity provider strategy or a launch type isn't specified. We recommend that you define a default capacity provider strategy for each cluster. For more information visit https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html When the service does not have a capacity provider strategy, the cluster's default capacity provider strategy will be used. Default Capacity Provider Strategy can be added by using the method `addDefaultCapacityProviderStrategy`. A capacity provider strategy cannot contain a mix of EC2 Autoscaling Group capacity providers and Fargate providers. ```ts declare const capacityProvider: ecs.CapacityProvider; const cluster = new ecs.Cluster(stack, 'EcsCluster', { enableFargateCapacityProviders: true, }); cluster.addAsgCapacityProvider(capacityProvider); cluster.addDefaultCapacityProviderStrategy([ { capacityProvider: 'FARGATE', base: 10, weight: 50 }, { capacityProvider: 'FARGATE_SPOT', weight: 50 }, ]); ``` ```ts declare const capacityProvider: ecs.CapacityProvider; const cluster = new ecs.Cluster(stack, 'EcsCluster', { enableFargateCapacityProviders: true, }); cluster.addAsgCapacityProvider(capacityProvider); cluster.addDefaultCapacityProviderStrategy([ { capacityProvider: capacityProvider.capacityProviderName }, ]); ``` Related aws#15230 yarn build && yarn test results <img width="680" alt="image" src="https://user-images.githubusercontent.com/115483524/216092468-82864aea-b809-48de-9cec-f4b54ec1e541.png"> > Describe the reason for this change, what the solution is, and any > important design decisions you made. > > Remember to follow the [CONTRIBUTING GUIDE] and [DESIGN GUIDELINES] for any > code you submit. > > [CONTRIBUTING GUIDE]: https:/aws/aws-cdk/blob/main/CONTRIBUTING.md > [DESIGN GUIDELINES]: https:/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
feat(aws-cdk):Adding Support for DefaultCapacityProviderStrategy for L2_cluster A capacity provider strategy determines whether ECS tasks are launched on EC2 instances or Fargate/Fargate Spot. It can be specified at the cluster, service, or task level, and consists of one or more capacity providers. You can specify an optional base and weight value for finer control of how tasks are launched. The `base` specifies a minimum number of tasks on one capacity provider, and the `weight`s of each capacity provider determine how tasks are distributed after `base` is satisfied. You can associate a default capacity provider strategy with an Amazon ECS cluster. After you do this, a default capacity provider strategy is used when creating a service or running a standalone task in the cluster and whenever a custom capacity provider strategy or a launch type isn't specified. We recommend that you define a default capacity provider strategy for each cluster. For more information visit https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html When the service does not have a capacity provider strategy, the cluster's default capacity provider strategy will be used. Default Capacity Provider Strategy can be added by using the method `addDefaultCapacityProviderStrategy`. A capacity provider strategy cannot contain a mix of EC2 Autoscaling Group capacity providers and Fargate providers. ```ts declare const capacityProvider: ecs.CapacityProvider; const cluster = new ecs.Cluster(stack, 'EcsCluster', { enableFargateCapacityProviders: true, }); cluster.addAsgCapacityProvider(capacityProvider); cluster.addDefaultCapacityProviderStrategy([ { capacityProvider: 'FARGATE', base: 10, weight: 50 }, { capacityProvider: 'FARGATE_SPOT', weight: 50 }, ]); ``` ```ts declare const capacityProvider: ecs.CapacityProvider; const cluster = new ecs.Cluster(stack, 'EcsCluster', { enableFargateCapacityProviders: true, }); cluster.addAsgCapacityProvider(capacityProvider); cluster.addDefaultCapacityProviderStrategy([ { capacityProvider: capacityProvider.capacityProviderName }, ]); ``` Related aws#15230 yarn build && yarn test results <img width="680" alt="image" src="https://user-images.githubusercontent.com/115483524/216092468-82864aea-b809-48de-9cec-f4b54ec1e541.png"> > Describe the reason for this change, what the solution is, and any > important design decisions you made. > > Remember to follow the [CONTRIBUTING GUIDE] and [DESIGN GUIDELINES] for any > code you submit. > > [CONTRIBUTING GUIDE]: https:/aws/aws-cdk/blob/main/CONTRIBUTING.md > [DESIGN GUIDELINES]: https:/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
feat(aws-cdk):Adding Support for DefaultCapacityProviderStrategy for L2_cluster A capacity provider strategy determines whether ECS tasks are launched on EC2 instances or Fargate/Fargate Spot. It can be specified at the cluster, service, or task level, and consists of one or more capacity providers. You can specify an optional base and weight value for finer control of how tasks are launched. The `base` specifies a minimum number of tasks on one capacity provider, and the `weight`s of each capacity provider determine how tasks are distributed after `base` is satisfied. You can associate a default capacity provider strategy with an Amazon ECS cluster. After you do this, a default capacity provider strategy is used when creating a service or running a standalone task in the cluster and whenever a custom capacity provider strategy or a launch type isn't specified. We recommend that you define a default capacity provider strategy for each cluster. For more information visit https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html When the service does not have a capacity provider strategy, the cluster's default capacity provider strategy will be used. Default Capacity Provider Strategy can be added by using the method `addDefaultCapacityProviderStrategy`. A capacity provider strategy cannot contain a mix of EC2 Autoscaling Group capacity providers and Fargate providers. ```ts declare const capacityProvider: ecs.CapacityProvider; const cluster = new ecs.Cluster(stack, 'EcsCluster', { enableFargateCapacityProviders: true, }); cluster.addAsgCapacityProvider(capacityProvider); cluster.addDefaultCapacityProviderStrategy([ { capacityProvider: 'FARGATE', base: 10, weight: 50 }, { capacityProvider: 'FARGATE_SPOT', weight: 50 }, ]); ``` ```ts declare const capacityProvider: ecs.CapacityProvider; const cluster = new ecs.Cluster(stack, 'EcsCluster', { enableFargateCapacityProviders: true, }); cluster.addAsgCapacityProvider(capacityProvider); cluster.addDefaultCapacityProviderStrategy([ { capacityProvider: capacityProvider.capacityProviderName }, ]); ``` Related aws#15230 yarn build && yarn test results <img width="680" alt="image" src="https://user-images.githubusercontent.com/115483524/216092468-82864aea-b809-48de-9cec-f4b54ec1e541.png"> > Describe the reason for this change, what the solution is, and any > important design decisions you made. > > Remember to follow the [CONTRIBUTING GUIDE] and [DESIGN GUIDELINES] for any > code you submit. > > [CONTRIBUTING GUIDE]: https:/aws/aws-cdk/blob/main/CONTRIBUTING.md > [DESIGN GUIDELINES]: https:/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
feat(aws-cdk):Adding Support for DefaultCapacityProviderStrategy for L2_cluster
A capacity provider strategy determines whether ECS tasks are launched on EC2 instances or Fargate/Fargate Spot. It can be specified at the cluster, service, or task level, and consists of one or more capacity providers. You can specify an optional base and weight value for finer control of how tasks are launched. The
base
specifies a minimum number of tasks on one capacity provider, and theweight
s of each capacity provider determine how tasks are distributed afterbase
is satisfied.You can associate a default capacity provider strategy with an Amazon ECS cluster. After you do this, a default capacity provider strategy is used when creating a service or running a standalone task in the cluster and whenever a custom capacity provider strategy or a launch type isn't specified. We recommend that you define a default capacity provider strategy for each cluster.
For more information visit https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html
When the service does not have a capacity provider strategy, the cluster's default capacity provider strategy will be used. Default Capacity Provider Strategy can be added by using the method
addDefaultCapacityProviderStrategy
. A capacity provider strategy cannot contain a mix of EC2 Autoscaling Group capacity providers and Fargate providers.Related #15230
yarn build && yarn test results
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license