@gradientedge/cdk-utils 8.88.0 → 8.90.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.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/src/lib/common/construct.d.ts +4 -4
- package/dist/src/lib/common/construct.js +1 -1
- package/dist/src/lib/common/index.d.ts +1 -0
- package/dist/src/lib/common/index.js +1 -0
- package/dist/src/lib/common/stack.d.ts +1 -1
- package/dist/src/lib/common/types.d.ts +22 -0
- package/dist/src/lib/common/types.js +2 -0
- package/dist/src/lib/{helper/api-to-eventbridge-target-rest-api.d.ts → construct/api-to-eventbridge-target/api.d.ts} +2 -2
- package/dist/src/lib/{helper/api-to-eventbridge-target-event.d.ts → construct/api-to-eventbridge-target/event.d.ts} +2 -2
- package/dist/src/lib/construct/api-to-eventbridge-target/index.d.ts +3 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/index.js +3 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +5 -5
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +4 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/types.d.ts +112 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/types.js +2 -0
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +3 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/index.d.ts +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/index.js +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +7 -6
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +3 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.d.ts +26 -0
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.js +2 -0
- package/dist/src/lib/{helper/api-to-lambda-target-rest-api.d.ts → construct/api-to-lambda-target/api.d.ts} +2 -2
- package/dist/src/lib/construct/api-to-lambda-target/index.d.ts +2 -0
- package/dist/src/lib/construct/api-to-lambda-target/index.js +2 -0
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +4 -4
- package/dist/src/lib/construct/api-to-lambda-target/main.js +2 -2
- package/dist/src/lib/construct/api-to-lambda-target/types.d.ts +68 -0
- package/dist/src/lib/construct/api-to-lambda-target/types.js +2 -0
- package/dist/src/lib/construct/graphql-api-lambda/index.d.ts +1 -0
- package/dist/src/lib/construct/graphql-api-lambda/index.js +1 -0
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +1 -1
- package/dist/src/lib/construct/graphql-api-lambda/types.d.ts +30 -0
- package/dist/src/lib/construct/graphql-api-lambda/types.js +2 -0
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/index.d.ts +1 -0
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/index.js +1 -0
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +1 -1
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.d.ts +15 -0
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.js +2 -0
- package/dist/src/lib/construct/lambda-with-iam-access/types.d.ts +2 -1
- package/dist/src/lib/construct/rest-api-lambda/index.d.ts +1 -0
- package/dist/src/lib/construct/rest-api-lambda/index.js +1 -0
- package/dist/src/lib/construct/rest-api-lambda/main.d.ts +1 -1
- package/dist/src/lib/construct/rest-api-lambda/types.d.ts +28 -0
- package/dist/src/lib/construct/rest-api-lambda/types.js +2 -0
- package/dist/src/lib/construct/rest-api-lambda-with-cache/index.d.ts +1 -0
- package/dist/src/lib/construct/rest-api-lambda-with-cache/index.js +1 -0
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +1 -1
- package/dist/src/lib/construct/rest-api-lambda-with-cache/types.d.ts +14 -0
- package/dist/src/lib/construct/rest-api-lambda-with-cache/types.js +2 -0
- package/dist/src/lib/construct/site-with-ecs-backend/index.d.ts +1 -0
- package/dist/src/lib/construct/site-with-ecs-backend/index.js +1 -0
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +1 -1
- package/dist/src/lib/construct/site-with-ecs-backend/types.d.ts +30 -0
- package/dist/src/lib/construct/site-with-ecs-backend/types.js +2 -0
- package/dist/src/lib/construct/static-asset-deployment/types.d.ts +2 -1
- package/dist/src/lib/construct/static-site/index.d.ts +1 -0
- package/dist/src/lib/construct/static-site/index.js +1 -0
- package/dist/src/lib/construct/static-site/main.d.ts +1 -1
- package/dist/src/lib/construct/static-site/types.d.ts +26 -0
- package/dist/src/lib/construct/static-site/types.js +2 -0
- package/dist/src/lib/index.d.ts +5 -0
- package/dist/src/lib/index.js +21 -0
- package/dist/src/lib/services/aws/api-gateway/index.d.ts +2 -0
- package/dist/src/lib/{helper → services/aws/api-gateway}/index.js +2 -3
- package/dist/src/lib/{manager/aws/api-manager.d.ts → services/aws/api-gateway/main.d.ts} +14 -14
- package/dist/src/lib/{manager/aws/api-manager.js → services/aws/api-gateway/main.js} +13 -10
- package/dist/src/lib/services/aws/api-gateway/types.d.ts +9 -0
- package/dist/src/lib/services/aws/api-gateway/types.js +2 -0
- package/dist/src/lib/services/aws/appconfig/constants.d.ts +18 -0
- package/dist/src/lib/services/aws/appconfig/constants.js +60 -0
- package/dist/src/lib/services/aws/appconfig/index.d.ts +3 -0
- package/dist/src/lib/services/aws/appconfig/index.js +19 -0
- package/dist/src/lib/services/aws/appconfig/main.d.ts +58 -0
- package/dist/src/lib/{manager/aws/app-config-manager.js → services/aws/appconfig/main.js} +25 -43
- package/dist/src/lib/services/aws/appconfig/types.d.ts +13 -0
- package/dist/src/lib/services/aws/appconfig/types.js +2 -0
- package/dist/src/lib/services/aws/certificate-manager/index.d.ts +2 -0
- package/dist/src/lib/services/aws/certificate-manager/index.js +18 -0
- package/dist/src/lib/{manager/aws/acm-manager.d.ts → services/aws/certificate-manager/main.d.ts} +7 -7
- package/dist/src/lib/{manager/aws/acm-manager.js → services/aws/certificate-manager/main.js} +5 -5
- package/dist/src/lib/services/aws/certificate-manager/types.d.ts +13 -0
- package/dist/src/lib/services/aws/certificate-manager/types.js +2 -0
- package/dist/src/lib/services/aws/cloudfront/index.d.ts +2 -0
- package/dist/src/lib/services/aws/cloudfront/index.js +18 -0
- package/dist/src/lib/{manager/aws/cloudfront-manager.d.ts → services/aws/cloudfront/main.d.ts} +24 -23
- package/dist/src/lib/{manager/aws/cloudfront-manager.js → services/aws/cloudfront/main.js} +16 -16
- package/dist/src/lib/services/aws/cloudfront/types.d.ts +25 -0
- package/dist/src/lib/services/aws/cloudfront/types.js +2 -0
- package/dist/src/lib/services/aws/cloudtrail/index.d.ts +2 -0
- package/dist/src/lib/services/aws/cloudtrail/index.js +18 -0
- package/dist/src/lib/{manager/aws/cloudtrail-manager.d.ts → services/aws/cloudtrail/main.d.ts} +9 -9
- package/dist/src/lib/{manager/aws/cloudtrail-manager.js → services/aws/cloudtrail/main.js} +7 -7
- package/dist/src/lib/services/aws/cloudtrail/types.d.ts +7 -0
- package/dist/src/lib/services/aws/cloudtrail/types.js +2 -0
- package/dist/src/lib/services/aws/cloudwatch/index.d.ts +3 -0
- package/dist/src/lib/services/aws/cloudwatch/index.js +19 -0
- package/dist/src/lib/{manager/aws/log-manager.d.ts → services/aws/cloudwatch/logs.d.ts} +15 -15
- package/dist/src/lib/{manager/aws/log-manager.js → services/aws/cloudwatch/logs.js} +11 -11
- package/dist/src/lib/services/aws/cloudwatch/main.d.ts +211 -0
- package/dist/src/lib/{manager/aws/cloudwatch-manager.js → services/aws/cloudwatch/main.js} +48 -48
- package/dist/src/lib/services/aws/cloudwatch/types.d.ts +111 -0
- package/dist/src/lib/services/aws/cloudwatch/types.js +2 -0
- package/dist/src/lib/services/aws/codebuild/index.d.ts +1 -0
- package/dist/src/lib/services/aws/codebuild/index.js +17 -0
- package/dist/src/lib/{manager/aws/codebuild-manager.d.ts → services/aws/codebuild/main.d.ts} +7 -7
- package/dist/src/lib/{manager/aws/codebuild-manager.js → services/aws/codebuild/main.js} +4 -4
- package/dist/src/lib/services/aws/constants.d.ts +4 -0
- package/dist/src/lib/services/aws/constants.js +8 -0
- package/dist/src/lib/services/aws/dynamodb/index.d.ts +2 -0
- package/dist/src/lib/services/aws/dynamodb/index.js +18 -0
- package/dist/src/lib/{manager/aws/dynamodb-manager.d.ts → services/aws/dynamodb/main.d.ts} +7 -7
- package/dist/src/lib/{manager/aws/dynamodb-manager.js → services/aws/dynamodb/main.js} +5 -5
- package/dist/src/lib/services/aws/dynamodb/types.d.ts +9 -0
- package/dist/src/lib/services/aws/dynamodb/types.js +2 -0
- package/dist/src/lib/services/aws/elastic-container-registry/index.d.ts +1 -0
- package/dist/src/lib/services/aws/elastic-container-registry/index.js +17 -0
- package/dist/src/lib/{manager/aws/ecr-manager.d.ts → services/aws/elastic-container-registry/main.d.ts} +7 -7
- package/dist/src/lib/{manager/aws/ecr-manager.js → services/aws/elastic-container-registry/main.js} +6 -6
- package/dist/src/lib/services/aws/elastic-container-service/index.d.ts +2 -0
- package/dist/src/lib/services/aws/elastic-container-service/index.js +18 -0
- package/dist/src/lib/{manager/aws/ecs-manager.d.ts → services/aws/elastic-container-service/main.d.ts} +15 -15
- package/dist/src/lib/{manager/aws/ecs-manager.js → services/aws/elastic-container-service/main.js} +11 -11
- package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +46 -0
- package/dist/src/lib/services/aws/elastic-container-service/types.js +2 -0
- package/dist/src/lib/services/aws/elastic-file-system/index.d.ts +2 -0
- package/dist/src/lib/services/aws/elastic-file-system/index.js +18 -0
- package/dist/src/lib/{manager/aws/efs-manager.d.ts → services/aws/elastic-file-system/main.d.ts} +10 -10
- package/dist/src/lib/{manager/aws/efs-manager.js → services/aws/elastic-file-system/main.js} +8 -8
- package/dist/src/lib/services/aws/elastic-file-system/types.d.ts +19 -0
- package/dist/src/lib/services/aws/elastic-file-system/types.js +2 -0
- package/dist/src/lib/services/aws/elastic-kubernetes-service/index.d.ts +2 -0
- package/dist/src/lib/services/aws/elastic-kubernetes-service/index.js +18 -0
- package/dist/src/lib/{manager/aws/eks-manager.d.ts → services/aws/elastic-kubernetes-service/main.d.ts} +9 -9
- package/dist/src/lib/{manager/aws/eks-manager.js → services/aws/elastic-kubernetes-service/main.js} +7 -7
- package/dist/src/lib/services/aws/elastic-kubernetes-service/types.d.ts +9 -0
- package/dist/src/lib/services/aws/elastic-kubernetes-service/types.js +2 -0
- package/dist/src/lib/services/aws/elasticache/index.d.ts +2 -0
- package/dist/src/lib/services/aws/elasticache/index.js +18 -0
- package/dist/src/lib/services/aws/elasticache/main.d.ts +51 -0
- package/dist/src/lib/{manager/aws/elasticache-manager.js → services/aws/elasticache/main.js} +11 -12
- package/dist/src/lib/services/aws/elasticache/types.d.ts +13 -0
- package/dist/src/lib/services/aws/elasticache/types.js +2 -0
- package/dist/src/lib/services/aws/eventbridge/index.d.ts +3 -0
- package/dist/src/lib/services/aws/eventbridge/index.js +19 -0
- package/dist/src/lib/{manager/aws/event-manager.d.ts → services/aws/eventbridge/main.d.ts} +20 -20
- package/dist/src/lib/{manager/aws/event-manager.js → services/aws/eventbridge/main.js} +21 -15
- package/dist/src/lib/{manager/aws/event-target-manager.d.ts → services/aws/eventbridge/target.d.ts} +7 -7
- package/dist/src/lib/{manager/aws/event-target-manager.js → services/aws/eventbridge/target.js} +5 -5
- package/dist/src/lib/services/aws/eventbridge/types.d.ts +35 -0
- package/dist/src/lib/services/aws/eventbridge/types.js +2 -0
- package/dist/src/lib/services/aws/evidently/index.d.ts +2 -0
- package/dist/src/lib/services/aws/evidently/index.js +18 -0
- package/dist/src/lib/{manager/aws/evidently-manager.d.ts → services/aws/evidently/main.d.ts} +16 -16
- package/dist/src/lib/{manager/aws/evidently-manager.js → services/aws/evidently/main.js} +10 -10
- package/dist/src/lib/services/aws/evidently/types.d.ts +31 -0
- package/dist/src/lib/services/aws/evidently/types.js +2 -0
- package/dist/src/lib/services/aws/identity-access-management/index.d.ts +1 -0
- package/dist/src/lib/services/aws/identity-access-management/index.js +17 -0
- package/dist/src/lib/{manager/aws/iam-manager.d.ts → services/aws/identity-access-management/main.d.ts} +39 -40
- package/dist/src/lib/{manager/aws/iam-manager.js → services/aws/identity-access-management/main.js} +22 -23
- package/dist/src/lib/services/aws/index.d.ts +28 -0
- package/dist/src/lib/services/aws/index.js +44 -0
- package/dist/src/lib/services/aws/key-management-service/index.d.ts +2 -0
- package/dist/src/lib/services/aws/key-management-service/index.js +18 -0
- package/dist/src/lib/{manager/aws/kms-manager.d.ts → services/aws/key-management-service/main.d.ts} +7 -7
- package/dist/src/lib/{manager/aws/kms-manager.js → services/aws/key-management-service/main.js} +5 -5
- package/dist/src/lib/services/aws/key-management-service/types.d.ts +7 -0
- package/dist/src/lib/services/aws/key-management-service/types.js +2 -0
- package/dist/src/lib/services/aws/lambda/index.d.ts +2 -0
- package/dist/src/lib/services/aws/lambda/index.js +18 -0
- package/dist/src/lib/{manager/aws/lambda-manager.d.ts → services/aws/lambda/main.d.ts} +22 -21
- package/dist/src/lib/{manager/aws/lambda-manager.js → services/aws/lambda/main.js} +21 -21
- package/dist/src/lib/services/aws/lambda/types.d.ts +52 -0
- package/dist/src/lib/services/aws/lambda/types.js +2 -0
- package/dist/src/lib/services/aws/route53/index.d.ts +2 -0
- package/dist/src/lib/services/aws/route53/index.js +18 -0
- package/dist/src/lib/{manager/aws/route53-manager.d.ts → services/aws/route53/main.d.ts} +17 -17
- package/dist/src/lib/{manager/aws/route53-manager.js → services/aws/route53/main.js} +11 -11
- package/dist/src/lib/services/aws/route53/types.d.ts +8 -0
- package/dist/src/lib/services/aws/route53/types.js +2 -0
- package/dist/src/lib/services/aws/secrets-manager/index.d.ts +1 -0
- package/dist/src/lib/services/aws/secrets-manager/index.js +17 -0
- package/dist/src/lib/{manager/aws/secrets-manager.d.ts → services/aws/secrets-manager/main.d.ts} +8 -8
- package/dist/src/lib/{manager/aws/secrets-manager.js → services/aws/secrets-manager/main.js} +6 -6
- package/dist/src/lib/services/aws/simple-notification-service/index.d.ts +2 -0
- package/dist/src/lib/services/aws/simple-notification-service/index.js +18 -0
- package/dist/src/lib/{manager/aws/sns-manager.d.ts → services/aws/simple-notification-service/main.d.ts} +13 -13
- package/dist/src/lib/{manager/aws/sns-manager.js → services/aws/simple-notification-service/main.js} +10 -10
- package/dist/src/lib/services/aws/simple-notification-service/types.d.ts +7 -0
- package/dist/src/lib/services/aws/simple-notification-service/types.js +2 -0
- package/dist/src/lib/services/aws/simple-queue-service/index.d.ts +2 -0
- package/dist/src/lib/services/aws/simple-queue-service/index.js +18 -0
- package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +50 -0
- package/dist/src/lib/{manager/aws/sqs-manager.js → services/aws/simple-queue-service/main.js} +11 -11
- package/dist/src/lib/services/aws/simple-queue-service/types.d.ts +17 -0
- package/dist/src/lib/services/aws/simple-queue-service/types.js +2 -0
- package/dist/src/lib/services/aws/simple-storage-service/index.d.ts +2 -0
- package/dist/src/lib/services/aws/simple-storage-service/index.js +18 -0
- package/dist/src/lib/{manager/aws/s3-manager.d.ts → services/aws/simple-storage-service/main.d.ts} +23 -23
- package/dist/src/lib/{manager/aws/s3-manager.js → services/aws/simple-storage-service/main.js} +15 -16
- package/dist/src/lib/services/aws/simple-storage-service/types.d.ts +31 -0
- package/dist/src/lib/services/aws/simple-storage-service/types.js +2 -0
- package/dist/src/lib/services/aws/step-function/index.d.ts +2 -0
- package/dist/src/lib/services/aws/step-function/index.js +18 -0
- package/dist/src/lib/services/aws/step-function/main.d.ts +157 -0
- package/dist/src/lib/{manager/aws/sfn-manager.js → services/aws/step-function/main.js} +35 -35
- package/dist/src/lib/services/aws/step-function/types.d.ts +120 -0
- package/dist/src/lib/services/aws/step-function/types.js +2 -0
- package/dist/src/lib/services/aws/systems-manager/index.d.ts +2 -0
- package/dist/src/lib/services/aws/systems-manager/index.js +18 -0
- package/dist/src/lib/{manager/aws/ssm-manager.d.ts → services/aws/systems-manager/main.d.ts} +13 -13
- package/dist/src/lib/{manager/aws/ssm-manager.js → services/aws/systems-manager/main.js} +8 -8
- package/dist/src/lib/services/aws/systems-manager/types.d.ts +8 -0
- package/dist/src/lib/services/aws/systems-manager/types.js +2 -0
- package/dist/src/lib/services/aws/virtual-private-cloud/index.d.ts +1 -0
- package/dist/src/lib/services/aws/virtual-private-cloud/index.js +17 -0
- package/dist/src/lib/{manager/aws/vpc-manager.d.ts → services/aws/virtual-private-cloud/main.d.ts} +11 -11
- package/dist/src/lib/{manager/aws/vpc-manager.js → services/aws/virtual-private-cloud/main.js} +8 -8
- package/dist/src/lib/services/aws/web-application-firewall/index.d.ts +1 -0
- package/dist/src/lib/services/aws/web-application-firewall/index.js +17 -0
- package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +39 -0
- package/dist/src/lib/{manager/aws/waf-manager.js → services/aws/web-application-firewall/main.js} +9 -9
- package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +13 -0
- package/dist/src/lib/services/aws/web-application-firewall/types.js +2 -0
- package/dist/src/lib/types/aws/index.d.ts +0 -921
- package/index.ts +1 -1
- package/package.json +1 -1
- package/src/lib/common/construct.ts +4 -4
- package/src/lib/common/index.ts +1 -0
- package/src/lib/common/stack.ts +1 -1
- package/src/lib/common/types.ts +23 -0
- package/src/lib/{helper/api-to-eventbridge-target-rest-api.ts → construct/api-to-eventbridge-target/api.ts} +2 -2
- package/src/lib/{helper/api-to-eventbridge-target-event.ts → construct/api-to-eventbridge-target/event.ts} +2 -2
- package/src/lib/construct/api-to-eventbridge-target/index.ts +3 -0
- package/src/lib/construct/api-to-eventbridge-target/main.ts +13 -8
- package/src/lib/construct/api-to-eventbridge-target/types.ts +126 -0
- package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +3 -3
- package/src/lib/construct/api-to-eventbridge-target-with-sns/index.ts +1 -0
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +15 -9
- package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +28 -0
- package/src/lib/{helper/api-to-lambda-target-rest-api.ts → construct/api-to-lambda-target/api.ts} +2 -2
- package/src/lib/construct/api-to-lambda-target/index.ts +2 -0
- package/src/lib/construct/api-to-lambda-target/main.ts +6 -6
- package/src/lib/construct/api-to-lambda-target/types.ts +78 -0
- package/src/lib/construct/graphql-api-lambda/index.ts +1 -0
- package/src/lib/construct/graphql-api-lambda/main.ts +1 -1
- package/src/lib/construct/graphql-api-lambda/types.ts +31 -0
- package/src/lib/construct/graphql-api-lambda-with-cache/index.ts +1 -0
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -1
- package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +16 -0
- package/src/lib/construct/lambda-with-iam-access/types.ts +2 -1
- package/src/lib/construct/rest-api-lambda/index.ts +1 -0
- package/src/lib/construct/rest-api-lambda/main.ts +1 -1
- package/src/lib/construct/rest-api-lambda/types.ts +29 -0
- package/src/lib/construct/rest-api-lambda-with-cache/index.ts +1 -0
- package/src/lib/construct/rest-api-lambda-with-cache/main.ts +1 -1
- package/src/lib/construct/rest-api-lambda-with-cache/types.ts +15 -0
- package/src/lib/construct/site-with-ecs-backend/index.ts +1 -0
- package/src/lib/construct/site-with-ecs-backend/main.ts +1 -1
- package/src/lib/construct/site-with-ecs-backend/types.ts +42 -0
- package/src/lib/construct/static-asset-deployment/types.ts +2 -1
- package/src/lib/construct/static-site/index.ts +1 -0
- package/src/lib/construct/static-site/main.ts +1 -1
- package/src/lib/construct/static-site/types.ts +27 -0
- package/src/lib/index.ts +5 -0
- package/src/lib/services/aws/api-gateway/index.ts +2 -0
- package/src/lib/{manager/aws/api-manager.ts → services/aws/api-gateway/main.ts} +20 -17
- package/src/lib/services/aws/api-gateway/types.ts +10 -0
- package/src/lib/services/aws/appconfig/constants.ts +58 -0
- package/src/lib/services/aws/appconfig/index.ts +3 -0
- package/src/lib/{manager/aws/app-config-manager.ts → services/aws/appconfig/main.ts} +31 -54
- package/src/lib/services/aws/appconfig/types.ts +20 -0
- package/src/lib/services/aws/certificate-manager/index.ts +2 -0
- package/src/lib/{manager/aws/acm-manager.ts → services/aws/certificate-manager/main.ts} +9 -9
- package/src/lib/services/aws/certificate-manager/types.ts +14 -0
- package/src/lib/services/aws/cloudfront/index.ts +2 -0
- package/src/lib/{manager/aws/cloudfront-manager.ts → services/aws/cloudfront/main.ts} +29 -29
- package/src/lib/services/aws/cloudfront/types.ts +28 -0
- package/src/lib/services/aws/cloudtrail/index.ts +2 -0
- package/src/lib/{manager/aws/cloudtrail-manager.ts → services/aws/cloudtrail/main.ts} +11 -11
- package/src/lib/services/aws/cloudtrail/types.ts +7 -0
- package/src/lib/services/aws/cloudwatch/index.ts +3 -0
- package/src/lib/{manager/aws/log-manager.ts → services/aws/cloudwatch/logs.ts} +16 -21
- package/src/lib/{manager/aws/cloudwatch-manager.ts → services/aws/cloudwatch/main.ts} +86 -112
- package/src/lib/services/aws/cloudwatch/types.ts +121 -0
- package/src/lib/services/aws/codebuild/index.ts +1 -0
- package/src/lib/{manager/aws/codebuild-manager.ts → services/aws/codebuild/main.ts} +7 -7
- package/src/lib/services/aws/constants.ts +4 -0
- package/src/lib/services/aws/dynamodb/index.ts +2 -0
- package/src/lib/{manager/aws/dynamodb-manager.ts → services/aws/dynamodb/main.ts} +8 -8
- package/src/lib/services/aws/dynamodb/types.ts +10 -0
- package/src/lib/services/aws/elastic-container-registry/index.ts +1 -0
- package/src/lib/{manager/aws/ecr-manager.ts → services/aws/elastic-container-registry/main.ts} +8 -8
- package/src/lib/services/aws/elastic-container-service/index.ts +2 -0
- package/src/lib/{manager/aws/ecs-manager.ts → services/aws/elastic-container-service/main.ts} +18 -18
- package/src/lib/services/aws/elastic-container-service/types.ts +51 -0
- package/src/lib/services/aws/elastic-file-system/index.ts +2 -0
- package/src/lib/{manager/aws/efs-manager.ts → services/aws/elastic-file-system/main.ts} +13 -13
- package/src/lib/services/aws/elastic-file-system/types.ts +20 -0
- package/src/lib/services/aws/elastic-kubernetes-service/index.ts +2 -0
- package/src/lib/{manager/aws/eks-manager.ts → services/aws/elastic-kubernetes-service/main.ts} +11 -11
- package/src/lib/services/aws/elastic-kubernetes-service/types.ts +10 -0
- package/src/lib/services/aws/elasticache/index.ts +2 -0
- package/src/lib/{manager/aws/elasticache-manager.ts → services/aws/elasticache/main.ts} +18 -20
- package/src/lib/services/aws/elasticache/types.ts +13 -0
- package/src/lib/services/aws/eventbridge/index.ts +3 -0
- package/src/lib/{manager/aws/event-manager.ts → services/aws/eventbridge/main.ts} +32 -26
- package/src/lib/{manager/aws/event-target-manager.ts → services/aws/eventbridge/target.ts} +7 -7
- package/src/lib/services/aws/eventbridge/types.ts +38 -0
- package/src/lib/services/aws/evidently/index.ts +2 -0
- package/src/lib/{manager/aws/evidently-manager.ts → services/aws/evidently/main.ts} +23 -18
- package/src/lib/services/aws/evidently/types.ts +37 -0
- package/src/lib/services/aws/identity-access-management/index.ts +1 -0
- package/src/lib/{manager/aws/iam-manager.ts → services/aws/identity-access-management/main.ts} +40 -51
- package/src/lib/services/aws/index.ts +28 -0
- package/src/lib/services/aws/key-management-service/index.ts +2 -0
- package/src/lib/{manager/aws/kms-manager.ts → services/aws/key-management-service/main.ts} +8 -8
- package/src/lib/services/aws/key-management-service/types.ts +7 -0
- package/src/lib/services/aws/lambda/index.ts +2 -0
- package/src/lib/{manager/aws/lambda-manager.ts → services/aws/lambda/main.ts} +30 -30
- package/src/lib/services/aws/lambda/types.ts +57 -0
- package/src/lib/services/aws/route53/index.ts +2 -0
- package/src/lib/{manager/aws/route53-manager.ts → services/aws/route53/main.ts} +18 -18
- package/src/lib/services/aws/route53/types.ts +9 -0
- package/src/lib/services/aws/secrets-manager/index.ts +1 -0
- package/src/lib/{manager/aws/secrets-manager.ts → services/aws/secrets-manager/main.ts} +9 -14
- package/src/lib/services/aws/simple-notification-service/index.ts +2 -0
- package/src/lib/{manager/aws/sns-manager.ts → services/aws/simple-notification-service/main.ts} +16 -16
- package/src/lib/services/aws/simple-notification-service/types.ts +7 -0
- package/src/lib/services/aws/simple-queue-service/index.ts +2 -0
- package/src/lib/{manager/aws/sqs-manager.ts → services/aws/simple-queue-service/main.ts} +18 -17
- package/src/lib/services/aws/simple-queue-service/types.ts +18 -0
- package/src/lib/services/aws/simple-storage-service/index.ts +2 -0
- package/src/lib/{manager/aws/s3-manager.ts → services/aws/simple-storage-service/main.ts} +26 -27
- package/src/lib/services/aws/simple-storage-service/types.ts +34 -0
- package/src/lib/services/aws/step-function/index.ts +2 -0
- package/src/lib/{manager/aws/sfn-manager.ts → services/aws/step-function/main.ts} +76 -61
- package/src/lib/services/aws/step-function/types.ts +152 -0
- package/src/lib/services/aws/systems-manager/index.ts +2 -0
- package/src/lib/{manager/aws/ssm-manager.ts → services/aws/systems-manager/main.ts} +15 -19
- package/src/lib/services/aws/systems-manager/types.ts +8 -0
- package/src/lib/services/aws/virtual-private-cloud/index.ts +1 -0
- package/src/lib/{manager/aws/vpc-manager.ts → services/aws/virtual-private-cloud/main.ts} +12 -12
- package/src/lib/services/aws/web-application-firewall/index.ts +1 -0
- package/src/lib/{manager/aws/waf-manager.ts → services/aws/web-application-firewall/main.ts} +13 -13
- package/src/lib/services/aws/web-application-firewall/types.ts +13 -0
- package/src/lib/types/aws/index.ts +0 -984
- package/dist/src/lib/helper/index.d.ts +0 -3
- package/dist/src/lib/manager/aws/app-config-manager.d.ts +0 -65
- package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts +0 -211
- package/dist/src/lib/manager/aws/elasticache-manager.d.ts +0 -52
- package/dist/src/lib/manager/aws/index.d.ts +0 -29
- package/dist/src/lib/manager/aws/index.js +0 -45
- package/dist/src/lib/manager/aws/sfn-manager.d.ts +0 -157
- package/dist/src/lib/manager/aws/sqs-manager.d.ts +0 -49
- package/dist/src/lib/manager/aws/waf-manager.d.ts +0 -39
- package/src/lib/helper/index.ts +0 -3
- package/src/lib/manager/aws/index.ts +0 -29
- /package/dist/src/lib/{helper/api-to-eventbridge-target-rest-api.js → construct/api-to-eventbridge-target/api.js} +0 -0
- /package/dist/src/lib/{helper/api-to-eventbridge-target-event.js → construct/api-to-eventbridge-target/event.js} +0 -0
- /package/dist/src/lib/{helper/api-to-lambda-target-rest-api.js → construct/api-to-lambda-target/api.js} +0 -0
- /package/dist/src/lib/{manager → services}/index.d.ts +0 -0
- /package/dist/src/lib/{manager → services}/index.js +0 -0
- /package/src/lib/{manager → services}/index.ts +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AliasProps, FunctionProps } from 'aws-cdk-lib/aws-lambda'
|
|
2
|
+
import { TagProps } from '../../../types'
|
|
3
|
+
import { EdgeFunctionProps } from 'aws-cdk-lib/aws-cloudfront/lib/experimental'
|
|
4
|
+
import { QueueProps } from '../simple-queue-service'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @category cdk-utils.lambda-manager
|
|
8
|
+
* @subcategory Properties
|
|
9
|
+
*/
|
|
10
|
+
export interface ProvisionedConcurrencyProps {
|
|
11
|
+
minCapacity: number
|
|
12
|
+
maxCapacity: number
|
|
13
|
+
utilizationTarget: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @category cdk-utils.lambda-manager
|
|
18
|
+
* @subcategory Properties
|
|
19
|
+
*/
|
|
20
|
+
export interface LambdaProps extends FunctionProps {
|
|
21
|
+
dlq?: QueueProps
|
|
22
|
+
redriveq?: QueueProps
|
|
23
|
+
timeoutInSecs?: number
|
|
24
|
+
excludeLastModifiedTimestamp?: boolean
|
|
25
|
+
tags?: TagProps[]
|
|
26
|
+
lambdaAliases?: LambdaAliasProps[]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @category cdk-utils.lambda-manager
|
|
31
|
+
* @subcategory Properties
|
|
32
|
+
*/
|
|
33
|
+
export interface LambdaAliasProps extends AliasProps {
|
|
34
|
+
id?: string
|
|
35
|
+
provisionedConcurrency?: ProvisionedConcurrencyProps
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @category cdk-utils.lambda-manager
|
|
40
|
+
* @subcategory Properties
|
|
41
|
+
*/
|
|
42
|
+
export interface LambdaEdgeProps extends EdgeFunctionProps {
|
|
43
|
+
timeoutInSecs?: number
|
|
44
|
+
tags?: TagProps[]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @category cdk-utils.lambda-manager
|
|
49
|
+
* @subcategory Types
|
|
50
|
+
*/
|
|
51
|
+
export interface LambdaEnvironment {
|
|
52
|
+
NODE_ENV: string
|
|
53
|
+
LOG_LEVEL: string
|
|
54
|
+
REGION?: string
|
|
55
|
+
STAGE?: string
|
|
56
|
+
TZ: string
|
|
57
|
+
}
|
|
@@ -2,21 +2,21 @@ import * as apig from 'aws-cdk-lib/aws-apigateway'
|
|
|
2
2
|
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront'
|
|
3
3
|
import * as route53 from 'aws-cdk-lib/aws-route53'
|
|
4
4
|
import * as route53Targets from 'aws-cdk-lib/aws-route53-targets'
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import * as utils from '../../../utils'
|
|
6
|
+
import { CommonConstruct } from '../../../common'
|
|
7
|
+
import { Route53Props } from './types'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @stability stable
|
|
11
11
|
* @category cdk-utils.route53-manager
|
|
12
12
|
* @subcategory Construct
|
|
13
13
|
* @classdesc Provides operations on AWS Route53.
|
|
14
|
-
* - A new instance of this class is injected into {@link
|
|
15
|
-
* - If a custom construct extends {@link
|
|
14
|
+
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
15
|
+
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
16
16
|
* @example
|
|
17
|
-
* import
|
|
17
|
+
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
18
18
|
*
|
|
19
|
-
* class CustomConstruct extends
|
|
19
|
+
* class CustomConstruct extends CommonConstruct {
|
|
20
20
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
21
21
|
* super(parent, id, props)
|
|
22
22
|
* this.props = props
|
|
@@ -30,10 +30,10 @@ export class Route53Manager {
|
|
|
30
30
|
/**
|
|
31
31
|
* @summary Method to create a hosted zone
|
|
32
32
|
* @param {string} id scoped id of the resource
|
|
33
|
-
* @param {
|
|
34
|
-
* @param {
|
|
33
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
34
|
+
* @param {Route53Props} props
|
|
35
35
|
*/
|
|
36
|
-
public createHostedZone(id: string, scope:
|
|
36
|
+
public createHostedZone(id: string, scope: CommonConstruct, props: Route53Props) {
|
|
37
37
|
let hostedZone: route53.IHostedZone
|
|
38
38
|
|
|
39
39
|
if (!props) throw `Route53 props undefined for ${id}`
|
|
@@ -58,12 +58,12 @@ export class Route53Manager {
|
|
|
58
58
|
/**
|
|
59
59
|
* @summary Method to create/lookup a hosted zone
|
|
60
60
|
* @param {string} id scoped id of the resource
|
|
61
|
-
* @param {
|
|
61
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
62
62
|
* @param useExistingHostedZone Flag to indicate whether to lookup vs create new hosted zone
|
|
63
63
|
*/
|
|
64
64
|
public withHostedZoneFromFullyQualifiedDomainName(
|
|
65
65
|
id: string,
|
|
66
|
-
scope:
|
|
66
|
+
scope: CommonConstruct,
|
|
67
67
|
useExistingHostedZone: boolean
|
|
68
68
|
) {
|
|
69
69
|
let hostedZone: route53.IHostedZone
|
|
@@ -88,7 +88,7 @@ export class Route53Manager {
|
|
|
88
88
|
/**
|
|
89
89
|
* @summary Method to create a-record for cloudfront target
|
|
90
90
|
* @param {string} id scoped id of the resource
|
|
91
|
-
* @param {
|
|
91
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
92
92
|
* @param {cloudfront.IDistribution} distribution
|
|
93
93
|
* @param {route53.IHostedZone} hostedZone
|
|
94
94
|
* @param {string} recordName
|
|
@@ -96,7 +96,7 @@ export class Route53Manager {
|
|
|
96
96
|
*/
|
|
97
97
|
public createCloudFrontTargetARecord(
|
|
98
98
|
id: string,
|
|
99
|
-
scope:
|
|
99
|
+
scope: CommonConstruct,
|
|
100
100
|
distribution?: cloudfront.IDistribution,
|
|
101
101
|
hostedZone?: route53.IHostedZone,
|
|
102
102
|
recordName?: string,
|
|
@@ -122,14 +122,14 @@ export class Route53Manager {
|
|
|
122
122
|
/**
|
|
123
123
|
* @summary Method to create a-record for cloudfront target
|
|
124
124
|
* @param {string} id scoped id of the resource
|
|
125
|
-
* @param {
|
|
125
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
126
126
|
* @param {cloudfront.IDistribution} distribution
|
|
127
127
|
* @param {route53.IHostedZone} hostedZone
|
|
128
128
|
* @param {string} recordName
|
|
129
129
|
*/
|
|
130
130
|
public createCloudFrontTargetARecordV2(
|
|
131
131
|
id: string,
|
|
132
|
-
scope:
|
|
132
|
+
scope: CommonConstruct,
|
|
133
133
|
distribution?: cloudfront.IDistribution,
|
|
134
134
|
hostedZone?: route53.IHostedZone,
|
|
135
135
|
recordName?: string
|
|
@@ -151,7 +151,7 @@ export class Route53Manager {
|
|
|
151
151
|
/**
|
|
152
152
|
* @summary Method to create a-record for restApi gateway target
|
|
153
153
|
* @param {string} id scoped id of the resource
|
|
154
|
-
* @param {
|
|
154
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
155
155
|
* @param recordName
|
|
156
156
|
* @param apiDomain
|
|
157
157
|
* @param hostedZone
|
|
@@ -159,7 +159,7 @@ export class Route53Manager {
|
|
|
159
159
|
*/
|
|
160
160
|
public createApiGatewayARecord(
|
|
161
161
|
id: string,
|
|
162
|
-
scope:
|
|
162
|
+
scope: CommonConstruct,
|
|
163
163
|
recordName: string,
|
|
164
164
|
apiDomain: apig.DomainName,
|
|
165
165
|
hostedZone: route53.IHostedZone,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './main'
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { SecretsManager as SM } from '@aws-sdk/client-secrets-manager'
|
|
2
2
|
import * as cdk from 'aws-cdk-lib'
|
|
3
3
|
import * as secretsManager from 'aws-cdk-lib/aws-secretsmanager'
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
4
|
+
import * as utils from '../../../utils'
|
|
5
|
+
import { CommonConstruct } from '../../../common'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @stability experimental
|
|
9
9
|
* @category cdk-utils.secrets-manager
|
|
10
10
|
* @subcategory Construct
|
|
11
11
|
* @classdesc Provides operations on AWS Secrets Manager.
|
|
12
|
-
* - A new instance of this class is injected into {@link
|
|
13
|
-
* - If a custom construct extends {@link
|
|
12
|
+
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
13
|
+
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
14
14
|
* @example
|
|
15
|
-
* import
|
|
15
|
+
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
16
16
|
*
|
|
17
|
-
* class CustomConstruct extends
|
|
17
|
+
* class CustomConstruct extends CommonConstruct {
|
|
18
18
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
19
19
|
* super(parent, id, props)
|
|
20
20
|
* this.props = props
|
|
@@ -69,12 +69,7 @@ export class SecretsManager {
|
|
|
69
69
|
* @param stackName
|
|
70
70
|
* @param exportName
|
|
71
71
|
*/
|
|
72
|
-
public retrieveSecretFromSecretsManager(
|
|
73
|
-
id: string,
|
|
74
|
-
scope: common.CommonConstruct,
|
|
75
|
-
stackName: string,
|
|
76
|
-
exportName: string
|
|
77
|
-
) {
|
|
72
|
+
public retrieveSecretFromSecretsManager(id: string, scope: CommonConstruct, stackName: string, exportName: string) {
|
|
78
73
|
return secretsManager.Secret.fromSecretNameV2(
|
|
79
74
|
scope,
|
|
80
75
|
`${id}`,
|
|
@@ -85,10 +80,10 @@ export class SecretsManager {
|
|
|
85
80
|
/**
|
|
86
81
|
* @summary Method to create a secret
|
|
87
82
|
* @param {string} id scoped id of the resource
|
|
88
|
-
* @param {
|
|
83
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
89
84
|
* @param {secretsManager.SecretProps} props the secret properties
|
|
90
85
|
*/
|
|
91
|
-
public createSecret(id: string, scope:
|
|
86
|
+
public createSecret(id: string, scope: CommonConstruct, props: secretsManager.SecretProps) {
|
|
92
87
|
const secret = new secretsManager.Secret(scope, `${id}`, {
|
|
93
88
|
...props,
|
|
94
89
|
secretName: `${props.secretName}-${scope.props.stage}`,
|
package/src/lib/{manager/aws/sns-manager.ts → services/aws/simple-notification-service/main.ts}
RENAMED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import * as lambda from 'aws-cdk-lib/aws-lambda'
|
|
2
2
|
import * as sns from 'aws-cdk-lib/aws-sns'
|
|
3
3
|
import * as subs from 'aws-cdk-lib/aws-sns-subscriptions'
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import * as utils from '../../../utils'
|
|
5
|
+
import { CommonConstruct } from '../../../common'
|
|
6
|
+
import { SubscriptionProps } from './types'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @stability stable
|
|
10
10
|
* @category cdk-utils.sns-manager
|
|
11
11
|
* @subcategory Construct
|
|
12
12
|
* @classdesc Provides operations on AWS Simple Notification Service.
|
|
13
|
-
* - A new instance of this class is injected into {@link
|
|
14
|
-
* - If a custom construct extends {@link
|
|
13
|
+
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
14
|
+
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
15
15
|
* @example
|
|
16
|
-
* import
|
|
16
|
+
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
17
17
|
*
|
|
18
|
-
* class CustomConstruct extends
|
|
18
|
+
* class CustomConstruct extends CommonConstruct {
|
|
19
19
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
20
20
|
* super(parent, id, props)
|
|
21
21
|
* this.props = props
|
|
22
|
-
* this.snsManager.createEmailNotificationService('MySns', 'eu-west-1', [
|
|
22
|
+
* this.snsManager.createEmailNotificationService('MySns', 'eu-west-1', ["test@example.com"])
|
|
23
23
|
* }
|
|
24
24
|
* }
|
|
25
25
|
*
|
|
@@ -29,14 +29,14 @@ export class SnsManager {
|
|
|
29
29
|
/**
|
|
30
30
|
* @summary Method to create an email notification service
|
|
31
31
|
* @param {string} id scoped id of the resource
|
|
32
|
-
* @param {
|
|
33
|
-
* @param {
|
|
32
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
33
|
+
* @param {SubscriptionProps} props
|
|
34
34
|
* @param {string[]} emails
|
|
35
35
|
*/
|
|
36
36
|
public createEmailNotificationService(
|
|
37
37
|
id: string,
|
|
38
|
-
scope:
|
|
39
|
-
props:
|
|
38
|
+
scope: CommonConstruct,
|
|
39
|
+
props: SubscriptionProps,
|
|
40
40
|
emails: string[]
|
|
41
41
|
) {
|
|
42
42
|
if (!props) throw `Subscription props undefined for ${id}`
|
|
@@ -60,14 +60,14 @@ export class SnsManager {
|
|
|
60
60
|
/**
|
|
61
61
|
* @summary Method to create a lambda notification service
|
|
62
62
|
* @param {string} id scoped id of the resource
|
|
63
|
-
* @param {
|
|
64
|
-
* @param {
|
|
63
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
64
|
+
* @param {SubscriptionProps} props
|
|
65
65
|
* @param {lambda.IFunction} lambdaFunction
|
|
66
66
|
*/
|
|
67
67
|
public createLambdaNotificationService(
|
|
68
68
|
id: string,
|
|
69
|
-
scope:
|
|
70
|
-
props:
|
|
69
|
+
scope: CommonConstruct,
|
|
70
|
+
props: SubscriptionProps,
|
|
71
71
|
lambdaFunction: lambda.IFunction
|
|
72
72
|
) {
|
|
73
73
|
if (!props) throw `Subscription props undefined for ${id}`
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import * as cdk from 'aws-cdk-lib'
|
|
2
2
|
import * as sqs from 'aws-cdk-lib/aws-sqs'
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import * as utils from '../../../utils'
|
|
4
|
+
import { CommonConstruct } from '../../../common'
|
|
5
|
+
import { QueueProps } from './types'
|
|
6
|
+
import { LambdaProps } from '../lambda'
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @stability stable
|
|
9
10
|
* @category cdk-utils.sqs-manager
|
|
10
11
|
* @subcategory Construct
|
|
11
12
|
* @classdesc Provides operations on AWS Simple Queue Service.
|
|
12
|
-
* - A new instance of this class is injected into {@link
|
|
13
|
-
* - If a custom construct extends {@link
|
|
13
|
+
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
14
|
+
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
14
15
|
* @example
|
|
15
|
-
* import
|
|
16
|
+
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
16
17
|
*
|
|
17
|
-
* class CustomConstruct extends
|
|
18
|
+
* class CustomConstruct extends CommonConstruct {
|
|
18
19
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
19
20
|
* super(parent, id, props)
|
|
20
21
|
* this.props = props
|
|
@@ -28,11 +29,11 @@ export class SqsManager {
|
|
|
28
29
|
/**
|
|
29
30
|
* @summary Method to create a lambda queue service
|
|
30
31
|
* @param {string} id scoped id of the resource
|
|
31
|
-
* @param {
|
|
32
|
-
* @param {
|
|
32
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
33
|
+
* @param {QueueProps} props
|
|
33
34
|
* @param {sqs.IQueue} deadLetterQueue
|
|
34
35
|
*/
|
|
35
|
-
public createQueue(id: string, scope:
|
|
36
|
+
public createQueue(id: string, scope: CommonConstruct, props: QueueProps, deadLetterQueue?: sqs.IQueue) {
|
|
36
37
|
if (!props) throw `Queue props undefined for ${id}`
|
|
37
38
|
|
|
38
39
|
const queue = new sqs.Queue(scope, id, {
|
|
@@ -78,10 +79,10 @@ export class SqsManager {
|
|
|
78
79
|
/**
|
|
79
80
|
* @summary Method to create a redrive queue for a lambda function
|
|
80
81
|
* @param {string} id scoped id of the resource
|
|
81
|
-
* @param {
|
|
82
|
-
* @param {
|
|
82
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
83
|
+
* @param {LambdaProps} props the lambda properties
|
|
83
84
|
*/
|
|
84
|
-
public createRedriveQueueForLambda(id: string, scope:
|
|
85
|
+
public createRedriveQueueForLambda(id: string, scope: CommonConstruct, props: LambdaProps) {
|
|
85
86
|
return this.createQueue(`${id}`, scope, {
|
|
86
87
|
...props.redriveq,
|
|
87
88
|
queueName: props.redriveq?.fifo
|
|
@@ -93,14 +94,14 @@ export class SqsManager {
|
|
|
93
94
|
/**
|
|
94
95
|
* @summary Method to create a dead letter queue for a lambda function
|
|
95
96
|
* @param {string} id scoped id of the resource
|
|
96
|
-
* @param {
|
|
97
|
-
* @param {
|
|
97
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
98
|
+
* @param {LambdaProps} props the lambda properties
|
|
98
99
|
* @param {sqs.IQueue} deadLetterQueue
|
|
99
100
|
*/
|
|
100
101
|
public createDeadLetterQueueForLambda(
|
|
101
102
|
id: string,
|
|
102
|
-
scope:
|
|
103
|
-
props:
|
|
103
|
+
scope: CommonConstruct,
|
|
104
|
+
props: LambdaProps,
|
|
104
105
|
deadLetterQueue: sqs.IQueue
|
|
105
106
|
) {
|
|
106
107
|
let queueProps
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as sqs from 'aws-cdk-lib/aws-sqs'
|
|
2
|
+
import { TagProps } from '../../../types'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @category cdk-utils.sqs-manager
|
|
6
|
+
* @subcategory Properties
|
|
7
|
+
*/
|
|
8
|
+
export interface QueueProps extends sqs.QueueProps {
|
|
9
|
+
maxReceiveCount?: number
|
|
10
|
+
visibilityTimeoutInSecs?: number
|
|
11
|
+
receiveMessageWaitTimeInSecs?: number
|
|
12
|
+
dataKeyReuseInSecs?: number
|
|
13
|
+
deliveryDelayInSecs?: number
|
|
14
|
+
retentionInDays?: number
|
|
15
|
+
tags?: TagProps[]
|
|
16
|
+
retriesEnabled?: boolean
|
|
17
|
+
retryBatchSize?: number
|
|
18
|
+
}
|
|
@@ -3,21 +3,21 @@ import * as cloudfront from 'aws-cdk-lib/aws-cloudfront'
|
|
|
3
3
|
import * as iam from 'aws-cdk-lib/aws-iam'
|
|
4
4
|
import * as s3 from 'aws-cdk-lib/aws-s3'
|
|
5
5
|
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment'
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import * as utils from '../../../utils'
|
|
7
|
+
import { LifecycleRule, S3BucketProps } from './types'
|
|
8
|
+
import { CommonConstruct } from '../../../common'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @stability stable
|
|
12
12
|
* @category cdk-utils.s3-manager
|
|
13
13
|
* @subcategory Construct
|
|
14
14
|
* @classdesc Provides operations on AWS S3.
|
|
15
|
-
* - A new instance of this class is injected into {@link
|
|
16
|
-
* - If a custom construct extends {@link
|
|
15
|
+
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
16
|
+
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
17
17
|
* @example
|
|
18
|
-
* import
|
|
18
|
+
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
19
19
|
*
|
|
20
|
-
* class CustomConstruct extends
|
|
20
|
+
* class CustomConstruct extends CommonConstruct {
|
|
21
21
|
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
22
22
|
* super(parent, id, props)
|
|
23
23
|
* this.props = props
|
|
@@ -30,13 +30,13 @@ import * as utils from '../../utils'
|
|
|
30
30
|
export class S3Manager {
|
|
31
31
|
/**
|
|
32
32
|
* @summary Method to determine S3 Bucket lifecycle properties
|
|
33
|
-
* @param {
|
|
33
|
+
* @param {S3BucketProps} props bucket properties
|
|
34
34
|
* @private
|
|
35
35
|
*/
|
|
36
|
-
protected determineBucketLifecycleRules(props:
|
|
36
|
+
protected determineBucketLifecycleRules(props: S3BucketProps) {
|
|
37
37
|
if (!props.lifecycleRules) return undefined
|
|
38
38
|
|
|
39
|
-
const bucketLifecycleRules:
|
|
39
|
+
const bucketLifecycleRules: LifecycleRule[] = []
|
|
40
40
|
props.lifecycleRules.forEach(lifecycleRule => {
|
|
41
41
|
bucketLifecycleRules.push({
|
|
42
42
|
id: lifecycleRule.id,
|
|
@@ -60,21 +60,21 @@ export class S3Manager {
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* @summary Method to determine the bucket name using account and region
|
|
63
|
-
* @param {
|
|
63
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
64
64
|
* @param {string} bucketName the bucket name
|
|
65
65
|
* @protected
|
|
66
66
|
*/
|
|
67
|
-
protected static determineBucketNameByAccountAndRegion(scope:
|
|
67
|
+
protected static determineBucketNameByAccountAndRegion(scope: CommonConstruct, bucketName: string) {
|
|
68
68
|
return `${bucketName}-${cdk.Stack.of(scope).account}-${scope.props.region}-${scope.props.stage}`
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @summary Method to determine the bucket name using domain name
|
|
73
|
-
* @param {
|
|
73
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
74
74
|
* @param {string} bucketName the bucket name
|
|
75
75
|
* @protected
|
|
76
76
|
*/
|
|
77
|
-
protected static determineBucketNameByDomainName(scope:
|
|
77
|
+
protected static determineBucketNameByDomainName(scope: CommonConstruct, bucketName: string) {
|
|
78
78
|
return scope.isProductionStage()
|
|
79
79
|
? `${bucketName}.${scope.fullyQualifiedDomainName}`
|
|
80
80
|
: `${bucketName}-${scope.props.stage}.${scope.fullyQualifiedDomainName}`
|
|
@@ -82,24 +82,23 @@ export class S3Manager {
|
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* @summary Method to determine the bucket name
|
|
85
|
-
* @param {
|
|
85
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
86
86
|
* @param {string} bucketName the bucket name
|
|
87
87
|
* @private
|
|
88
88
|
*/
|
|
89
|
-
public static determineBucketName(scope:
|
|
90
|
-
|
|
89
|
+
public static determineBucketName(scope: CommonConstruct, bucketName: string) {
|
|
90
|
+
return scope.props.excludeDomainNameForBuckets
|
|
91
91
|
? S3Manager.determineBucketNameByAccountAndRegion(scope, bucketName)
|
|
92
92
|
: S3Manager.determineBucketNameByDomainName(scope, bucketName)
|
|
93
|
-
return sanitisedBucketName
|
|
94
93
|
}
|
|
95
94
|
|
|
96
95
|
/**
|
|
97
96
|
* @summary Method to create a s3 bucket
|
|
98
97
|
* @param {string} id scoped id of the resource
|
|
99
|
-
* @param {
|
|
100
|
-
* @param {
|
|
98
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
99
|
+
* @param {S3BucketProps} props bucket properties
|
|
101
100
|
*/
|
|
102
|
-
public createS3Bucket(id: string, scope:
|
|
101
|
+
public createS3Bucket(id: string, scope: CommonConstruct, props: S3BucketProps) {
|
|
103
102
|
if (!props) throw `S3 props undefined for ${id}`
|
|
104
103
|
|
|
105
104
|
let bucket: s3.IBucket
|
|
@@ -159,10 +158,10 @@ export class S3Manager {
|
|
|
159
158
|
/**
|
|
160
159
|
* @summary Method to create an iam bucket policy for cloudtrail
|
|
161
160
|
* @param {string} id scoped id of the resource
|
|
162
|
-
* @param {
|
|
161
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
163
162
|
* @param {s3.IBucket} bucket
|
|
164
163
|
*/
|
|
165
|
-
public createBucketPolicyForCloudTrail(id: string, scope:
|
|
164
|
+
public createBucketPolicyForCloudTrail(id: string, scope: CommonConstruct, bucket: s3.IBucket) {
|
|
166
165
|
const bucketPolicyDocument = new iam.PolicyDocument({
|
|
167
166
|
statements: [
|
|
168
167
|
new iam.PolicyStatement({
|
|
@@ -191,7 +190,7 @@ export class S3Manager {
|
|
|
191
190
|
/**
|
|
192
191
|
* @summary Method to create a s3 bucket deployment
|
|
193
192
|
* @param {string} id scoped id of the resource
|
|
194
|
-
* @param {
|
|
193
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
195
194
|
* @param {s3.IBucket} siteBucket
|
|
196
195
|
* @param {cloudfront.IDistribution} distribution
|
|
197
196
|
* @param {s3deploy.ISource[]} sources
|
|
@@ -200,7 +199,7 @@ export class S3Manager {
|
|
|
200
199
|
*/
|
|
201
200
|
public doBucketDeployment(
|
|
202
201
|
id: string,
|
|
203
|
-
scope:
|
|
202
|
+
scope: CommonConstruct,
|
|
204
203
|
siteBucket: s3.IBucket,
|
|
205
204
|
distribution: cloudfront.IDistribution,
|
|
206
205
|
sources: s3deploy.ISource[],
|
|
@@ -222,11 +221,11 @@ export class S3Manager {
|
|
|
222
221
|
/**
|
|
223
222
|
*
|
|
224
223
|
* @param {string} id scoped id of the resource
|
|
225
|
-
* @param {
|
|
224
|
+
* @param {CommonConstruct} scope scope in which this resource is defined
|
|
226
225
|
* @param {s3.IBucket} bucket bucket to create the folders in
|
|
227
226
|
* @param {string[]} folders list of folder names to be created in the bucket
|
|
228
227
|
*/
|
|
229
|
-
public createBucketFolders(id: string, scope:
|
|
228
|
+
public createBucketFolders(id: string, scope: CommonConstruct, bucket: s3.IBucket, folders: string[]) {
|
|
230
229
|
if (!folders || folders.length == 0) {
|
|
231
230
|
throw `Folder unspecified for ${id}`
|
|
232
231
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TagProps } from '../../../types'
|
|
2
|
+
import * as s3 from 'aws-cdk-lib/aws-s3'
|
|
3
|
+
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @category cdk-utils.s3-manager
|
|
7
|
+
* @subcategory Properties
|
|
8
|
+
*/
|
|
9
|
+
export interface LifecycleRule extends s3.LifecycleRule {
|
|
10
|
+
expirationInDays?: number
|
|
11
|
+
noncurrentVersionExpirationInDays?: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @category cdk-utils.s3-manager
|
|
16
|
+
* @subcategory Properties
|
|
17
|
+
*/
|
|
18
|
+
export interface BucketDeploymentProps extends s3deploy.BucketDeploymentProps {
|
|
19
|
+
expirationInDays?: number
|
|
20
|
+
noncurrentVersionExpirationInDays?: number
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @category cdk-utils.s3-manager
|
|
25
|
+
* @subcategory Properties
|
|
26
|
+
*/
|
|
27
|
+
export interface S3BucketProps extends s3.BucketProps {
|
|
28
|
+
enableEventBridge?: boolean
|
|
29
|
+
lifecycleRules?: LifecycleRule[]
|
|
30
|
+
bucketName: string
|
|
31
|
+
logBucketName?: string
|
|
32
|
+
existingBucket?: boolean
|
|
33
|
+
tags?: TagProps[]
|
|
34
|
+
}
|