Skip to content

Commit

Permalink
Update packages/aws-cdk-lib/aws-ecs-patterns/lib/ecs/queue-processing…
Browse files Browse the repository at this point in the history
…-ecs-service.ts

Co-authored-by: Luca Pizzini <lpizzini7@gmail.com>
  • Loading branch information
badmintoncryer and lpizzinidev committed Dec 11, 2023
1 parent 5ffa5f1 commit 66a45d2
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,8 @@ export class QueueProcessingEc2Service extends QueueProcessingServiceBase {
constructor(scope: Construct, id: string, props: QueueProcessingEc2ServiceProps = {}) {
super(scope, id, props);

// In the queueProcessingFargateService, props.image is optional, which is why image is optional in the queue-processing-service-base.ts.
// However, in the queueProcessingEcsService, image is mandatory, so null checks have been introduced.
if (props.image == null) {
throw new Error('Cannot create a QueueProcessingEc2Service with props.image is undefined');
if (!props.image) {
throw new Error('image must be specified for EC2 queue processing service');
}

const containerName = props.containerName ?? 'QueueProcessingContainer';
Expand Down

0 comments on commit 66a45d2

Please sign in to comment.