@gradientedge/cdk-utils 8.118.0 → 8.120.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/app/api-destined-function/package.json +1 -1
- package/dist/src/lib/common/construct.d.ts +32 -32
- package/dist/src/lib/common/construct.js +36 -59
- package/dist/src/lib/common/stack.d.ts +8 -7
- package/dist/src/lib/common/stack.js +17 -37
- package/dist/src/lib/common/types.d.ts +2 -2
- package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +22 -22
- package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +9 -9
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +3 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +37 -60
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +9 -9
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +3 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +40 -63
- package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +23 -23
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +2 -2
- package/dist/src/lib/construct/api-to-lambda-target/main.js +15 -38
- package/dist/src/lib/construct/application-configuration/main.d.ts +7 -7
- package/dist/src/lib/construct/application-configuration/main.js +17 -41
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +17 -17
- package/dist/src/lib/construct/graphql-api-lambda/main.js +6 -29
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +5 -5
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +7 -7
- package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +16 -16
- package/dist/src/lib/construct/lambda-with-iam-access/main.js +8 -31
- package/dist/src/lib/construct/lambda-with-iam-access/types.d.ts +4 -4
- package/dist/src/lib/construct/rest-api-lambda/main.d.ts +16 -16
- package/dist/src/lib/construct/rest-api-lambda/main.js +5 -28
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +5 -5
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +9 -32
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +38 -39
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +33 -54
- package/dist/src/lib/construct/static-asset-deployment/main.d.ts +4 -4
- package/dist/src/lib/construct/static-asset-deployment/main.js +3 -26
- package/dist/src/lib/construct/static-site/main.d.ts +15 -15
- package/dist/src/lib/construct/static-site/main.js +4 -27
- package/dist/src/lib/services/{aws/api-gateway → api-gateway}/main.d.ts +10 -10
- package/dist/src/lib/services/{aws/api-gateway → api-gateway}/main.js +21 -44
- package/dist/src/lib/services/api-gateway/types.d.ts +7 -0
- package/dist/src/lib/services/{aws/appconfig → appconfig}/main.d.ts +7 -7
- package/dist/src/lib/services/{aws/appconfig → appconfig}/main.js +14 -37
- package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/main.d.ts +5 -5
- package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/main.js +10 -33
- package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/types.d.ts +2 -2
- package/dist/src/lib/services/{aws/cloudfront → cloudfront}/main.d.ts +19 -19
- package/dist/src/lib/services/{aws/cloudfront → cloudfront}/main.js +47 -46
- package/dist/src/lib/services/{aws/cloudfront → cloudfront}/types.d.ts +3 -4
- package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/main.d.ts +6 -6
- package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/main.js +5 -28
- package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/logs.d.ts +1 -1
- package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/logs.js +1 -1
- package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/main.d.ts +1 -1
- package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/main.js +1 -1
- package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/codebuild → codebuild}/main.d.ts +4 -4
- package/dist/src/lib/services/{aws/codebuild → codebuild}/main.js +7 -30
- package/dist/src/lib/services/{aws/dynamodb → dynamodb}/main.d.ts +4 -4
- package/dist/src/lib/services/{aws/dynamodb → dynamodb}/main.js +8 -31
- package/dist/src/lib/services/{aws/dynamodb → dynamodb}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/main.d.ts +3 -3
- package/dist/src/lib/services/elastic-container-registry/main.js +37 -0
- package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/main.d.ts +11 -11
- package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/main.js +27 -50
- package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/types.d.ts +4 -4
- package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/main.d.ts +4 -4
- package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/main.js +12 -35
- package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/main.d.ts +5 -5
- package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/main.js +8 -31
- package/dist/src/lib/services/{aws/elasticache → elasticache}/main.d.ts +5 -5
- package/dist/src/lib/services/{aws/elasticache → elasticache}/main.js +10 -33
- package/dist/src/lib/services/{aws/eventbridge → eventbridge}/main.d.ts +14 -14
- package/dist/src/lib/services/{aws/eventbridge → eventbridge}/main.js +26 -49
- package/dist/src/lib/services/{aws/eventbridge → eventbridge}/target.d.ts +11 -11
- package/dist/src/lib/services/{aws/eventbridge → eventbridge}/target.js +6 -29
- package/dist/src/lib/services/{aws/eventbridge → eventbridge}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/evidently → evidently}/main.d.ts +8 -8
- package/dist/src/lib/services/{aws/evidently → evidently}/main.js +18 -41
- package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/main.d.ts +49 -50
- package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/main.js +110 -133
- package/dist/src/lib/services/index.d.ts +28 -1
- package/dist/src/lib/services/index.js +28 -1
- package/dist/src/lib/services/{aws/key-management-service → key-management-service}/main.d.ts +3 -3
- package/dist/src/lib/services/{aws/key-management-service → key-management-service}/main.js +5 -28
- package/dist/src/lib/services/{aws/lambda → lambda}/main.d.ts +12 -14
- package/dist/src/lib/services/{aws/lambda → lambda}/main.js +32 -59
- package/dist/src/lib/services/{aws/lambda → lambda}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/route53 → route53}/main.d.ts +10 -10
- package/dist/src/lib/services/{aws/route53 → route53}/main.js +21 -44
- package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/main.d.ts +6 -7
- package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/main.js +10 -33
- package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/main.d.ts +5 -5
- package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/main.js +11 -34
- package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/main.d.ts +7 -8
- package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/main.js +15 -38
- package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/main.d.ts +10 -11
- package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/main.js +31 -54
- package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/step-function → step-function}/main.d.ts +32 -33
- package/dist/src/lib/services/{aws/step-function → step-function}/main.js +33 -57
- package/dist/src/lib/services/{aws/systems-manager → systems-manager}/main.d.ts +5 -5
- package/dist/src/lib/services/{aws/systems-manager → systems-manager}/main.js +10 -33
- package/dist/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/main.d.ts +6 -7
- package/dist/src/lib/services/virtual-private-cloud/main.js +70 -0
- package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/main.d.ts +4 -4
- package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/main.js +8 -31
- package/dist/src/lib/utils/aws/index.d.ts +6 -3
- package/dist/src/lib/utils/aws/index.js +9 -26
- package/package.json +15 -15
- package/src/lib/common/construct.ts +97 -67
- package/src/lib/common/stack.ts +12 -12
- package/src/lib/common/types.ts +2 -2
- package/src/lib/construct/api-to-eventbridge-target/api.ts +31 -22
- package/src/lib/construct/api-to-eventbridge-target/event.ts +9 -9
- package/src/lib/construct/api-to-eventbridge-target/main.ts +56 -41
- package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +9 -9
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +62 -47
- package/src/lib/construct/api-to-lambda-target/api.ts +33 -23
- package/src/lib/construct/api-to-lambda-target/main.ts +24 -18
- package/src/lib/construct/application-configuration/main.ts +31 -24
- package/src/lib/construct/graphql-api-lambda/main.ts +22 -22
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +13 -13
- package/src/lib/construct/lambda-with-iam-access/main.ts +25 -25
- package/src/lib/construct/lambda-with-iam-access/types.ts +4 -4
- package/src/lib/construct/rest-api-lambda/main.ts +21 -21
- package/src/lib/construct/rest-api-lambda-with-cache/main.ts +14 -14
- package/src/lib/construct/site-with-ecs-backend/main.ts +79 -60
- package/src/lib/construct/static-asset-deployment/main.ts +6 -6
- package/src/lib/construct/static-site/main.ts +23 -17
- package/src/lib/services/{aws/api-gateway → api-gateway}/main.ts +42 -36
- package/src/lib/services/api-gateway/types.ts +8 -0
- package/src/lib/services/{aws/appconfig → appconfig}/main.ts +19 -19
- package/src/lib/services/{aws/certificate-manager → certificate-manager}/main.ts +14 -14
- package/src/lib/services/{aws/certificate-manager → certificate-manager}/types.ts +2 -2
- package/src/lib/services/{aws/cloudfront → cloudfront}/main.ts +89 -75
- package/src/lib/services/{aws/cloudfront → cloudfront}/types.ts +7 -4
- package/src/lib/services/{aws/cloudtrail → cloudtrail}/main.ts +12 -12
- package/src/lib/services/{aws/cloudwatch → cloudwatch}/logs.ts +2 -2
- package/src/lib/services/{aws/cloudwatch → cloudwatch}/main.ts +2 -2
- package/src/lib/services/{aws/cloudwatch → cloudwatch}/types.ts +1 -1
- package/src/lib/services/{aws/codebuild → codebuild}/main.ts +8 -8
- package/src/lib/services/{aws/dynamodb → dynamodb}/main.ts +9 -9
- package/src/lib/services/{aws/dynamodb → dynamodb}/types.ts +1 -1
- package/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/main.ts +5 -5
- package/src/lib/services/{aws/elastic-container-service → elastic-container-service}/main.ts +49 -38
- package/src/lib/services/{aws/elastic-container-service → elastic-container-service}/types.ts +4 -4
- package/src/lib/services/{aws/elastic-file-system → elastic-file-system}/main.ts +17 -17
- package/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/main.ts +12 -12
- package/src/lib/services/{aws/elasticache → elasticache}/main.ts +11 -11
- package/src/lib/services/{aws/eventbridge → eventbridge}/main.ts +38 -38
- package/src/lib/services/{aws/eventbridge → eventbridge}/target.ts +15 -15
- package/src/lib/services/{aws/eventbridge → eventbridge}/types.ts +1 -1
- package/src/lib/services/{aws/evidently → evidently}/main.ts +19 -19
- package/src/lib/services/{aws/identity-access-management → identity-access-management}/main.ts +143 -135
- package/src/lib/services/index.ts +28 -1
- package/src/lib/services/{aws/key-management-service → key-management-service}/main.ts +6 -6
- package/src/lib/services/{aws/lambda → lambda}/main.ts +66 -60
- package/src/lib/services/{aws/lambda → lambda}/types.ts +1 -1
- package/src/lib/services/{aws/route53 → route53}/main.ts +32 -32
- package/src/lib/services/{aws/secrets-manager → secrets-manager}/main.ts +12 -16
- package/src/lib/services/{aws/simple-notification-service → simple-notification-service}/main.ts +14 -14
- package/src/lib/services/{aws/simple-queue-service → simple-queue-service}/main.ts +19 -19
- package/src/lib/services/{aws/simple-queue-service → simple-queue-service}/types.ts +1 -1
- package/src/lib/services/{aws/simple-storage-service → simple-storage-service}/main.ts +40 -40
- package/src/lib/services/{aws/simple-storage-service → simple-storage-service}/types.ts +1 -1
- package/src/lib/services/{aws/step-function → step-function}/main.ts +78 -66
- package/src/lib/services/{aws/systems-manager → systems-manager}/main.ts +18 -13
- package/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/main.ts +17 -17
- package/src/lib/services/{aws/web-application-firewall → web-application-firewall}/main.ts +9 -9
- package/src/lib/utils/aws/index.ts +8 -5
- package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -7
- package/dist/src/lib/services/aws/elastic-container-registry/main.js +0 -60
- package/dist/src/lib/services/aws/index.d.ts +0 -28
- package/dist/src/lib/services/aws/index.js +0 -44
- package/dist/src/lib/services/aws/virtual-private-cloud/main.js +0 -93
- package/src/lib/services/aws/api-gateway/types.ts +0 -8
- package/src/lib/services/aws/index.ts +0 -28
- /package/dist/src/lib/services/{aws/api-gateway → api-gateway}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/api-gateway → api-gateway}/index.js +0 -0
- /package/dist/src/lib/services/{aws/api-gateway → api-gateway}/types.js +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/constants.d.ts +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/constants.js +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/index.js +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/types.js +0 -0
- /package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/index.js +0 -0
- /package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/types.js +0 -0
- /package/dist/src/lib/services/{aws/cloudfront → cloudfront}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/cloudfront → cloudfront}/index.js +0 -0
- /package/dist/src/lib/services/{aws/cloudfront → cloudfront}/types.js +0 -0
- /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/index.js +0 -0
- /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/types.js +0 -0
- /package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/index.js +0 -0
- /package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/types.js +0 -0
- /package/dist/src/lib/services/{aws/codebuild → codebuild}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/codebuild → codebuild}/index.js +0 -0
- /package/dist/src/lib/services/{aws/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/src/lib/services/{aws/constants.js → constants.js} +0 -0
- /package/dist/src/lib/services/{aws/dynamodb → dynamodb}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/dynamodb → dynamodb}/index.js +0 -0
- /package/dist/src/lib/services/{aws/dynamodb → dynamodb}/types.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/index.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/index.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/types.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/elasticache → elasticache}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elasticache → elasticache}/index.js +0 -0
- /package/dist/src/lib/services/{aws/elasticache → elasticache}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elasticache → elasticache}/types.js +0 -0
- /package/dist/src/lib/services/{aws/eventbridge → eventbridge}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/eventbridge → eventbridge}/index.js +0 -0
- /package/dist/src/lib/services/{aws/eventbridge → eventbridge}/types.js +0 -0
- /package/dist/src/lib/services/{aws/evidently → evidently}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/evidently → evidently}/index.js +0 -0
- /package/dist/src/lib/services/{aws/evidently → evidently}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/evidently → evidently}/types.js +0 -0
- /package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/index.js +0 -0
- /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/lambda → lambda}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/lambda → lambda}/index.js +0 -0
- /package/dist/src/lib/services/{aws/lambda → lambda}/types.js +0 -0
- /package/dist/src/lib/services/{aws/route53 → route53}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/route53 → route53}/index.js +0 -0
- /package/dist/src/lib/services/{aws/route53 → route53}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/route53 → route53}/types.js +0 -0
- /package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/index.js +0 -0
- /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/step-function → step-function}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/step-function → step-function}/index.js +0 -0
- /package/dist/src/lib/services/{aws/step-function → step-function}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/step-function → step-function}/types.js +0 -0
- /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/index.js +0 -0
- /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/types.js +0 -0
- /package/dist/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/index.js +0 -0
- /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/index.js +0 -0
- /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/types.js +0 -0
- /package/src/lib/services/{aws/api-gateway → api-gateway}/index.ts +0 -0
- /package/src/lib/services/{aws/appconfig → appconfig}/constants.ts +0 -0
- /package/src/lib/services/{aws/appconfig → appconfig}/index.ts +0 -0
- /package/src/lib/services/{aws/appconfig → appconfig}/types.ts +0 -0
- /package/src/lib/services/{aws/certificate-manager → certificate-manager}/index.ts +0 -0
- /package/src/lib/services/{aws/cloudfront → cloudfront}/index.ts +0 -0
- /package/src/lib/services/{aws/cloudtrail → cloudtrail}/index.ts +0 -0
- /package/src/lib/services/{aws/cloudtrail → cloudtrail}/types.ts +0 -0
- /package/src/lib/services/{aws/cloudwatch → cloudwatch}/index.ts +0 -0
- /package/src/lib/services/{aws/codebuild → codebuild}/index.ts +0 -0
- /package/src/lib/services/{aws/constants.ts → constants.ts} +0 -0
- /package/src/lib/services/{aws/dynamodb → dynamodb}/index.ts +0 -0
- /package/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/index.ts +0 -0
- /package/src/lib/services/{aws/elastic-container-service → elastic-container-service}/index.ts +0 -0
- /package/src/lib/services/{aws/elastic-file-system → elastic-file-system}/index.ts +0 -0
- /package/src/lib/services/{aws/elastic-file-system → elastic-file-system}/types.ts +0 -0
- /package/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/index.ts +0 -0
- /package/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/types.ts +0 -0
- /package/src/lib/services/{aws/elasticache → elasticache}/index.ts +0 -0
- /package/src/lib/services/{aws/elasticache → elasticache}/types.ts +0 -0
- /package/src/lib/services/{aws/eventbridge → eventbridge}/index.ts +0 -0
- /package/src/lib/services/{aws/evidently → evidently}/index.ts +0 -0
- /package/src/lib/services/{aws/evidently → evidently}/types.ts +0 -0
- /package/src/lib/services/{aws/identity-access-management → identity-access-management}/index.ts +0 -0
- /package/src/lib/services/{aws/key-management-service → key-management-service}/index.ts +0 -0
- /package/src/lib/services/{aws/key-management-service → key-management-service}/types.ts +0 -0
- /package/src/lib/services/{aws/lambda → lambda}/index.ts +0 -0
- /package/src/lib/services/{aws/route53 → route53}/index.ts +0 -0
- /package/src/lib/services/{aws/route53 → route53}/types.ts +0 -0
- /package/src/lib/services/{aws/secrets-manager → secrets-manager}/index.ts +0 -0
- /package/src/lib/services/{aws/simple-notification-service → simple-notification-service}/index.ts +0 -0
- /package/src/lib/services/{aws/simple-notification-service → simple-notification-service}/types.ts +0 -0
- /package/src/lib/services/{aws/simple-queue-service → simple-queue-service}/index.ts +0 -0
- /package/src/lib/services/{aws/simple-storage-service → simple-storage-service}/index.ts +0 -0
- /package/src/lib/services/{aws/step-function → step-function}/index.ts +0 -0
- /package/src/lib/services/{aws/step-function → step-function}/types.ts +0 -0
- /package/src/lib/services/{aws/systems-manager → systems-manager}/index.ts +0 -0
- /package/src/lib/services/{aws/systems-manager → systems-manager}/types.ts +0 -0
- /package/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/index.ts +0 -0
- /package/src/lib/services/{aws/web-application-firewall → web-application-firewall}/index.ts +0 -0
- /package/src/lib/services/{aws/web-application-firewall → web-application-firewall}/types.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { QueueProps } from './types'
|
|
1
|
+
import { Duration, RemovalPolicy, Tags } from 'aws-cdk-lib'
|
|
2
|
+
import { IQueue, Queue } from 'aws-cdk-lib/aws-sqs'
|
|
3
|
+
import { CommonConstruct } from '../../common'
|
|
4
|
+
import { createCfnOutput } from '../../utils'
|
|
6
5
|
import { LambdaProps } from '../lambda'
|
|
6
|
+
import { QueueProps } from './types'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @classdesc Provides operations on AWS Simple Queue Service.
|
|
@@ -13,7 +13,7 @@ import { LambdaProps } from '../lambda'
|
|
|
13
13
|
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
14
14
|
*
|
|
15
15
|
* class CustomConstruct extends CommonConstruct {
|
|
16
|
-
* constructor(parent:
|
|
16
|
+
* constructor(parent: Construct, id: string, props: common.CommonStackProps) {
|
|
17
17
|
* super(parent, id, props)
|
|
18
18
|
* this.props = props
|
|
19
19
|
* this.sqsManager.createQueue('MySqs', this, {...})
|
|
@@ -29,12 +29,12 @@ export class SqsManager {
|
|
|
29
29
|
* @param props
|
|
30
30
|
* @param deadLetterQueue
|
|
31
31
|
*/
|
|
32
|
-
public createQueue(id: string, scope: CommonConstruct, props: QueueProps, deadLetterQueue?:
|
|
32
|
+
public createQueue(id: string, scope: CommonConstruct, props: QueueProps, deadLetterQueue?: IQueue) {
|
|
33
33
|
if (!props) throw `Queue props undefined for ${id}`
|
|
34
34
|
|
|
35
|
-
const queue = new
|
|
35
|
+
const queue = new Queue(scope, id, {
|
|
36
36
|
contentBasedDeduplication: props.contentBasedDeduplication,
|
|
37
|
-
dataKeyReuse: props.dataKeyReuseInSecs ?
|
|
37
|
+
dataKeyReuse: props.dataKeyReuseInSecs ? Duration.seconds(props.dataKeyReuseInSecs) : props.dataKeyReuse,
|
|
38
38
|
deadLetterQueue: !deadLetterQueue
|
|
39
39
|
? undefined
|
|
40
40
|
: {
|
|
@@ -42,7 +42,7 @@ export class SqsManager {
|
|
|
42
42
|
queue: deadLetterQueue,
|
|
43
43
|
},
|
|
44
44
|
deduplicationScope: props.deduplicationScope,
|
|
45
|
-
deliveryDelay: props.deliveryDelayInSecs ?
|
|
45
|
+
deliveryDelay: props.deliveryDelayInSecs ? Duration.seconds(props.deliveryDelayInSecs) : undefined,
|
|
46
46
|
encryption: props.encryption,
|
|
47
47
|
encryptionMasterKey: props.encryptionMasterKey,
|
|
48
48
|
fifo: props.fifo,
|
|
@@ -50,24 +50,24 @@ export class SqsManager {
|
|
|
50
50
|
maxMessageSizeBytes: props.maxMessageSizeBytes,
|
|
51
51
|
queueName: props.queueName,
|
|
52
52
|
receiveMessageWaitTime: props.receiveMessageWaitTimeInSecs
|
|
53
|
-
?
|
|
53
|
+
? Duration.seconds(props.receiveMessageWaitTimeInSecs)
|
|
54
54
|
: props.receiveMessageWaitTime,
|
|
55
|
-
removalPolicy: props.removalPolicy ??
|
|
56
|
-
retentionPeriod: props.retentionInDays ?
|
|
55
|
+
removalPolicy: props.removalPolicy ?? RemovalPolicy.DESTROY,
|
|
56
|
+
retentionPeriod: props.retentionInDays ? Duration.days(props.retentionInDays) : Duration.days(7),
|
|
57
57
|
visibilityTimeout: props.visibilityTimeoutInSecs
|
|
58
|
-
?
|
|
58
|
+
? Duration.seconds(props.visibilityTimeoutInSecs)
|
|
59
59
|
: props.visibilityTimeout,
|
|
60
60
|
})
|
|
61
61
|
|
|
62
62
|
if (props.tags && props.tags.length > 0) {
|
|
63
63
|
props.tags.forEach(tag => {
|
|
64
|
-
|
|
64
|
+
Tags.of(queue).add(tag.key, tag.value)
|
|
65
65
|
})
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
createCfnOutput(`${id}-queueArn`, scope, queue.queueArn)
|
|
69
|
+
createCfnOutput(`${id}-queueName`, scope, queue.queueName)
|
|
70
|
+
createCfnOutput(`${id}-queueUrl`, scope, queue.queueUrl)
|
|
71
71
|
|
|
72
72
|
return queue
|
|
73
73
|
}
|
|
@@ -98,7 +98,7 @@ export class SqsManager {
|
|
|
98
98
|
id: string,
|
|
99
99
|
scope: CommonConstruct,
|
|
100
100
|
props: LambdaProps,
|
|
101
|
-
deadLetterQueue:
|
|
101
|
+
deadLetterQueue: IQueue
|
|
102
102
|
) {
|
|
103
103
|
let queueProps
|
|
104
104
|
if (props.dlq) {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { Duration, RemovalPolicy, Stack, Tags } from 'aws-cdk-lib'
|
|
2
|
+
import { IDistribution } from 'aws-cdk-lib/aws-cloudfront'
|
|
3
|
+
import { Effect, PolicyDocument, PolicyStatement, ServicePrincipal } from 'aws-cdk-lib/aws-iam'
|
|
4
|
+
import { BlockPublicAccess, Bucket, BucketEncryption, CfnBucket, CfnBucketPolicy, IBucket } from 'aws-cdk-lib/aws-s3'
|
|
5
|
+
import { BucketDeployment, ISource, ServerSideEncryption, Source } from 'aws-cdk-lib/aws-s3-deployment'
|
|
6
|
+
import { CommonConstruct } from '../../common'
|
|
7
|
+
import { createCfnOutput } from '../../utils'
|
|
7
8
|
import { LifecycleRule, S3BucketProps } from './types'
|
|
8
|
-
import { CommonConstruct } from '../../../common'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @classdesc Provides operations on AWS S3
|
|
11
|
+
* @classdesc Provides operations on AWS S3
|
|
12
12
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
13
13
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
14
14
|
* @example
|
|
15
15
|
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
16
16
|
*
|
|
17
17
|
* class CustomConstruct extends CommonConstruct {
|
|
18
|
-
* constructor(parent:
|
|
18
|
+
* constructor(parent: Construct, id: string, props: common.CommonStackProps) {
|
|
19
19
|
* super(parent, id, props)
|
|
20
20
|
* this.props = props
|
|
21
21
|
* this.s3Manager.createS3Bucket('MyBucket', this)
|
|
@@ -36,12 +36,12 @@ export class S3Manager {
|
|
|
36
36
|
bucketLifecycleRules.push({
|
|
37
37
|
abortIncompleteMultipartUploadAfter: lifecycleRule.abortIncompleteMultipartUploadAfter,
|
|
38
38
|
enabled: lifecycleRule.enabled,
|
|
39
|
-
expiration: lifecycleRule.expirationInDays ?
|
|
39
|
+
expiration: lifecycleRule.expirationInDays ? Duration.days(lifecycleRule.expirationInDays) : undefined,
|
|
40
40
|
expirationDate: lifecycleRule.expirationDate,
|
|
41
41
|
expiredObjectDeleteMarker: lifecycleRule.expiredObjectDeleteMarker,
|
|
42
42
|
id: lifecycleRule.id,
|
|
43
43
|
noncurrentVersionExpiration: lifecycleRule.noncurrentVersionExpirationInDays
|
|
44
|
-
?
|
|
44
|
+
? Duration.days(lifecycleRule.noncurrentVersionExpirationInDays)
|
|
45
45
|
: undefined,
|
|
46
46
|
noncurrentVersionTransitions: lifecycleRule.noncurrentVersionTransitions,
|
|
47
47
|
prefix: lifecycleRule.prefix,
|
|
@@ -59,7 +59,7 @@ export class S3Manager {
|
|
|
59
59
|
* @param bucketName the bucket name
|
|
60
60
|
*/
|
|
61
61
|
protected static determineBucketNameByAccountAndRegion(scope: CommonConstruct, bucketName: string) {
|
|
62
|
-
return `${bucketName}-${
|
|
62
|
+
return `${bucketName}-${Stack.of(scope).account}-${scope.props.region}-${scope.props.stage}`
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -93,32 +93,32 @@ export class S3Manager {
|
|
|
93
93
|
public createS3Bucket(id: string, scope: CommonConstruct, props: S3BucketProps) {
|
|
94
94
|
if (!props) throw `S3 props undefined for ${id}`
|
|
95
95
|
|
|
96
|
-
let bucket:
|
|
96
|
+
let bucket: IBucket
|
|
97
97
|
|
|
98
98
|
const bucketName = S3Manager.determineBucketName(scope, props.bucketName)
|
|
99
99
|
|
|
100
100
|
if (props.existingBucket && props.bucketName) {
|
|
101
|
-
bucket =
|
|
101
|
+
bucket = Bucket.fromBucketName(scope, `${id}`, bucketName)
|
|
102
102
|
} else {
|
|
103
103
|
let logBucket
|
|
104
104
|
if (props.logBucketName) {
|
|
105
105
|
const logBucketName = S3Manager.determineBucketName(scope, props.logBucketName)
|
|
106
|
-
logBucket =
|
|
106
|
+
logBucket = Bucket.fromBucketName(scope, `${id}-logs`, logBucketName)
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
bucket = new
|
|
109
|
+
bucket = new Bucket(scope, `${id}-bucket`, {
|
|
110
110
|
accessControl: props.accessControl,
|
|
111
111
|
autoDeleteObjects: props.autoDeleteObjects,
|
|
112
|
-
blockPublicAccess: props.blockPublicAccess ||
|
|
112
|
+
blockPublicAccess: props.blockPublicAccess || BlockPublicAccess.BLOCK_ALL,
|
|
113
113
|
bucketName: bucketName,
|
|
114
114
|
cors: props.cors,
|
|
115
|
-
encryption: props.encryption ||
|
|
115
|
+
encryption: props.encryption || BucketEncryption.S3_MANAGED,
|
|
116
116
|
encryptionKey: props.encryptionKey,
|
|
117
117
|
lifecycleRules: this.determineBucketLifecycleRules(props),
|
|
118
118
|
metrics: props.metrics,
|
|
119
119
|
objectOwnership: props.objectOwnership,
|
|
120
120
|
publicReadAccess: props.publicReadAccess,
|
|
121
|
-
removalPolicy: props.removalPolicy ||
|
|
121
|
+
removalPolicy: props.removalPolicy || RemovalPolicy.RETAIN,
|
|
122
122
|
serverAccessLogsBucket: logBucket,
|
|
123
123
|
serverAccessLogsPrefix: props.serverAccessLogsPrefix,
|
|
124
124
|
versioned: props.versioned,
|
|
@@ -127,7 +127,7 @@ export class S3Manager {
|
|
|
127
127
|
websiteRoutingRules: props.websiteRoutingRules,
|
|
128
128
|
})
|
|
129
129
|
|
|
130
|
-
const cfnBucket = bucket.node.defaultChild as
|
|
130
|
+
const cfnBucket = bucket.node.defaultChild as CfnBucket
|
|
131
131
|
cfnBucket.notificationConfiguration = {
|
|
132
132
|
eventBridgeConfiguration: {
|
|
133
133
|
eventBridgeEnabled: props.enableEventBridge ?? false,
|
|
@@ -137,12 +137,12 @@ export class S3Manager {
|
|
|
137
137
|
|
|
138
138
|
if (props.tags && props.tags.length > 0) {
|
|
139
139
|
props.tags.forEach(tag => {
|
|
140
|
-
|
|
140
|
+
Tags.of(bucket).add(tag.key, tag.value)
|
|
141
141
|
})
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
createCfnOutput(`${id}-bucketName`, scope, bucket.bucketName)
|
|
145
|
+
createCfnOutput(`${id}-bucketArn`, scope, bucket.bucketArn)
|
|
146
146
|
|
|
147
147
|
return bucket
|
|
148
148
|
}
|
|
@@ -153,27 +153,27 @@ export class S3Manager {
|
|
|
153
153
|
* @param scope scope in which this resource is defined
|
|
154
154
|
* @param bucket
|
|
155
155
|
*/
|
|
156
|
-
public createBucketPolicyForCloudTrail(id: string, scope: CommonConstruct, bucket:
|
|
157
|
-
const bucketPolicyDocument = new
|
|
156
|
+
public createBucketPolicyForCloudTrail(id: string, scope: CommonConstruct, bucket: IBucket) {
|
|
157
|
+
const bucketPolicyDocument = new PolicyDocument({
|
|
158
158
|
statements: [
|
|
159
|
-
new
|
|
159
|
+
new PolicyStatement({
|
|
160
160
|
actions: ['s3:GetBucketAcl'],
|
|
161
|
-
effect:
|
|
162
|
-
principals: [new
|
|
161
|
+
effect: Effect.ALLOW,
|
|
162
|
+
principals: [new ServicePrincipal('cloudtrail.amazonaws.com')],
|
|
163
163
|
resources: [bucket.bucketArn],
|
|
164
164
|
sid: 'AWSCloudTrailAclCheck20150319',
|
|
165
165
|
}),
|
|
166
|
-
new
|
|
166
|
+
new PolicyStatement({
|
|
167
167
|
actions: ['s3:PutObject'],
|
|
168
|
-
effect:
|
|
169
|
-
principals: [new
|
|
168
|
+
effect: Effect.ALLOW,
|
|
169
|
+
principals: [new ServicePrincipal('cloudtrail.amazonaws.com')],
|
|
170
170
|
resources: [bucket.arnForObjects('*')],
|
|
171
171
|
sid: 'AWSCloudTrailWrite20150319',
|
|
172
172
|
}),
|
|
173
173
|
],
|
|
174
174
|
})
|
|
175
175
|
|
|
176
|
-
return new
|
|
176
|
+
return new CfnBucketPolicy(scope, `${id}`, {
|
|
177
177
|
bucket: bucket.bucketName,
|
|
178
178
|
policyDocument: bucketPolicyDocument,
|
|
179
179
|
})
|
|
@@ -192,20 +192,20 @@ export class S3Manager {
|
|
|
192
192
|
public doBucketDeployment(
|
|
193
193
|
id: string,
|
|
194
194
|
scope: CommonConstruct,
|
|
195
|
-
siteBucket:
|
|
196
|
-
distribution:
|
|
197
|
-
sources:
|
|
195
|
+
siteBucket: IBucket,
|
|
196
|
+
distribution: IDistribution,
|
|
197
|
+
sources: ISource[],
|
|
198
198
|
prefix: string,
|
|
199
199
|
prune?: boolean
|
|
200
200
|
) {
|
|
201
|
-
new
|
|
201
|
+
new BucketDeployment(scope, `${id}`, {
|
|
202
202
|
destinationBucket: siteBucket,
|
|
203
203
|
destinationKeyPrefix: prefix,
|
|
204
204
|
distribution: distribution,
|
|
205
205
|
distributionPaths: ['/*'],
|
|
206
206
|
memoryLimit: 1024,
|
|
207
207
|
prune: !!prune,
|
|
208
|
-
serverSideEncryption:
|
|
208
|
+
serverSideEncryption: ServerSideEncryption.AES_256,
|
|
209
209
|
sources: sources,
|
|
210
210
|
})
|
|
211
211
|
}
|
|
@@ -217,17 +217,17 @@ export class S3Manager {
|
|
|
217
217
|
* @param bucket bucket to create the folders in
|
|
218
218
|
* @param folders list of folder names to be created in the bucket
|
|
219
219
|
*/
|
|
220
|
-
public createBucketFolders(id: string, scope: CommonConstruct, bucket:
|
|
220
|
+
public createBucketFolders(id: string, scope: CommonConstruct, bucket: IBucket, folders: string[]) {
|
|
221
221
|
if (!folders || folders.length == 0) {
|
|
222
222
|
throw `Folder unspecified for ${id}`
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
folders.forEach(folder => {
|
|
226
|
-
new
|
|
226
|
+
new BucketDeployment(scope, `${id}-${folder}`, {
|
|
227
227
|
destinationBucket: bucket,
|
|
228
228
|
destinationKeyPrefix: folder,
|
|
229
229
|
prune: false,
|
|
230
|
-
sources: [
|
|
230
|
+
sources: [Source.data('README.md', `This is the ${folder} folder for ${id}`)],
|
|
231
231
|
})
|
|
232
232
|
})
|
|
233
233
|
}
|
|
@@ -1,16 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { Duration } from 'aws-cdk-lib'
|
|
2
|
+
import { IRestApi } from 'aws-cdk-lib/aws-apigateway'
|
|
3
|
+
import { ITable } from 'aws-cdk-lib/aws-dynamodb'
|
|
4
|
+
import { IRole } from 'aws-cdk-lib/aws-iam'
|
|
5
|
+
import { IFunction } from 'aws-cdk-lib/aws-lambda'
|
|
6
|
+
import { ILogGroup } from 'aws-cdk-lib/aws-logs'
|
|
7
|
+
import { IQueue } from 'aws-cdk-lib/aws-sqs'
|
|
8
|
+
import {
|
|
9
|
+
Choice,
|
|
10
|
+
DefinitionBody,
|
|
11
|
+
Fail,
|
|
12
|
+
IChainable,
|
|
13
|
+
IStateMachine,
|
|
14
|
+
LogLevel,
|
|
15
|
+
Map,
|
|
16
|
+
Parallel,
|
|
17
|
+
Pass,
|
|
18
|
+
StateMachine,
|
|
19
|
+
Succeed,
|
|
20
|
+
Wait,
|
|
21
|
+
WaitTime,
|
|
22
|
+
} from 'aws-cdk-lib/aws-stepfunctions'
|
|
23
|
+
import {
|
|
24
|
+
CallApiGatewayRestApiEndpoint,
|
|
25
|
+
DynamoAttributeValue,
|
|
26
|
+
DynamoDeleteItem,
|
|
27
|
+
DynamoGetItem,
|
|
28
|
+
DynamoPutItem,
|
|
29
|
+
LambdaInvoke,
|
|
30
|
+
SqsSendMessage,
|
|
31
|
+
StepFunctionsStartExecution,
|
|
32
|
+
} from 'aws-cdk-lib/aws-stepfunctions-tasks'
|
|
12
33
|
import { v4 as uuidv4 } from 'uuid'
|
|
13
|
-
import { CommonConstruct } from '
|
|
34
|
+
import { CommonConstruct } from '../../common'
|
|
35
|
+
import { createCfnOutput } from '../../utils'
|
|
14
36
|
import {
|
|
15
37
|
SfnCallApiGatewayRestApiEndpointProps,
|
|
16
38
|
SfnChoiceProps,
|
|
@@ -46,7 +68,7 @@ const DEFAULT_RETRY_CONFIG = [
|
|
|
46
68
|
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
47
69
|
*
|
|
48
70
|
* class CustomConstruct extends CommonConstruct {
|
|
49
|
-
* constructor(parent:
|
|
71
|
+
* constructor(parent: Construct, id: string, props: common.CommonStackProps) {
|
|
50
72
|
* super(parent, id, props)
|
|
51
73
|
* this.props = props
|
|
52
74
|
* this.sfnManager.createSuccessStep('MyStep', this, myStepProps)
|
|
@@ -63,7 +85,7 @@ export class SfnManager {
|
|
|
63
85
|
*/
|
|
64
86
|
public createSuccessStep(id: string, scope: CommonConstruct, props: SfnSucceedProps) {
|
|
65
87
|
if (!props) throw `Step props undefined for ${id}`
|
|
66
|
-
return new
|
|
88
|
+
return new Succeed(scope, `${props.name}`, {
|
|
67
89
|
...props,
|
|
68
90
|
...{
|
|
69
91
|
comment: `Succeed step for ${props.name} - ${scope.props.stage} stage`,
|
|
@@ -79,7 +101,7 @@ export class SfnManager {
|
|
|
79
101
|
*/
|
|
80
102
|
public createFailStep(id: string, scope: CommonConstruct, props: SfnFailProps) {
|
|
81
103
|
if (!props) throw `Step props undefined for ${id}`
|
|
82
|
-
return new
|
|
104
|
+
return new Fail(scope, `${props.name}`, {
|
|
83
105
|
...props,
|
|
84
106
|
...{
|
|
85
107
|
comment: `Fail step for ${props.name} - ${scope.props.stage} stage`,
|
|
@@ -95,7 +117,7 @@ export class SfnManager {
|
|
|
95
117
|
*/
|
|
96
118
|
public createPassStep(id: string, scope: CommonConstruct, props: SfnPassProps) {
|
|
97
119
|
if (!props) throw `Step props undefined for ${id}`
|
|
98
|
-
return new
|
|
120
|
+
return new Pass(scope, `${props.name}`, {
|
|
99
121
|
...props,
|
|
100
122
|
...{
|
|
101
123
|
comment: `Pass step for ${props.name} - ${scope.props.stage} stage`,
|
|
@@ -111,7 +133,7 @@ export class SfnManager {
|
|
|
111
133
|
*/
|
|
112
134
|
public createParallelStep(id: string, scope: CommonConstruct, props: SfnParallelProps) {
|
|
113
135
|
if (!props) throw `Step props undefined for ${id}`
|
|
114
|
-
return new
|
|
136
|
+
return new Parallel(scope, `${props.name}`, {
|
|
115
137
|
...props,
|
|
116
138
|
...{
|
|
117
139
|
comment: `Parallel step for ${props.name} - ${scope.props.stage} stage`,
|
|
@@ -127,7 +149,7 @@ export class SfnManager {
|
|
|
127
149
|
*/
|
|
128
150
|
public createChoiceStep(id: string, scope: CommonConstruct, props: SfnChoiceProps) {
|
|
129
151
|
if (!props) throw `Step props undefined for ${id}`
|
|
130
|
-
return new
|
|
152
|
+
return new Choice(scope, `${props.name}`, {
|
|
131
153
|
...props,
|
|
132
154
|
...{
|
|
133
155
|
comment: `Choice step for ${props.name} - ${scope.props.stage} stage`,
|
|
@@ -142,11 +164,11 @@ export class SfnManager {
|
|
|
142
164
|
* @param props
|
|
143
165
|
*/
|
|
144
166
|
public createWaitStep(id: string, scope: CommonConstruct, props: SfnWaitProps) {
|
|
145
|
-
return new
|
|
167
|
+
return new Wait(scope, `${props.name}`, {
|
|
146
168
|
...props,
|
|
147
169
|
...{
|
|
148
170
|
comment: `Choice step for ${props.name} - ${scope.props.stage} stage`,
|
|
149
|
-
time:
|
|
171
|
+
time: WaitTime.duration(Duration.seconds(props.delayInSeconds)),
|
|
150
172
|
},
|
|
151
173
|
})
|
|
152
174
|
}
|
|
@@ -163,11 +185,11 @@ export class SfnManager {
|
|
|
163
185
|
id: string,
|
|
164
186
|
scope: CommonConstruct,
|
|
165
187
|
props: SfnDynamoGetItemProps,
|
|
166
|
-
table:
|
|
167
|
-
tableKey: { [key: string]:
|
|
188
|
+
table: ITable,
|
|
189
|
+
tableKey: { [key: string]: DynamoAttributeValue }
|
|
168
190
|
) {
|
|
169
191
|
if (!props) throw `Step props undefined for ${id}`
|
|
170
|
-
const step = new
|
|
192
|
+
const step = new DynamoGetItem(scope, `${props.name}`, {
|
|
171
193
|
...props,
|
|
172
194
|
...{
|
|
173
195
|
comment: `DynamoDB GetItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
@@ -195,7 +217,7 @@ export class SfnManager {
|
|
|
195
217
|
retries.forEach(retry =>
|
|
196
218
|
step.addRetry({
|
|
197
219
|
...retry,
|
|
198
|
-
...{ interval: retry.intervalInSecs ?
|
|
220
|
+
...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
|
|
199
221
|
})
|
|
200
222
|
)
|
|
201
223
|
|
|
@@ -214,11 +236,11 @@ export class SfnManager {
|
|
|
214
236
|
id: string,
|
|
215
237
|
scope: CommonConstruct,
|
|
216
238
|
props: SfnDynamoPutItemProps,
|
|
217
|
-
table:
|
|
218
|
-
tableItem: { [key: string]:
|
|
239
|
+
table: ITable,
|
|
240
|
+
tableItem: { [key: string]: DynamoAttributeValue }
|
|
219
241
|
) {
|
|
220
242
|
if (!props) throw `Step props undefined for ${id}`
|
|
221
|
-
const step = new
|
|
243
|
+
const step = new DynamoPutItem(scope, `${props.name}`, {
|
|
222
244
|
...props,
|
|
223
245
|
...{
|
|
224
246
|
comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
@@ -248,7 +270,7 @@ export class SfnManager {
|
|
|
248
270
|
retries.forEach(retry =>
|
|
249
271
|
step.addRetry({
|
|
250
272
|
...retry,
|
|
251
|
-
...{ interval: retry.intervalInSecs ?
|
|
273
|
+
...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
|
|
252
274
|
})
|
|
253
275
|
)
|
|
254
276
|
|
|
@@ -267,11 +289,11 @@ export class SfnManager {
|
|
|
267
289
|
id: string,
|
|
268
290
|
scope: CommonConstruct,
|
|
269
291
|
props: SfnDynamoDeleteItemProps,
|
|
270
|
-
table:
|
|
271
|
-
tableKey: { [key: string]:
|
|
292
|
+
table: ITable,
|
|
293
|
+
tableKey: { [key: string]: DynamoAttributeValue }
|
|
272
294
|
) {
|
|
273
295
|
if (!props) throw `Step props undefined for ${id}`
|
|
274
|
-
const step = new
|
|
296
|
+
const step = new DynamoDeleteItem(scope, `${props.name}`, {
|
|
275
297
|
...props,
|
|
276
298
|
...{
|
|
277
299
|
comment: `DynamoDB DeleteItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
@@ -301,7 +323,7 @@ export class SfnManager {
|
|
|
301
323
|
retries.forEach(retry =>
|
|
302
324
|
step.addRetry({
|
|
303
325
|
...retry,
|
|
304
|
-
...{ interval: retry.intervalInSecs ?
|
|
326
|
+
...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
|
|
305
327
|
})
|
|
306
328
|
)
|
|
307
329
|
|
|
@@ -315,15 +337,10 @@ export class SfnManager {
|
|
|
315
337
|
* @param props
|
|
316
338
|
* @param queue The queue to send the message to
|
|
317
339
|
*/
|
|
318
|
-
public createSendSqsMessageStep(
|
|
319
|
-
id: string,
|
|
320
|
-
scope: CommonConstruct,
|
|
321
|
-
props: SfnSqsSendMessageProps,
|
|
322
|
-
queue: sqs.IQueue
|
|
323
|
-
) {
|
|
340
|
+
public createSendSqsMessageStep(id: string, scope: CommonConstruct, props: SfnSqsSendMessageProps, queue: IQueue) {
|
|
324
341
|
if (!props) throw `Step props undefined for ${id}`
|
|
325
342
|
if (!props.messageBody) throw 'Message body undefined'
|
|
326
|
-
const step = new
|
|
343
|
+
const step = new SqsSendMessage(scope, `${props.name}`, {
|
|
327
344
|
...props,
|
|
328
345
|
...{
|
|
329
346
|
comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
@@ -350,7 +367,7 @@ export class SfnManager {
|
|
|
350
367
|
retries.forEach(retry =>
|
|
351
368
|
step.addRetry({
|
|
352
369
|
...retry,
|
|
353
|
-
...{ interval: retry.intervalInSecs ?
|
|
370
|
+
...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
|
|
354
371
|
})
|
|
355
372
|
)
|
|
356
373
|
|
|
@@ -364,14 +381,9 @@ export class SfnManager {
|
|
|
364
381
|
* @param props
|
|
365
382
|
* @param lambdaFunction
|
|
366
383
|
*/
|
|
367
|
-
public createLambdaStep(
|
|
368
|
-
id: string,
|
|
369
|
-
scope: CommonConstruct,
|
|
370
|
-
props: SfnLambdaInvokeProps,
|
|
371
|
-
lambdaFunction: lambda.IFunction
|
|
372
|
-
) {
|
|
384
|
+
public createLambdaStep(id: string, scope: CommonConstruct, props: SfnLambdaInvokeProps, lambdaFunction: IFunction) {
|
|
373
385
|
if (!props) throw `Step props undefined for ${id}`
|
|
374
|
-
const step = new
|
|
386
|
+
const step = new LambdaInvoke(scope, `${props.name}`, {
|
|
375
387
|
...props,
|
|
376
388
|
...{
|
|
377
389
|
comment: `Lambda step for ${props.name} - ${scope.props.stage} stage`,
|
|
@@ -387,7 +399,7 @@ export class SfnManager {
|
|
|
387
399
|
retries.forEach(retry =>
|
|
388
400
|
step.addRetry({
|
|
389
401
|
...retry,
|
|
390
|
-
...{ interval: retry.intervalInSecs ?
|
|
402
|
+
...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
|
|
391
403
|
})
|
|
392
404
|
)
|
|
393
405
|
|
|
@@ -406,12 +418,12 @@ export class SfnManager {
|
|
|
406
418
|
id: string,
|
|
407
419
|
scope: CommonConstruct,
|
|
408
420
|
props: SfnLambdaInvokeProps,
|
|
409
|
-
lambdaFunction:
|
|
421
|
+
lambdaFunction: IFunction,
|
|
410
422
|
skipExecution?: boolean
|
|
411
423
|
) {
|
|
412
424
|
if (!props) throw `Step props undefined for ${id}`
|
|
413
|
-
if (skipExecution) return this.createPassStep(id, scope, {
|
|
414
|
-
const step = new
|
|
425
|
+
if (skipExecution) return this.createPassStep(id, scope, { comment: props.comment, name: props.name })
|
|
426
|
+
const step = new LambdaInvoke(scope, `${props.name}`, {
|
|
415
427
|
...props,
|
|
416
428
|
...{
|
|
417
429
|
comment: `Lambda step for ${props.name} - ${scope.props.stage} stage`,
|
|
@@ -427,7 +439,7 @@ export class SfnManager {
|
|
|
427
439
|
retries.forEach(retry =>
|
|
428
440
|
step.addRetry({
|
|
429
441
|
...retry,
|
|
430
|
-
...{ interval: retry.intervalInSecs ?
|
|
442
|
+
...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
|
|
431
443
|
})
|
|
432
444
|
)
|
|
433
445
|
|
|
@@ -445,10 +457,10 @@ export class SfnManager {
|
|
|
445
457
|
id: string,
|
|
446
458
|
scope: CommonConstruct,
|
|
447
459
|
props: SfnCallApiGatewayRestApiEndpointProps,
|
|
448
|
-
api:
|
|
460
|
+
api: IRestApi
|
|
449
461
|
) {
|
|
450
462
|
if (!props) throw `Step props undefined for ${id}`
|
|
451
|
-
const step = new
|
|
463
|
+
const step = new CallApiGatewayRestApiEndpoint(scope, `${props.name}`, {
|
|
452
464
|
...props,
|
|
453
465
|
...{
|
|
454
466
|
api,
|
|
@@ -465,7 +477,7 @@ export class SfnManager {
|
|
|
465
477
|
retries.forEach(retry =>
|
|
466
478
|
step.addRetry({
|
|
467
479
|
...retry,
|
|
468
|
-
...{ interval: retry.intervalInSecs ?
|
|
480
|
+
...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
|
|
469
481
|
})
|
|
470
482
|
)
|
|
471
483
|
|
|
@@ -483,9 +495,9 @@ export class SfnManager {
|
|
|
483
495
|
id: string,
|
|
484
496
|
scope: CommonConstruct,
|
|
485
497
|
props: SfnStartExecutionProps,
|
|
486
|
-
stateMachine:
|
|
498
|
+
stateMachine: IStateMachine
|
|
487
499
|
) {
|
|
488
|
-
const step = new
|
|
500
|
+
const step = new StepFunctionsStartExecution(scope, `${id}`, {
|
|
489
501
|
...props,
|
|
490
502
|
associateWithParent: props.associateWithParent ?? true,
|
|
491
503
|
inputPath: props.inputPath,
|
|
@@ -501,7 +513,7 @@ export class SfnManager {
|
|
|
501
513
|
retries.forEach(retry =>
|
|
502
514
|
step.addRetry({
|
|
503
515
|
...retry,
|
|
504
|
-
...{ interval: retry.intervalInSecs ?
|
|
516
|
+
...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
|
|
505
517
|
})
|
|
506
518
|
)
|
|
507
519
|
|
|
@@ -515,7 +527,7 @@ export class SfnManager {
|
|
|
515
527
|
* @param props props for the map state
|
|
516
528
|
*/
|
|
517
529
|
public createMapState(id: string, scope: CommonConstruct, props: SfnMapProps) {
|
|
518
|
-
return new
|
|
530
|
+
return new Map(scope, `${id}`, props)
|
|
519
531
|
}
|
|
520
532
|
|
|
521
533
|
/**
|
|
@@ -531,17 +543,17 @@ export class SfnManager {
|
|
|
531
543
|
id: string,
|
|
532
544
|
scope: CommonConstruct,
|
|
533
545
|
props: SfnStateMachineProps,
|
|
534
|
-
definition:
|
|
535
|
-
logGroup:
|
|
536
|
-
role?:
|
|
546
|
+
definition: IChainable,
|
|
547
|
+
logGroup: ILogGroup,
|
|
548
|
+
role?: IRole
|
|
537
549
|
) {
|
|
538
550
|
if (!props) throw `State Machine props undefined for ${id}`
|
|
539
|
-
const stateMachine = new
|
|
551
|
+
const stateMachine = new StateMachine(scope, `${id}`, {
|
|
540
552
|
definitionBody: DefinitionBody.fromChainable(definition),
|
|
541
553
|
logs: {
|
|
542
554
|
destination: logGroup,
|
|
543
555
|
includeExecutionData: props.logs?.includeExecutionData ?? true,
|
|
544
|
-
level: props.logs?.level ??
|
|
556
|
+
level: props.logs?.level ?? LogLevel.ALL,
|
|
545
557
|
},
|
|
546
558
|
role,
|
|
547
559
|
stateMachineName: `${props.stateMachineName}-${scope.props.stage}`,
|
|
@@ -550,8 +562,8 @@ export class SfnManager {
|
|
|
550
562
|
tracingEnabled: props.tracingEnabled,
|
|
551
563
|
})
|
|
552
564
|
|
|
553
|
-
|
|
554
|
-
|
|
565
|
+
createCfnOutput(`${id}-stateMachineName`, scope, stateMachine.stateMachineName)
|
|
566
|
+
createCfnOutput(`${id}-stateMachineArn`, scope, stateMachine.stateMachineArn)
|
|
555
567
|
|
|
556
568
|
return stateMachine
|
|
557
569
|
}
|