@gradientedge/cdk-utils 8.152.0 → 8.154.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/lib/aws/construct/api-to-eventbridge-target/main.js +1 -1
- package/dist/src/lib/aws/construct/event-handler/handler.d.ts +29 -0
- package/dist/src/lib/aws/construct/event-handler/handler.js +25 -0
- package/dist/src/lib/aws/construct/event-handler/index.d.ts +3 -0
- package/dist/src/lib/aws/construct/event-handler/index.js +19 -0
- package/dist/src/lib/aws/construct/event-handler/main.d.ts +91 -0
- package/dist/src/lib/aws/construct/event-handler/main.js +198 -0
- package/dist/src/lib/aws/construct/event-handler/types.d.ts +42 -0
- package/dist/src/lib/aws/construct/event-handler/types.js +2 -0
- package/dist/src/lib/aws/construct/index.d.ts +2 -0
- package/dist/src/lib/aws/construct/index.js +2 -0
- package/dist/src/lib/aws/construct/piped-event-handler/index.d.ts +2 -0
- package/dist/src/lib/aws/construct/piped-event-handler/index.js +18 -0
- package/dist/src/lib/aws/construct/piped-event-handler/main.d.ts +38 -0
- package/dist/src/lib/aws/construct/piped-event-handler/main.js +69 -0
- package/dist/src/lib/aws/construct/piped-event-handler/types.d.ts +9 -0
- package/dist/src/lib/aws/construct/piped-event-handler/types.js +2 -0
- package/dist/src/lib/aws/services/eventbridge/main.d.ts +10 -1
- package/dist/src/lib/aws/services/eventbridge/main.js +36 -0
- package/dist/src/lib/aws/services/eventbridge/types.d.ts +7 -1
- package/dist/src/lib/aws/services/identity-access-management/main.d.ts +8 -0
- package/dist/src/lib/aws/services/identity-access-management/main.js +19 -0
- package/dist/src/lib/aws/services/lambda/types.d.ts +4 -0
- package/package.json +7 -7
- package/src/lib/aws/construct/api-to-eventbridge-target/main.ts +1 -1
- package/src/lib/aws/construct/event-handler/handler.ts +30 -0
- package/src/lib/aws/construct/event-handler/index.ts +3 -0
- package/src/lib/aws/construct/event-handler/main.ts +243 -0
- package/src/lib/aws/construct/event-handler/types.ts +44 -0
- package/src/lib/aws/construct/index.ts +2 -0
- package/src/lib/aws/construct/piped-event-handler/index.ts +2 -0
- package/src/lib/aws/construct/piped-event-handler/main.ts +81 -0
- package/src/lib/aws/construct/piped-event-handler/types.ts +10 -0
- package/src/lib/aws/services/eventbridge/main.ts +59 -1
- package/src/lib/aws/services/eventbridge/types.ts +8 -1
- package/src/lib/aws/services/identity-access-management/main.ts +23 -0
- package/src/lib/aws/services/lambda/types.ts +5 -0
|
@@ -640,6 +640,29 @@ export class IamManager {
|
|
|
640
640
|
return role
|
|
641
641
|
}
|
|
642
642
|
|
|
643
|
+
/**
|
|
644
|
+
* @summary Method to create iam statement for sqs to lambda pipe
|
|
645
|
+
* @param id scoped id of the resource
|
|
646
|
+
* @param scope scope in which this resource is defined
|
|
647
|
+
* @param queueArn the arn of the sqs queue
|
|
648
|
+
* @param lambdaArn the arn of the lambda function
|
|
649
|
+
*/
|
|
650
|
+
public createRoleForSqsToLambdaPipe(id: string, scope: CommonConstruct, queueArn: string, lambdaArn: string) {
|
|
651
|
+
const role = new Role(scope, `${id}`, {
|
|
652
|
+
assumedBy: new ServicePrincipal('pipes.amazonaws.com'),
|
|
653
|
+
description: `Role for ${id} Pipe`,
|
|
654
|
+
roleName: `${id}-${scope.props.stage}`,
|
|
655
|
+
})
|
|
656
|
+
|
|
657
|
+
role.addToPolicy(this.statementForPollQueue([queueArn]))
|
|
658
|
+
role.addToPolicy(this.statementForInvokeLambda([lambdaArn]))
|
|
659
|
+
|
|
660
|
+
createCfnOutput(`${id}Arn`, scope, role.roleArn)
|
|
661
|
+
createCfnOutput(`${id}Name`, scope, role.roleName)
|
|
662
|
+
|
|
663
|
+
return role
|
|
664
|
+
}
|
|
665
|
+
|
|
643
666
|
/**
|
|
644
667
|
* @summary Method to create iam policy for sqs
|
|
645
668
|
* @param id scoped id of the resource
|
|
@@ -2,6 +2,7 @@ import { AliasProps, FunctionProps } from 'aws-cdk-lib/aws-lambda'
|
|
|
2
2
|
import { TagProps } from '../../types'
|
|
3
3
|
import { EdgeFunctionProps } from 'aws-cdk-lib/aws-cloudfront/lib/experimental'
|
|
4
4
|
import { QueueProps } from '../simple-queue-service'
|
|
5
|
+
import { SqsEventSourceProps } from 'aws-cdk-lib/aws-lambda-event-sources'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
*/
|
|
@@ -46,3 +47,7 @@ export interface LambdaEnvironment {
|
|
|
46
47
|
STAGE?: string
|
|
47
48
|
TZ: string
|
|
48
49
|
}
|
|
50
|
+
|
|
51
|
+
export interface SQSEventSourceProps extends SqsEventSourceProps {
|
|
52
|
+
maxBatchingWindowInSecs: number
|
|
53
|
+
}
|