Skip to content

Commit 13d05fe

Browse files
committed
Add test for addLambdaSqsPermissions
1 parent 8e0d9db commit 13d05fe

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ functions:
5353
kmsDataKeyReusePeriodSeconds: 600 # optional - AWS default is 300 seconds
5454
deadLetterMessageRetentionPeriodSeconds: 1209600 # optional - AWS default is 345600 secs (4 days)
5555
deadLetterQueueEnabled: true # optional - default is true
56-
addLambdaSqsPermissionsEnabled: true # optional - default is true
56+
lambdaSqsPermissionsEnabled: true # optional - default is true
5757
visibilityTimeout: 120 # optional (in seconds) - AWS default is 30 secs
5858
rawMessageDelivery: true # Optional - default value is true
5959
enabled: true # Optional - default value is true

lib/serverless-sns-sqs-lambda.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ describe("Test Serverless SNS SQS Lambda", () => {
242242
kmsDataKeyReusePeriodSeconds: 200,
243243
deadLetterMessageRetentionPeriodSeconds: 1209600,
244244
deadLetterQueueEnabled: true,
245-
addLambdaSqsPermissionsEnabled: true,
245+
lambdaSqsPermissionsEnabled: true,
246246
enabled: false,
247247
visibilityTimeout: 999,
248248
rawMessageDelivery: true,
@@ -316,7 +316,7 @@ describe("Test Serverless SNS SQS Lambda", () => {
316316
snsSqs: {
317317
name: "some-name",
318318
topicArn: "arn:aws:sns:us-east-2:123456789012:MyTopic",
319-
addLambdaSqsPermissionsEnabled: false
319+
lambdaSqsPermissionsEnabled: false
320320
}
321321
}
322322
]

lib/serverless-sns-sqs-lambda.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Config = {
2727
deadLetterMessageRetentionPeriodSeconds: number;
2828
deadLetterQueueEnabled: boolean;
2929
enabled: boolean;
30-
addLambdaSqsPermissionsEnabled: boolean;
30+
lambdaSqsPermissionsEnabled: boolean;
3131
fifo: boolean;
3232
visibilityTimeout: number;
3333
rawMessageDelivery: boolean;
@@ -132,7 +132,7 @@ const addResource = (
132132
* kmsDataKeyReusePeriodSeconds: 600
133133
* deadLetterMessageRetentionPeriodSeconds: 1209600
134134
* deadLetterQueueEnabled: true
135-
* addLambdaSqsPermissionsEnabled: true
135+
* lambdaSqsPermissionsEnabled: true
136136
* visibilityTimeout: 120
137137
* rawMessageDelivery: true
138138
* enabled: false
@@ -202,7 +202,7 @@ export default class ServerlessSnsSqsLambda {
202202
maximum: 1209600
203203
},
204204
deadLetterQueueEnabled: { type: "boolean" },
205-
addLambdaSqsPermissionsEnabled: { type: "boolean" },
205+
lambdaSqsPermissionsEnabled: { type: "boolean" },
206206
rawMessageDelivery: { type: "boolean" },
207207
enabled: { type: "boolean" },
208208
fifo: { type: "boolean" },
@@ -318,7 +318,7 @@ Usage
318318
kmsDataKeyReusePeriodSeconds: 600 # optional - AWS default is 300 seconds
319319
deadLetterMessageRetentionPeriodSeconds: 1209600 # optional - AWS default is 345600 secs (4 days)
320320
deadLetterQueueEnabled: true # optional - default is enabled
321-
addLambdaSqsPermissionsEnabled: true # optional - default is enabled
321+
lambdaSqsPermissionsEnabled: true # optional - default is enabled
322322
enabled: true # optional - AWS default is true
323323
fifo: false # optional - AWS default is false
324324
visibilityTimeout: 30 # optional - AWS default is 30 seconds
@@ -366,9 +366,9 @@ Usage
366366
config.deadLetterQueueEnabled !== undefined
367367
? config.deadLetterQueueEnabled
368368
: true,
369-
addLambdaSqsPermissionsEnabled:
370-
config.addLambdaSqsPermissionsEnabled !== undefined
371-
? config.addLambdaSqsPermissionsEnabled
369+
lambdaSqsPermissionsEnabled:
370+
config.lambdaSqsPermissionsEnabled !== undefined
371+
? config.lambdaSqsPermissionsEnabled
372372
: true,
373373
enabled: config.enabled,
374374
fifo: config.fifo !== undefined ? config.fifo : false,
@@ -612,7 +612,7 @@ Usage
612612
name,
613613
kmsMasterKeyId,
614614
deadLetterQueueEnabled,
615-
addLambdaSqsPermissionsEnabled
615+
lambdaSqsPermissionsEnabled
616616
}
617617
) {
618618
if (template.Resources.IamRoleLambdaExecution === undefined) {
@@ -621,7 +621,7 @@ Usage
621621
// this the relevant policy to allow the lambda to access the queue.
622622
return;
623623
}
624-
if (!addLambdaSqsPermissionsEnabled) {
624+
if (!lambdaSqsPermissionsEnabled) {
625625
// The user wants to use their own IAM policy and does not want plugin to automatically append to the default one.
626626
return;
627627
}

0 commit comments

Comments
 (0)