Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
13 changes: 13 additions & 0 deletions packages/@aws-cdk/aws-ecs-patterns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ const loadBalancedFargateService = new ApplicationLoadBalancedFargateService(sta
});
```


### Set deployment configuration on QueueProcessingService

```ts
Expand All @@ -411,6 +412,18 @@ const queueProcessingFargateService = new QueueProcessingFargateService(stack, '
});
```

### Set taskSubnets and securityGroups on QueueProcessingFargateService

```ts
const queueProcessingFargateService = new QueueProcessingFargateService(stack, 'Service', {
vpc,
memoryLimitMiB: 512,
image: ecs.ContainerImage.fromRegistry('test'),
securityGroups: [securityGroup],
taskSubnets: { subnetType: ec2.SubnetType.ISOLATED },
});
```

### Select specific vpc subnets for ApplicationLoadBalancedFargateService

```ts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as ec2 from '@aws-cdk/aws-ec2';
import { FargatePlatformVersion, FargateService, FargateTaskDefinition } from '@aws-cdk/aws-ecs';
import { Construct } from 'constructs';
import { QueueProcessingServiceBase, QueueProcessingServiceBaseProps } from '../base/queue-processing-service-base';
Expand Down Expand Up @@ -66,6 +67,20 @@ export interface QueueProcessingFargateServiceProps extends QueueProcessingServi
* @default - QueueProcessingContainer
*/
readonly containerName?: string;

/**
* The subnets to associate with the service.
*
* @default - Public subnets if `assignPublicIp` is set, otherwise the first available one of Private, Isolated, Public, in that order.
*/
readonly taskSubnets?: ec2.SubnetSelection;

/**
* The security groups to associate with the service. If you do not specify a security group, the default security group for the VPC is used.
*
* @default - A new security group is created.
*/
readonly securityGroups?: ec2.ISecurityGroup[];
}

/**
Expand Down Expand Up @@ -117,6 +132,8 @@ export class QueueProcessingFargateService extends QueueProcessingServiceBase {
enableECSManagedTags: props.enableECSManagedTags,
platformVersion: props.platformVersion,
deploymentController: props.deploymentController,
securityGroups: props.securityGroups,
vpcSubnets: props.taskSubnets,
});
this.configureAutoscalingForService(this.service);
this.grantPermissionsToService(this.service);
Expand Down
Loading