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:
|
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:
|
import { SqsQueueConfig, QueuePolicy } from "."; |
|
import { AwsConstructBase, AwsConstructProps } from "../aws-construct"; |
|
import * as iam from "../iam"; |
|
|
|
export interface QueueProps extends AwsConstructProps, SqsQueueConfig { |
|
this.resource = new sqsQueue.SqsQueue(this, "Resource", { |
|
...props, |
sqs.Queuewas 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
The main changes would be:
base/projenrc/aws-sqs-config-struct-builder.ts
Line 24 in 0f01369
base/src/aws/notify/queue.ts
Lines 4 to 8 in 0f01369
base/src/aws/notify/queue.ts
Lines 298 to 299 in 0f01369