Skip to content

Commit

Permalink
docs: adds comments about 8vCpu and 16vCpu options for Fargate servic…
Browse files Browse the repository at this point in the history
…es in @aws-cdk/aws-ecs-patterns (#22595)

----

Silly CR to add docs about the new 8vCPU and 16vCPU options for Fargate services and tasks.
See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html#fargate-tasks-size 

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
pallymore authored Oct 21, 2022
1 parent 1a16ad0 commit 8573f05
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export interface FargateServiceBaseProps {
*
* 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments
*
* 8192 (8 vCPU) - Available memory values: Between 16GB and 60GB in 4GB increments
*
* 16384 (16 vCPU) - Available memory values: Between 32GB and 120GB in 8GB increments
*
* This default is set in the underlying FargateTaskDefinition construct.
*
* @default 256
Expand All @@ -48,6 +52,10 @@ export interface FargateServiceBaseProps {
*
* Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU)
*
* Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB) - Available cpu values: 8192 (8 vCPU)
*
* Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB) - Available cpu values: 16384 (16 vCPU)
*
* This default is set in the underlying FargateTaskDefinition construct.
*
* @default 512
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,30 @@ test('Scheduled Fargate Task - with subnetSelection defined', () => {
});
});

test('Scheduled Fargate Task - can take 8 vCpu and 60GB memory sizes', () => {
// GIVEN
const stack = new cdk.Stack();
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1 });
const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc });

new ScheduledFargateTask(stack, 'ScheduledFargateTask', {
cluster,
scheduledFargateTaskImageOptions: {
image: ecs.ContainerImage.fromRegistry('henk'),
memoryLimitMiB: 61440,
cpu: 8192,
},
schedule: events.Schedule.expression('rate(1 minute)'),
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', Match.objectLike({
Cpu: '8192',
Memory: '61440',
}),
);
});

test('Scheduled Fargate Task - with platformVersion defined', () => {
// GIVEN
const stack = new cdk.Stack();
Expand Down

0 comments on commit 8573f05

Please sign in to comment.