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

fix(sqs): queue with fifo: false does not deploy #31922

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion packages/aws-cdk-lib/aws-sqs/lib/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,11 @@ export class Queue extends QueueBase {
contentBasedDeduplication: props.contentBasedDeduplication,
deduplicationScope: props.deduplicationScope,
fifoThroughputLimit: props.fifoThroughputLimit,
fifoQueue,

// This value will be passed directly into the L1 props, but the underlying `AWS::SQS::Queue`
// does not accept `FifoQueue: false`. It must either be `true` or absent. So change a `false` into
// an `undefined`.
fifoQueue: fifoQueue ? true : undefined,
};
}

Expand Down
22 changes: 22 additions & 0 deletions packages/aws-cdk-lib/aws-sqs/test/sqs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,28 @@ test('test a queue throws when deduplicationScope specified on non fifo queue',
}).toThrow();
});

test('fifo: false is dropped from properties', () => {
// GIVEN
const stack = new Stack();

// WHEN
new sqs.Queue(stack, 'Queue', {
fifo: false,
});

// THEN
Template.fromStack(stack).templateMatches({
'Resources': {
'Queue4A7E3555': {
'Type': 'AWS::SQS::Queue',
'Properties': Match.absent(),
'UpdateReplacePolicy': 'Delete',
'DeletionPolicy': 'Delete',
},
},
});
});

test('test metrics', () => {
// GIVEN
const stack = new Stack();
Expand Down
Loading