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

docs: adds comments about 8vCpu and 16vCpu options for Fargate services in @aws-cdk/aws-ecs-patterns #22595

Merged
merged 4 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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