@gradientedge/cdk-utils 4.9.6 → 4.11.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/index.js +5 -1
- package/dist/src/lib/common/construct.d.ts +3 -1
- package/dist/src/lib/common/construct.js +11 -3
- package/dist/src/lib/common/index.js +5 -1
- package/dist/src/lib/common/stack.js +5 -1
- package/dist/src/lib/construct/api-to-eventbridge-target/index.js +5 -1
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +5 -1
- package/dist/src/lib/construct/graphql-api-lambda/index.js +5 -1
- package/dist/src/lib/construct/graphql-api-lambda/main.js +5 -1
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/index.js +5 -1
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +5 -1
- package/dist/src/lib/construct/index.js +5 -1
- package/dist/src/lib/construct/site-with-ecs-backend/index.js +5 -1
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +5 -1
- package/dist/src/lib/construct/static-site/index.js +5 -1
- package/dist/src/lib/construct/static-site/main.js +5 -1
- package/dist/src/lib/manager/aws/acm-manager.js +5 -1
- package/dist/src/lib/manager/aws/api-manager.js +5 -1
- package/dist/src/lib/manager/aws/app-config-manager.js +5 -1
- package/dist/src/lib/manager/aws/cloudfront-manager.js +5 -1
- package/dist/src/lib/manager/aws/cloudtrail-manager.js +5 -1
- package/dist/src/lib/manager/aws/cloudwatch-manager.js +5 -1
- package/dist/src/lib/manager/aws/codebuild-manager.js +5 -1
- package/dist/src/lib/manager/aws/dynamodb-manager.js +5 -1
- package/dist/src/lib/manager/aws/ecr-manager.js +5 -1
- package/dist/src/lib/manager/aws/ecs-manager.js +5 -1
- package/dist/src/lib/manager/aws/eks-manager.js +5 -1
- package/dist/src/lib/manager/aws/elasticache-manager.js +5 -1
- package/dist/src/lib/manager/aws/event-manager.js +5 -1
- package/dist/src/lib/manager/aws/iam-manager.d.ts +9 -0
- package/dist/src/lib/manager/aws/iam-manager.js +29 -1
- package/dist/src/lib/manager/aws/index.d.ts +2 -0
- package/dist/src/lib/manager/aws/index.js +7 -1
- package/dist/src/lib/manager/aws/kms-manager.d.ts +32 -0
- package/dist/src/lib/manager/aws/kms-manager.js +76 -0
- package/dist/src/lib/manager/aws/lambda-manager.js +5 -1
- package/dist/src/lib/manager/aws/log-manager.js +5 -1
- package/dist/src/lib/manager/aws/route53-manager.js +5 -1
- package/dist/src/lib/manager/aws/s3-manager.js +5 -1
- package/dist/src/lib/manager/aws/secrets-manager.js +5 -1
- package/dist/src/lib/manager/aws/sns-manager.js +5 -1
- package/dist/src/lib/manager/aws/sqs-manager.d.ts +34 -0
- package/dist/src/lib/manager/aws/sqs-manager.js +84 -0
- package/dist/src/lib/manager/aws/ssm-manager.js +5 -1
- package/dist/src/lib/manager/aws/vpc-manager.js +5 -1
- package/dist/src/lib/manager/aws/waf-manager.js +5 -1
- package/dist/src/lib/manager/index.js +5 -1
- package/dist/src/lib/types/aws/index.d.ts +18 -0
- package/dist/src/lib/types/index.js +5 -1
- package/dist/src/lib/utils/aws/index.js +5 -1
- package/dist/src/lib/utils/index.js +5 -1
- package/package.json +15 -15
- package/src/lib/common/construct.ts +7 -2
- package/src/lib/manager/aws/event-manager.ts +1 -0
- package/src/lib/manager/aws/iam-manager.ts +34 -0
- package/src/lib/manager/aws/index.ts +2 -0
- package/src/lib/manager/aws/kms-manager.ts +54 -0
- package/src/lib/manager/aws/sqs-manager.ts +67 -0
- package/src/lib/types/aws/index.ts +19 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as cdk from 'aws-cdk-lib'
|
|
2
|
+
import * as sqs from 'aws-cdk-lib/aws-sqs'
|
|
3
|
+
import * as common from '../../common'
|
|
4
|
+
import * as types from '../../types'
|
|
5
|
+
import * as utils from '../../utils'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @stability stable
|
|
9
|
+
* @category cdk-utils.sqs-manager
|
|
10
|
+
* @subcategory Construct
|
|
11
|
+
* @classdesc Provides operations on AWS Simple Queue Service.
|
|
12
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
13
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
14
|
+
* @example
|
|
15
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
16
|
+
*
|
|
17
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
18
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
19
|
+
* super(parent, id, props)
|
|
20
|
+
* this.props = props
|
|
21
|
+
* this.sqsManager.createSqsQueue('MySqs', this)
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
*
|
|
25
|
+
* @see [CDK Simple Queue Service Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs-readme.html}
|
|
26
|
+
*/
|
|
27
|
+
export class SqsManager {
|
|
28
|
+
/**
|
|
29
|
+
* @summary Method to create a lambda queue service
|
|
30
|
+
* @param {string} id scoped id of the resource
|
|
31
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
32
|
+
* @param {types.QueueProps} props
|
|
33
|
+
* @param {sqs.deadLetterQueue} deadLetterQueue
|
|
34
|
+
*/
|
|
35
|
+
public createQueueService(
|
|
36
|
+
id: string,
|
|
37
|
+
scope: common.CommonConstruct,
|
|
38
|
+
props: types.QueueProps,
|
|
39
|
+
deadLetterQueue?: sqs.DeadLetterQueue
|
|
40
|
+
) {
|
|
41
|
+
if (!props) throw `Queue props undefined`
|
|
42
|
+
|
|
43
|
+
const queue = new sqs.Queue(scope, id, {
|
|
44
|
+
queueName: props.queueName,
|
|
45
|
+
visibilityTimeout: cdk.Duration.seconds(props.visibilityTimeoutInSecs),
|
|
46
|
+
receiveMessageWaitTime: cdk.Duration.seconds(props.receiveMessageWaitTimeInSecs),
|
|
47
|
+
contentBasedDeduplication: props.contentBasedDeduplication,
|
|
48
|
+
dataKeyReuse: cdk.Duration.seconds(props.dataKeyReuseInSecs),
|
|
49
|
+
deadLetterQueue: deadLetterQueue,
|
|
50
|
+
deduplicationScope: props.deduplicationScope,
|
|
51
|
+
deliveryDelay: cdk.Duration.seconds(props.deliveryDelayInSecs),
|
|
52
|
+
encryption: props.encryption,
|
|
53
|
+
encryptionMasterKey: props.encryptionMasterKey,
|
|
54
|
+
fifo: props.fifo,
|
|
55
|
+
fifoThroughputLimit: props.fifoThroughputLimit,
|
|
56
|
+
maxMessageSizeBytes: props.maxMessageSizeBytes,
|
|
57
|
+
removalPolicy: props.removalPolicy,
|
|
58
|
+
retentionPeriod: props.retentionPeriod,
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
utils.createCfnOutput(`${id}-queueArn`, scope, queue.queueArn)
|
|
62
|
+
utils.createCfnOutput(`${id}-queueName`, scope, queue.queueName)
|
|
63
|
+
utils.createCfnOutput(`${id}-queueUrl`, scope, queue.queueUrl)
|
|
64
|
+
|
|
65
|
+
return queue
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -14,6 +14,7 @@ import * as elasticache from 'aws-cdk-lib/aws-elasticache'
|
|
|
14
14
|
import * as elb from 'aws-cdk-lib/aws-elasticloadbalancingv2'
|
|
15
15
|
import * as events from 'aws-cdk-lib/aws-events'
|
|
16
16
|
import * as iam from 'aws-cdk-lib/aws-iam'
|
|
17
|
+
import * as kms from 'aws-cdk-lib/aws-kms'
|
|
17
18
|
import * as lambda from 'aws-cdk-lib/aws-lambda'
|
|
18
19
|
import * as destinations from 'aws-cdk-lib/aws-lambda-destinations'
|
|
19
20
|
import * as logs from 'aws-cdk-lib/aws-logs'
|
|
@@ -21,6 +22,7 @@ import * as route53 from 'aws-cdk-lib/aws-route53'
|
|
|
21
22
|
import * as s3 from 'aws-cdk-lib/aws-s3'
|
|
22
23
|
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment'
|
|
23
24
|
import * as sns from 'aws-cdk-lib/aws-sns'
|
|
25
|
+
import * as sqs from 'aws-cdk-lib/aws-sqs'
|
|
24
26
|
import * as wafv2 from 'aws-cdk-lib/aws-wafv2'
|
|
25
27
|
import * as types from '../index'
|
|
26
28
|
|
|
@@ -108,6 +110,12 @@ export interface HealthCheck extends elb.HealthCheck {
|
|
|
108
110
|
timeoutInSecs: number
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
/**
|
|
114
|
+
* @category cdk-utils.kms-manager
|
|
115
|
+
* @subcategory Properties
|
|
116
|
+
*/
|
|
117
|
+
export interface KmsKeyProps extends kms.KeyProps {}
|
|
118
|
+
|
|
111
119
|
/**
|
|
112
120
|
* @category cdk-utils.lambda-manager
|
|
113
121
|
* @subcategory Types
|
|
@@ -533,3 +541,14 @@ export interface WafWebACLProps extends wafv2.CfnWebACLProps {}
|
|
|
533
541
|
* @category Compute
|
|
534
542
|
*/
|
|
535
543
|
export interface ElastiCacheProps extends elasticache.CfnCacheClusterProps {}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* @category cdk-utils.sqs-manager
|
|
547
|
+
* @subcategory Properties
|
|
548
|
+
*/
|
|
549
|
+
export interface QueueProps extends sqs.QueueProps {
|
|
550
|
+
visibilityTimeoutInSecs: number
|
|
551
|
+
receiveMessageWaitTimeInSecs: number
|
|
552
|
+
dataKeyReuseInSecs: number
|
|
553
|
+
deliveryDelayInSecs: number
|
|
554
|
+
}
|