Skip to content

Commit

Permalink
feat(ecs-patterns): Add support for assignPublicIp for QueueProcessin…
Browse files Browse the repository at this point in the history
…gFargateService (#13122)

Resolve #12815

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
lgvo authored Feb 18, 2021
1 parent 1ce7df8 commit 3fb4600
Show file tree
Hide file tree
Showing 5 changed files with 1,084 additions and 3 deletions.
13 changes: 12 additions & 1 deletion packages/@aws-cdk/aws-ecs-patterns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ const queueProcessingFargateService = new QueueProcessingFargateService(stack, '
});
```

### Set taskSubnets and securityGroups on QueueProcessingFargateService
### Set taskSubnets and securityGroups for QueueProcessingFargateService

```ts
const queueProcessingFargateService = new QueueProcessingFargateService(stack, 'Service', {
Expand All @@ -425,6 +425,17 @@ const queueProcessingFargateService = new QueueProcessingFargateService(stack, '
});
```

### Define tasks with public IPs for QueueProcessingFargateService

```ts
const queueProcessingFargateService = new QueueProcessingFargateService(stack, 'Service', {
vpc,
memoryLimitMiB: 512,
image: ecs.ContainerImage.fromRegistry('test'),
assignPublicIp: true,
});
```

### Select specific vpc subnets for ApplicationLoadBalancedFargateService

```ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ export interface QueueProcessingFargateServiceProps extends QueueProcessingServi
* @default - A new security group is created.
*/
readonly securityGroups?: ec2.ISecurityGroup[];

/**
* Specifies whether the task's elastic network interface receives a public IP address.
*
* If true, each task will receive a public IP address.
*
* @default false
*/
readonly assignPublicIp?: boolean;
}

/**
Expand Down Expand Up @@ -134,6 +143,7 @@ export class QueueProcessingFargateService extends QueueProcessingServiceBase {
deploymentController: props.deploymentController,
securityGroups: props.securityGroups,
vpcSubnets: props.taskSubnets,
assignPublicIp: props.assignPublicIp,
});
this.configureAutoscalingForService(this.service);
this.grantPermissionsToService(this.service);
Expand Down
Loading

0 comments on commit 3fb4600

Please sign in to comment.