-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
sqs.Queue was one of the first ported constructs and surfaces the underlaying Terraform provider AWS configurations. Mainly because a lot of the core polyfills (i.e. Duration, ...) were missing.
Newer L2 Constructs follow the AWSCDK API closely, reflect the AWSCDK L2 construct... specifically exposing a duration as a number feels very non-intuitive:
base/integ/aws/notify/apps/fifo-queue.ts
Lines 24 to 30 in 0f01369
| new aws.notify.Queue(stack, "Queue", { | |
| namePrefix: "queue.fifo", | |
| messageRetentionSeconds: Duration.days(14).toSeconds(), | |
| visibilityTimeoutSeconds: Duration.minutes(15).toSeconds(), | |
| outputName: "fifo_queue", | |
| registerOutputs: true, | |
| }); |
The main changes would be:
- Do not use JSII Struct Builder:
| .mixin(Struct.fromFqn("@cdktf/provider-aws.sqsQueue.SqsQueueConfig")) |
- Don't pass props directly from L1 to L2 here:
Lines 4 to 8 in 0f01369
| import { SqsQueueConfig, QueuePolicy } from "."; | |
| import { AwsConstructBase, AwsConstructProps } from "../aws-construct"; | |
| import * as iam from "../iam"; | |
| export interface QueueProps extends AwsConstructProps, SqsQueueConfig { |
Lines 298 to 299 in 0f01369
| this.resource = new sqsQueue.SqsQueue(this, "Resource", { | |
| ...props, |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels