@gradientedge/cdk-utils 4.4.8 → 4.5.2
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/node_modules/uuid/dist/bin/uuid +2 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/index.js +9 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/md5.js +215 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/nil.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/parse.js +35 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/regex.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/rng.js +19 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/stringify.js +30 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v1.js +95 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v3.js +4 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v35.js +64 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v4.js +24 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v5.js +4 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/validate.js +7 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-browser/version.js +11 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/index.js +9 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/md5.js +13 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/nil.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/parse.js +35 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/regex.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/rng.js +12 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/sha1.js +13 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/stringify.js +29 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/v1.js +95 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/v3.js +4 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/v35.js +64 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/v4.js +24 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/v5.js +4 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/validate.js +7 -0
- package/app/api-destined-function/node_modules/uuid/dist/esm-node/version.js +11 -0
- package/app/api-destined-function/node_modules/uuid/dist/index.js +79 -0
- package/app/api-destined-function/node_modules/uuid/dist/md5-browser.js +223 -0
- package/app/api-destined-function/node_modules/uuid/dist/md5.js +23 -0
- package/app/api-destined-function/node_modules/uuid/dist/nil.js +8 -0
- package/app/api-destined-function/node_modules/uuid/dist/parse.js +45 -0
- package/app/api-destined-function/node_modules/uuid/dist/regex.js +8 -0
- package/app/api-destined-function/node_modules/uuid/dist/rng-browser.js +26 -0
- package/app/api-destined-function/node_modules/uuid/dist/rng.js +24 -0
- package/app/api-destined-function/node_modules/uuid/dist/sha1-browser.js +104 -0
- package/app/api-destined-function/node_modules/uuid/dist/sha1.js +23 -0
- package/app/api-destined-function/node_modules/uuid/dist/stringify.js +39 -0
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuid.min.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidNIL.min.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidParse.min.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidStringify.min.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidValidate.min.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidVersion.min.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv1.min.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv3.min.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv4.min.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv5.min.js +1 -0
- package/app/api-destined-function/node_modules/uuid/dist/uuid-bin.js +85 -0
- package/app/api-destined-function/node_modules/uuid/dist/v1.js +107 -0
- package/app/api-destined-function/node_modules/uuid/dist/v3.js +16 -0
- package/app/api-destined-function/node_modules/uuid/dist/v35.js +78 -0
- package/app/api-destined-function/node_modules/uuid/dist/v4.js +37 -0
- package/app/api-destined-function/node_modules/uuid/dist/v5.js +16 -0
- package/app/api-destined-function/node_modules/uuid/dist/validate.js +17 -0
- package/app/api-destined-function/node_modules/uuid/dist/version.js +21 -0
- package/app/api-destined-function/src/lib/lambda.ts +1 -3
- package/dist/app/api-destined-function/layers/nodejs/node_modules/.bin/uuid +2 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/.yarn-integrity +109 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/LICENSE +21 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/README.md +16 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/index.d.mts +10 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/index.d.ts +80 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/package.json +54 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/LICENSE.md +9 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/README.md +505 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/bin/uuid +2 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/index.js +9 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/md5.js +215 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/nil.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/parse.js +35 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/regex.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/rng.js +19 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/stringify.js +30 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v1.js +95 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v3.js +4 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v35.js +64 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v4.js +24 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v5.js +4 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/validate.js +7 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/version.js +11 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/index.js +9 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/md5.js +13 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/nil.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/parse.js +35 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/regex.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/rng.js +12 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/sha1.js +13 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/stringify.js +29 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v1.js +95 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v3.js +4 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v35.js +64 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v4.js +24 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v5.js +4 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/validate.js +7 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/version.js +11 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/index.js +79 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/md5-browser.js +223 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/md5.js +23 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/nil.js +8 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/parse.js +45 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/regex.js +8 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/rng-browser.js +26 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/rng.js +24 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/sha1-browser.js +104 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/sha1.js +23 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/stringify.js +39 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuid.min.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidNIL.min.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidParse.min.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidStringify.min.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidValidate.min.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidVersion.min.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv1.min.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv3.min.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv4.min.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv5.min.js +1 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/uuid-bin.js +85 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v1.js +107 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v3.js +16 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v35.js +78 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v4.js +37 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v5.js +16 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/validate.js +17 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/version.js +21 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/package.json +135 -0
- package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/wrapper.mjs +10 -0
- package/dist/app/api-destined-function/layers/nodejs/package.json +30 -0
- package/dist/app/api-destined-function/src/lib/lambda.d.ts +17 -0
- package/dist/app/api-destined-function/src/lib/lambda.d.ts.map +1 -0
- package/dist/app/api-destined-function/src/lib/lambda.js +32 -0
- package/dist/app/api-destined-function/src/lib/lambda.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/src/lib/common/construct.d.ts +81 -0
- package/dist/src/lib/common/construct.d.ts.map +1 -0
- package/dist/src/lib/common/construct.js +136 -0
- package/dist/src/lib/common/construct.js.map +1 -0
- package/dist/src/lib/common/index.d.ts +3 -0
- package/dist/src/lib/common/index.d.ts.map +1 -0
- package/dist/src/lib/common/index.js +15 -0
- package/dist/src/lib/common/index.js.map +1 -0
- package/dist/src/lib/common/stack.d.ts +55 -0
- package/dist/src/lib/common/stack.d.ts.map +1 -0
- package/dist/src/lib/common/stack.js +148 -0
- package/dist/src/lib/common/stack.js.map +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.d.ts +17 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.d.ts.map +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.js +18 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.js.map +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.d.ts +20 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.d.ts.map +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.js +20 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.js.map +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.d.ts +36 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.d.ts.map +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.js +30 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.js.map +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/index.d.ts +5 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/index.d.ts.map +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/index.js +17 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/index.js.map +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +136 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts.map +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +486 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js.map +1 -0
- package/dist/src/lib/construct/graphql-api-lambda/index.d.ts +2 -0
- package/dist/src/lib/construct/graphql-api-lambda/index.d.ts.map +1 -0
- package/dist/src/lib/construct/graphql-api-lambda/index.js +14 -0
- package/dist/src/lib/construct/graphql-api-lambda/index.js.map +1 -0
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +113 -0
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts.map +1 -0
- package/dist/src/lib/construct/graphql-api-lambda/main.js +202 -0
- package/dist/src/lib/construct/graphql-api-lambda/main.js.map +1 -0
- package/dist/src/lib/construct/index.d.ts +5 -0
- package/dist/src/lib/construct/index.d.ts.map +1 -0
- package/dist/src/lib/construct/index.js +17 -0
- package/dist/src/lib/construct/index.js.map +1 -0
- package/dist/src/lib/construct/site-with-ecs-backend/index.d.ts +2 -0
- package/dist/src/lib/construct/site-with-ecs-backend/index.d.ts.map +1 -0
- package/dist/src/lib/construct/site-with-ecs-backend/index.js +14 -0
- package/dist/src/lib/construct/site-with-ecs-backend/index.js.map +1 -0
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +168 -0
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts.map +1 -0
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +328 -0
- package/dist/src/lib/construct/site-with-ecs-backend/main.js.map +1 -0
- package/dist/src/lib/construct/static-site/index.d.ts +2 -0
- package/dist/src/lib/construct/static-site/index.d.ts.map +1 -0
- package/dist/src/lib/construct/static-site/index.js +14 -0
- package/dist/src/lib/construct/static-site/index.js.map +1 -0
- package/dist/src/lib/construct/static-site/main.d.ts +95 -0
- package/dist/src/lib/construct/static-site/main.d.ts.map +1 -0
- package/dist/src/lib/construct/static-site/main.js +169 -0
- package/dist/src/lib/construct/static-site/main.js.map +1 -0
- package/dist/src/lib/manager/aws/acm-manager.d.ts +47 -0
- package/dist/src/lib/manager/aws/acm-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/acm-manager.js +91 -0
- package/dist/src/lib/manager/aws/acm-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/api-manager.d.ts +44 -0
- package/dist/src/lib/manager/aws/api-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/api-manager.js +112 -0
- package/dist/src/lib/manager/aws/api-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/app-config-manager.d.ts +66 -0
- package/dist/src/lib/manager/aws/app-config-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/app-config-manager.js +149 -0
- package/dist/src/lib/manager/aws/app-config-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/cloudfront-manager.d.ts +113 -0
- package/dist/src/lib/manager/aws/cloudfront-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/cloudfront-manager.js +283 -0
- package/dist/src/lib/manager/aws/cloudfront-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/cloudtrail-manager.d.ts +49 -0
- package/dist/src/lib/manager/aws/cloudtrail-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/cloudtrail-manager.js +100 -0
- package/dist/src/lib/manager/aws/cloudtrail-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts +122 -0
- package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/cloudwatch-manager.js +353 -0
- package/dist/src/lib/manager/aws/cloudwatch-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/codebuild-manager.d.ts +41 -0
- package/dist/src/lib/manager/aws/codebuild-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/codebuild-manager.js +95 -0
- package/dist/src/lib/manager/aws/codebuild-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/dynamodb-manager.d.ts +33 -0
- package/dist/src/lib/manager/aws/dynamodb-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/dynamodb-manager.js +80 -0
- package/dist/src/lib/manager/aws/dynamodb-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/ecr-manager.d.ts +32 -0
- package/dist/src/lib/manager/aws/ecr-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/ecr-manager.js +61 -0
- package/dist/src/lib/manager/aws/ecr-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/ecs-manager.d.ts +49 -0
- package/dist/src/lib/manager/aws/ecs-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/ecs-manager.js +104 -0
- package/dist/src/lib/manager/aws/ecs-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/eks-manager.d.ts +37 -0
- package/dist/src/lib/manager/aws/eks-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/eks-manager.js +110 -0
- package/dist/src/lib/manager/aws/eks-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/elasticache-manager.d.ts +43 -0
- package/dist/src/lib/manager/aws/elasticache-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/elasticache-manager.js +103 -0
- package/dist/src/lib/manager/aws/elasticache-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/event-manager.d.ts +68 -0
- package/dist/src/lib/manager/aws/event-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/event-manager.js +163 -0
- package/dist/src/lib/manager/aws/event-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/iam-manager.d.ts +155 -0
- package/dist/src/lib/manager/aws/iam-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/iam-manager.js +381 -0
- package/dist/src/lib/manager/aws/iam-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/index.d.ts +24 -0
- package/dist/src/lib/manager/aws/index.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/index.js +36 -0
- package/dist/src/lib/manager/aws/index.js.map +1 -0
- package/dist/src/lib/manager/aws/lambda-manager.d.ts +95 -0
- package/dist/src/lib/manager/aws/lambda-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/lambda-manager.js +197 -0
- package/dist/src/lib/manager/aws/lambda-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/log-manager.d.ts +52 -0
- package/dist/src/lib/manager/aws/log-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/log-manager.js +109 -0
- package/dist/src/lib/manager/aws/log-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/route53-manager.d.ts +69 -0
- package/dist/src/lib/manager/aws/route53-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/route53-manager.js +159 -0
- package/dist/src/lib/manager/aws/route53-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/s3-manager.d.ts +74 -0
- package/dist/src/lib/manager/aws/s3-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/s3-manager.js +203 -0
- package/dist/src/lib/manager/aws/s3-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/secrets-manager.d.ts +58 -0
- package/dist/src/lib/manager/aws/secrets-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/secrets-manager.js +117 -0
- package/dist/src/lib/manager/aws/secrets-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/sns-manager.d.ts +43 -0
- package/dist/src/lib/manager/aws/sns-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/sns-manager.js +91 -0
- package/dist/src/lib/manager/aws/sns-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/ssm-manager.d.ts +61 -0
- package/dist/src/lib/manager/aws/ssm-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/ssm-manager.js +125 -0
- package/dist/src/lib/manager/aws/ssm-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/vpc-manager.d.ts +46 -0
- package/dist/src/lib/manager/aws/vpc-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/vpc-manager.js +95 -0
- package/dist/src/lib/manager/aws/vpc-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/waf-manager.d.ts +40 -0
- package/dist/src/lib/manager/aws/waf-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/waf-manager.js +90 -0
- package/dist/src/lib/manager/aws/waf-manager.js.map +1 -0
- package/dist/src/lib/manager/index.d.ts +2 -0
- package/dist/src/lib/manager/index.d.ts.map +1 -0
- package/dist/src/lib/manager/index.js +14 -0
- package/dist/src/lib/manager/index.js.map +1 -0
- package/dist/src/lib/types/aws/index.d.ts +488 -0
- package/dist/src/lib/types/aws/index.d.ts.map +1 -0
- package/dist/src/lib/types/aws/index.js +3 -0
- package/dist/src/lib/types/aws/index.js.map +1 -0
- package/dist/src/lib/types/index.d.ts +2 -0
- package/dist/src/lib/types/index.d.ts.map +1 -0
- package/dist/src/lib/types/index.js +14 -0
- package/dist/src/lib/types/index.js.map +1 -0
- package/dist/src/lib/utils/aws/index.d.ts +16 -0
- package/dist/src/lib/utils/aws/index.d.ts.map +1 -0
- package/dist/src/lib/utils/aws/index.js +50 -0
- package/dist/src/lib/utils/aws/index.js.map +1 -0
- package/dist/src/lib/utils/index.d.ts +63 -0
- package/dist/src/lib/utils/index.d.ts.map +1 -0
- package/dist/src/lib/utils/index.js +85 -0
- package/dist/src/lib/utils/index.js.map +1 -0
- package/package.json +1 -1
- package/src/lib/common/construct.ts +2 -0
- package/src/lib/construct/api-to-eventbridge-target/main.ts +10 -12
- package/src/lib/manager/aws/elasticache-manager.ts +98 -0
- package/src/lib/manager/aws/index.ts +1 -0
- package/src/lib/types/aws/index.ts +9 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as cdk from 'aws-cdk-lib';
|
|
2
|
+
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
|
|
3
|
+
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
4
|
+
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment';
|
|
5
|
+
import * as common from '../../common';
|
|
6
|
+
import * as types from '../../types';
|
|
7
|
+
/**
|
|
8
|
+
* @stability stable
|
|
9
|
+
* @category cdk-utils.s3-manager
|
|
10
|
+
* @subcategory Construct
|
|
11
|
+
* @classdesc Provides operations on AWS S3.
|
|
12
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
13
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
14
|
+
* @example
|
|
15
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
16
|
+
*
|
|
17
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
18
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
19
|
+
* super(parent, id, props)
|
|
20
|
+
* this.props = props
|
|
21
|
+
* this.s3Manager.createS3Bucket('MyBucket', this)
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
*
|
|
25
|
+
* @see [CDK S3 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3-readme.html}
|
|
26
|
+
*/
|
|
27
|
+
export declare class S3Manager {
|
|
28
|
+
/**
|
|
29
|
+
* @summary Method to determine S3 Bucket lifecycle properties
|
|
30
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
protected determineBucketLifecycleRules(props: types.S3BucketProps): types.LifecycleRule[] | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* @summary Method to determine the bucket name
|
|
36
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
37
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
40
|
+
protected static determineBucketName(scope: common.CommonConstruct, props: types.S3BucketProps): string;
|
|
41
|
+
/**
|
|
42
|
+
* @summary Method to determine the log bucket name
|
|
43
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
44
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
protected static determineLogBucketName(scope: common.CommonConstruct, props: types.S3BucketProps): string;
|
|
48
|
+
/**
|
|
49
|
+
* @summary Method to create a s3 bucket
|
|
50
|
+
* @param {string} id scoped id of the resource
|
|
51
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
52
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
53
|
+
*/
|
|
54
|
+
createS3Bucket(id: string, scope: common.CommonConstruct, props: types.S3BucketProps): cdk.aws_s3.IBucket;
|
|
55
|
+
/**
|
|
56
|
+
* @summary Method to create an iam bucket policy for cloudtrail
|
|
57
|
+
* @param {string} id scoped id of the resource
|
|
58
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
59
|
+
* @param {s3.IBucket} bucket
|
|
60
|
+
*/
|
|
61
|
+
createBucketPolicyForCloudTrail(id: string, scope: common.CommonConstruct, bucket: s3.IBucket): cdk.aws_s3.CfnBucketPolicy;
|
|
62
|
+
/**
|
|
63
|
+
* @summary Method to create a s3 bucket deployment
|
|
64
|
+
* @param {string} id scoped id of the resource
|
|
65
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
66
|
+
* @param {s3.IBucket} siteBucket
|
|
67
|
+
* @param {cloudfront.IDistribution} distribution
|
|
68
|
+
* @param {s3deploy.ISource[]} sources
|
|
69
|
+
* @param {string} prefix
|
|
70
|
+
* @param {boolean} prune
|
|
71
|
+
*/
|
|
72
|
+
doBucketDeployment(id: string, scope: common.CommonConstruct, siteBucket: s3.IBucket, distribution: cloudfront.IDistribution, sources: s3deploy.ISource[], prefix: string, prune?: boolean): void;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=s3-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/s3-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAA;AAExD,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACxC,OAAO,KAAK,QAAQ,MAAM,+BAA+B,CAAA;AACzD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,SAAS;IACpB;;;;OAIG;IACH,SAAS,CAAC,6BAA6B,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa;IAyBlE;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa;IAM9F;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa;IAMjG;;;;;OAKG;IACI,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa;IAkD3F;;;;;OAKG;IACI,+BAA+B,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,CAAC,OAAO;IA0BpG;;;;;;;;;OASG;IACI,kBAAkB,CACvB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,UAAU,EAAE,EAAE,CAAC,OAAO,EACtB,YAAY,EAAE,UAAU,CAAC,aAAa,EACtC,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,EAC3B,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,OAAO;CAalB"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.S3Manager = void 0;
|
|
23
|
+
const cdk = __importStar(require("aws-cdk-lib"));
|
|
24
|
+
const iam = __importStar(require("aws-cdk-lib/aws-iam"));
|
|
25
|
+
const s3 = __importStar(require("aws-cdk-lib/aws-s3"));
|
|
26
|
+
const s3deploy = __importStar(require("aws-cdk-lib/aws-s3-deployment"));
|
|
27
|
+
const utils = __importStar(require("../../utils"));
|
|
28
|
+
/**
|
|
29
|
+
* @stability stable
|
|
30
|
+
* @category cdk-utils.s3-manager
|
|
31
|
+
* @subcategory Construct
|
|
32
|
+
* @classdesc Provides operations on AWS S3.
|
|
33
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
34
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
35
|
+
* @example
|
|
36
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
37
|
+
*
|
|
38
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
39
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
40
|
+
* super(parent, id, props)
|
|
41
|
+
* this.props = props
|
|
42
|
+
* this.s3Manager.createS3Bucket('MyBucket', this)
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* @see [CDK S3 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3-readme.html}
|
|
47
|
+
*/
|
|
48
|
+
class S3Manager {
|
|
49
|
+
/**
|
|
50
|
+
* @summary Method to determine S3 Bucket lifecycle properties
|
|
51
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
|
+
determineBucketLifecycleRules(props) {
|
|
55
|
+
if (!props.lifecycleRules)
|
|
56
|
+
return undefined;
|
|
57
|
+
const bucketLifecycleRules = [];
|
|
58
|
+
props.lifecycleRules.forEach(lifecycleRule => {
|
|
59
|
+
bucketLifecycleRules.push({
|
|
60
|
+
id: lifecycleRule.id,
|
|
61
|
+
enabled: lifecycleRule.enabled,
|
|
62
|
+
abortIncompleteMultipartUploadAfter: lifecycleRule.abortIncompleteMultipartUploadAfter,
|
|
63
|
+
expirationDate: lifecycleRule.expirationDate,
|
|
64
|
+
expiration: lifecycleRule.expirationInDays ? cdk.Duration.days(lifecycleRule.expirationInDays) : undefined,
|
|
65
|
+
noncurrentVersionExpiration: lifecycleRule.noncurrentVersionExpirationInDays
|
|
66
|
+
? cdk.Duration.days(lifecycleRule.noncurrentVersionExpirationInDays)
|
|
67
|
+
: undefined,
|
|
68
|
+
noncurrentVersionTransitions: lifecycleRule.noncurrentVersionTransitions,
|
|
69
|
+
transitions: lifecycleRule.transitions,
|
|
70
|
+
prefix: lifecycleRule.prefix,
|
|
71
|
+
tagFilters: lifecycleRule.tagFilters,
|
|
72
|
+
expiredObjectDeleteMarker: lifecycleRule.expiredObjectDeleteMarker,
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
return bucketLifecycleRules;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* @summary Method to determine the bucket name
|
|
79
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
80
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
81
|
+
* @private
|
|
82
|
+
*/
|
|
83
|
+
static determineBucketName(scope, props) {
|
|
84
|
+
return scope.isProductionStage()
|
|
85
|
+
? `${props.bucketName}.${scope.fullyQualifiedDomainName}`
|
|
86
|
+
: `${props.bucketName}-${scope.props.stage}.${scope.fullyQualifiedDomainName}`;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @summary Method to determine the log bucket name
|
|
90
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
91
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
92
|
+
* @private
|
|
93
|
+
*/
|
|
94
|
+
static determineLogBucketName(scope, props) {
|
|
95
|
+
return scope.isProductionStage()
|
|
96
|
+
? `${props.logBucketName}.${scope.fullyQualifiedDomainName}`
|
|
97
|
+
: `${props.logBucketName}-${scope.props.stage}.${scope.fullyQualifiedDomainName}`;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @summary Method to create a s3 bucket
|
|
101
|
+
* @param {string} id scoped id of the resource
|
|
102
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
103
|
+
* @param {types.S3BucketProps} props bucket properties
|
|
104
|
+
*/
|
|
105
|
+
createS3Bucket(id, scope, props) {
|
|
106
|
+
if (!props)
|
|
107
|
+
throw `S3 props undefined`;
|
|
108
|
+
let bucket;
|
|
109
|
+
const bucketName = S3Manager.determineBucketName(scope, props);
|
|
110
|
+
if (props.existingBucket && props.bucketName) {
|
|
111
|
+
bucket = s3.Bucket.fromBucketName(scope, `${id}`, bucketName);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
let logBucket;
|
|
115
|
+
if (props.logBucketName) {
|
|
116
|
+
const logBucketName = S3Manager.determineLogBucketName(scope, props);
|
|
117
|
+
logBucket = s3.Bucket.fromBucketName(scope, `${id}-logs`, logBucketName);
|
|
118
|
+
}
|
|
119
|
+
bucket = new s3.Bucket(scope, `${id}-bucket`, {
|
|
120
|
+
accessControl: props.accessControl,
|
|
121
|
+
autoDeleteObjects: props.autoDeleteObjects,
|
|
122
|
+
blockPublicAccess: props.blockPublicAccess || s3.BlockPublicAccess.BLOCK_ALL,
|
|
123
|
+
bucketName: bucketName,
|
|
124
|
+
cors: props.cors,
|
|
125
|
+
encryption: props.encryption || s3.BucketEncryption.S3_MANAGED,
|
|
126
|
+
encryptionKey: props.encryptionKey,
|
|
127
|
+
lifecycleRules: this.determineBucketLifecycleRules(props),
|
|
128
|
+
metrics: props.metrics,
|
|
129
|
+
publicReadAccess: props.publicReadAccess,
|
|
130
|
+
removalPolicy: props.removalPolicy || cdk.RemovalPolicy.RETAIN,
|
|
131
|
+
serverAccessLogsBucket: logBucket,
|
|
132
|
+
serverAccessLogsPrefix: props.serverAccessLogsPrefix,
|
|
133
|
+
websiteIndexDocument: props.websiteIndexDocument,
|
|
134
|
+
websiteErrorDocument: props.websiteErrorDocument,
|
|
135
|
+
websiteRoutingRules: props.websiteRoutingRules,
|
|
136
|
+
versioned: props.versioned,
|
|
137
|
+
});
|
|
138
|
+
const cfnBucket = bucket.node.defaultChild;
|
|
139
|
+
cfnBucket.notificationConfiguration = {
|
|
140
|
+
eventBridgeConfiguration: {
|
|
141
|
+
eventBridgeEnabled: props.enableEventBridge ?? false,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
utils.createCfnOutput(`${id}-bucketName`, scope, bucket.bucketName);
|
|
146
|
+
utils.createCfnOutput(`${id}-bucketArn`, scope, bucket.bucketArn);
|
|
147
|
+
return bucket;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* @summary Method to create an iam bucket policy for cloudtrail
|
|
151
|
+
* @param {string} id scoped id of the resource
|
|
152
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
153
|
+
* @param {s3.IBucket} bucket
|
|
154
|
+
*/
|
|
155
|
+
createBucketPolicyForCloudTrail(id, scope, bucket) {
|
|
156
|
+
const bucketPolicyDocument = new iam.PolicyDocument({
|
|
157
|
+
statements: [
|
|
158
|
+
new iam.PolicyStatement({
|
|
159
|
+
actions: ['s3:GetBucketAcl'],
|
|
160
|
+
effect: iam.Effect.ALLOW,
|
|
161
|
+
principals: [new iam.ServicePrincipal('cloudtrail.amazonaws.com')],
|
|
162
|
+
resources: [bucket.bucketArn],
|
|
163
|
+
sid: 'AWSCloudTrailAclCheck20150319',
|
|
164
|
+
}),
|
|
165
|
+
new iam.PolicyStatement({
|
|
166
|
+
actions: ['s3:PutObject'],
|
|
167
|
+
effect: iam.Effect.ALLOW,
|
|
168
|
+
principals: [new iam.ServicePrincipal('cloudtrail.amazonaws.com')],
|
|
169
|
+
resources: [bucket.arnForObjects('*')],
|
|
170
|
+
sid: 'AWSCloudTrailWrite20150319',
|
|
171
|
+
}),
|
|
172
|
+
],
|
|
173
|
+
});
|
|
174
|
+
return new s3.CfnBucketPolicy(scope, `${id}`, {
|
|
175
|
+
bucket: bucket.bucketName,
|
|
176
|
+
policyDocument: bucketPolicyDocument,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* @summary Method to create a s3 bucket deployment
|
|
181
|
+
* @param {string} id scoped id of the resource
|
|
182
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
183
|
+
* @param {s3.IBucket} siteBucket
|
|
184
|
+
* @param {cloudfront.IDistribution} distribution
|
|
185
|
+
* @param {s3deploy.ISource[]} sources
|
|
186
|
+
* @param {string} prefix
|
|
187
|
+
* @param {boolean} prune
|
|
188
|
+
*/
|
|
189
|
+
doBucketDeployment(id, scope, siteBucket, distribution, sources, prefix, prune) {
|
|
190
|
+
new s3deploy.BucketDeployment(scope, `${id}`, {
|
|
191
|
+
destinationBucket: siteBucket,
|
|
192
|
+
destinationKeyPrefix: prefix,
|
|
193
|
+
distribution: distribution,
|
|
194
|
+
distributionPaths: ['/*'],
|
|
195
|
+
memoryLimit: 1024,
|
|
196
|
+
prune: !!prune,
|
|
197
|
+
serverSideEncryption: s3deploy.ServerSideEncryption.AES_256,
|
|
198
|
+
sources: sources,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
exports.S3Manager = S3Manager;
|
|
203
|
+
//# sourceMappingURL=s3-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/s3-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAkC;AAElC,yDAA0C;AAC1C,uDAAwC;AACxC,wEAAyD;AAGzD,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,SAAS;IACpB;;;;OAIG;IACO,6BAA6B,CAAC,KAA0B;QAChE,IAAI,CAAC,KAAK,CAAC,cAAc;YAAE,OAAO,SAAS,CAAA;QAE3C,MAAM,oBAAoB,GAA0B,EAAE,CAAA;QACtD,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;YAC3C,oBAAoB,CAAC,IAAI,CAAC;gBACxB,EAAE,EAAE,aAAa,CAAC,EAAE;gBACpB,OAAO,EAAE,aAAa,CAAC,OAAO;gBAC9B,mCAAmC,EAAE,aAAa,CAAC,mCAAmC;gBACtF,cAAc,EAAE,aAAa,CAAC,cAAc;gBAC5C,UAAU,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS;gBAC1G,2BAA2B,EAAE,aAAa,CAAC,iCAAiC;oBAC1E,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,iCAAiC,CAAC;oBACpE,CAAC,CAAC,SAAS;gBACb,4BAA4B,EAAE,aAAa,CAAC,4BAA4B;g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AE,MAAM,CAAC,UAAU;YACzB,cAAc,EAAE,oBAAoB;SACrC,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;OASG;IACI,kBAAkB,CACvB,EAAU,EACV,KAA6B,EAC7B,UAAsB,EACtB,YAAsC,EACtC,OAA2B,EAC3B,MAAc,EACd,KAAe;QAEf,IAAI,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YAC5C,iBAAiB,EAAE,UAAU;YAC7B,oBAAoB,EAAE,MAAM;YAC5B,YAAY,EAAE,YAAY;YAC1B,iBAAiB,EAAE,CAAC,IAAI,CAAC;YACzB,WAAW,EAAE,IAAI;YACjB,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB,CAAC,OAAO;YAC3D,OAAO,EAAE,OAAO;SACjB,CAAC,CAAA;IACJ,CAAC;CACF;AA7KD,8BA6KC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as cdk from 'aws-cdk-lib';
|
|
2
|
+
import * as common from '../../common';
|
|
3
|
+
/**
|
|
4
|
+
* @stability experimental
|
|
5
|
+
* @category cdk-utils.secrets-manager
|
|
6
|
+
* @subcategory Construct
|
|
7
|
+
* @classdesc Provides operations on AWS Secrets Manager.
|
|
8
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
9
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
10
|
+
* @example
|
|
11
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
12
|
+
*
|
|
13
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
14
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
15
|
+
* super(parent, id, props)
|
|
16
|
+
* this.props = props
|
|
17
|
+
* this.secretsManager.loadSecret('MySecretName', 'eu-west-1')
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* @see [CDK Secrets Manager Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager-readme.html}
|
|
22
|
+
*/
|
|
23
|
+
export declare class SecretsManager {
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param {string} region
|
|
27
|
+
*/
|
|
28
|
+
getAwsSecretsManager(region: string): any;
|
|
29
|
+
/**
|
|
30
|
+
* @stability experimental
|
|
31
|
+
* @summary Method to load a secret from secrets manager
|
|
32
|
+
* @param {string} secretName
|
|
33
|
+
* @param {string} region
|
|
34
|
+
*/
|
|
35
|
+
loadSecret(secretName: string, region: string): Promise<any>;
|
|
36
|
+
/**
|
|
37
|
+
* @stability experimental
|
|
38
|
+
* @summary Method to load secrets from secrets manager
|
|
39
|
+
* @param {string} secretNames
|
|
40
|
+
* @param {string} region
|
|
41
|
+
*/
|
|
42
|
+
loadSecrets(secretNames: string, region: string): Promise<{}>;
|
|
43
|
+
/**
|
|
44
|
+
* @stability experimental
|
|
45
|
+
* @summary Method to export secrets from secrets manager to a dot env format
|
|
46
|
+
*/
|
|
47
|
+
exportToDotEnv(): void;
|
|
48
|
+
/**
|
|
49
|
+
* @stability stable
|
|
50
|
+
* @summary Method to retrieve a secret from secrets manager with a cloudformation export
|
|
51
|
+
* @param id
|
|
52
|
+
* @param scope
|
|
53
|
+
* @param stackName
|
|
54
|
+
* @param exportName
|
|
55
|
+
*/
|
|
56
|
+
retrieveSecretFromSecretsManager(id: string, scope: common.CommonConstruct, stackName: string, exportName: string): cdk.aws_secretsmanager.ISecret;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=secrets-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/secrets-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAElC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AAKtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,cAAc;IACzB;;;OAGG;IACI,oBAAoB,CAAC,MAAM,EAAE,MAAM;IAI1C;;;;;OAKG;IACU,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAO1D;;;;;OAKG;IACU,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAS5D;;;OAGG;IACI,cAAc;IA2BrB;;;;;;;OAOG;IACI,gCAAgC,CACrC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM;CAQrB"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.SecretsManager = void 0;
|
|
23
|
+
const cdk = __importStar(require("aws-cdk-lib"));
|
|
24
|
+
const secretsManager = __importStar(require("aws-cdk-lib/aws-secretsmanager"));
|
|
25
|
+
const AWS = require('aws-sdk');
|
|
26
|
+
const fs = require('fs');
|
|
27
|
+
/**
|
|
28
|
+
* @stability experimental
|
|
29
|
+
* @category cdk-utils.secrets-manager
|
|
30
|
+
* @subcategory Construct
|
|
31
|
+
* @classdesc Provides operations on AWS Secrets Manager.
|
|
32
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
33
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
34
|
+
* @example
|
|
35
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
36
|
+
*
|
|
37
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
38
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
39
|
+
* super(parent, id, props)
|
|
40
|
+
* this.props = props
|
|
41
|
+
* this.secretsManager.loadSecret('MySecretName', 'eu-west-1')
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
*
|
|
45
|
+
* @see [CDK Secrets Manager Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager-readme.html}
|
|
46
|
+
*/
|
|
47
|
+
class SecretsManager {
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @param {string} region
|
|
51
|
+
*/
|
|
52
|
+
getAwsSecretsManager(region) {
|
|
53
|
+
return new AWS.SecretsManager({ region: region });
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @stability experimental
|
|
57
|
+
* @summary Method to load a secret from secrets manager
|
|
58
|
+
* @param {string} secretName
|
|
59
|
+
* @param {string} region
|
|
60
|
+
*/
|
|
61
|
+
async loadSecret(secretName, region) {
|
|
62
|
+
const secretsManager = this.getAwsSecretsManager(region);
|
|
63
|
+
const secret = await Promise.all([secretsManager.getSecretValue({ SecretId: secretName }).promise()]);
|
|
64
|
+
return secret ? JSON.parse(secret[0].SecretString) : {};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @stability experimental
|
|
68
|
+
* @summary Method to load secrets from secrets manager
|
|
69
|
+
* @param {string} secretNames
|
|
70
|
+
* @param {string} region
|
|
71
|
+
*/
|
|
72
|
+
async loadSecrets(secretNames, region) {
|
|
73
|
+
let secrets = {};
|
|
74
|
+
for (const secretName of secretNames.split(',')) {
|
|
75
|
+
secrets = { ...secrets, ...(await this.loadSecret(secretName, region)) };
|
|
76
|
+
}
|
|
77
|
+
return secrets;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @stability experimental
|
|
81
|
+
* @summary Method to export secrets from secrets manager to a dot env format
|
|
82
|
+
*/
|
|
83
|
+
exportToDotEnv() {
|
|
84
|
+
let nconf = require('nconf');
|
|
85
|
+
nconf.argv().env();
|
|
86
|
+
const appRoot = require('app-root-path');
|
|
87
|
+
if (nconf.get('profile')) {
|
|
88
|
+
console.log(`Using named aws profile ${nconf.get('profile')}`);
|
|
89
|
+
AWS.config.credentials = new AWS.SharedIniFileCredentials({ profile: nconf.get('profile') });
|
|
90
|
+
}
|
|
91
|
+
const region = nconf.get('region');
|
|
92
|
+
AWS.config.update({ region: nconf.get('region') });
|
|
93
|
+
const outFileName = nconf.get('out') ? nconf.get('out') : '.env';
|
|
94
|
+
this.loadSecret(nconf.get('name'), region).then((secretString) => {
|
|
95
|
+
if (nconf.get('overwrite')) {
|
|
96
|
+
fs.writeFileSync(`${appRoot.path}/.env`, '');
|
|
97
|
+
}
|
|
98
|
+
Object.keys(secretString).forEach(function (key) {
|
|
99
|
+
console.log(`Adding environment variable for key: ${key}`);
|
|
100
|
+
fs.appendFileSync(`${appRoot.path}/${outFileName}`, `${key}=${secretString[key]}\r\n`);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* @stability stable
|
|
106
|
+
* @summary Method to retrieve a secret from secrets manager with a cloudformation export
|
|
107
|
+
* @param id
|
|
108
|
+
* @param scope
|
|
109
|
+
* @param stackName
|
|
110
|
+
* @param exportName
|
|
111
|
+
*/
|
|
112
|
+
retrieveSecretFromSecretsManager(id, scope, stackName, exportName) {
|
|
113
|
+
return secretsManager.Secret.fromSecretNameV2(scope, `${id}`, cdk.Fn.importValue(`${stackName}-${scope.props.stage}-${exportName}`));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.SecretsManager = SecretsManager;
|
|
117
|
+
//# sourceMappingURL=secrets-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/secrets-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAkC;AAClC,+EAAgE;AAGhE,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAC9B,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,cAAc;IACzB;;;OAGG;IACI,oBAAoB,CAAC,MAAc;QACxC,OAAO,IAAI,GAAG,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IACnD,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,UAAU,CAAC,UAAkB,EAAE,MAAc;QACxD,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAA;QACxD,MAAM,MAAM,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;QAE1G,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,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AAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,YAAiB,EAAE,EAAE;YACpE,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;gBAC1B,EAAE,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,OAAO,EAAE,EAAE,CAAC,CAAA;aAC7C;YAED,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,UAAU,GAAG;gBAC7C,OAAO,CAAC,GAAG,CAAC,wCAAwC,GAAG,EAAE,CAAC,CAAA;gBAC1D,EAAE,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,WAAW,EAAE,EAAE,GAAG,GAAG,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YACxF,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;OAOG;IACI,gCAAgC,CACrC,EAAU,EACV,KAA6B,EAC7B,SAAiB,EACjB,UAAkB;QAElB,OAAO,cAAc,CAAC,MAAM,CAAC,gBAAgB,CAC3C,KAAK,EACL,GAAG,EAAE,EAAE,EACP,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,UAAU,EAAE,CAAC,CACtE,CAAA;IACH,CAAC;CACF;AAxFD,wCAwFC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
2
|
+
import * as sns from 'aws-cdk-lib/aws-sns';
|
|
3
|
+
import * as common from '../../common';
|
|
4
|
+
import * as types from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* @stability stable
|
|
7
|
+
* @category cdk-utils.sns-manager
|
|
8
|
+
* @subcategory Construct
|
|
9
|
+
* @classdesc Provides operations on AWS Simple Notification Service.
|
|
10
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
11
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
12
|
+
* @example
|
|
13
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
14
|
+
*
|
|
15
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
16
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
17
|
+
* super(parent, id, props)
|
|
18
|
+
* this.props = props
|
|
19
|
+
* this.snsManager.createEmailNotificationService('MySns', 'eu-west-1', ['test@example.com'])
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* @see [CDK Simple Notification Service Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sns-readme.html}
|
|
24
|
+
*/
|
|
25
|
+
export declare class SnsManager {
|
|
26
|
+
/**
|
|
27
|
+
* @summary Method to create an email notification service
|
|
28
|
+
* @param {string} id scoped id of the resource
|
|
29
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
30
|
+
* @param {types.SubscriptionProps} props
|
|
31
|
+
* @param {string[]} emails
|
|
32
|
+
*/
|
|
33
|
+
createEmailNotificationService(id: string, scope: common.CommonConstruct, props: types.SubscriptionProps, emails: string[]): sns.Topic;
|
|
34
|
+
/**
|
|
35
|
+
* @summary Method to create a lambda notification service
|
|
36
|
+
* @param {string} id scoped id of the resource
|
|
37
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
38
|
+
* @param {types.SubscriptionProps} props
|
|
39
|
+
* @param {lambda.Function} lambdaFunction
|
|
40
|
+
*/
|
|
41
|
+
createLambdaNotificationService(id: string, scope: common.CommonConstruct, props: types.SubscriptionProps, lambdaFunction: lambda.Function): sns.Topic;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=sns-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sns-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/sns-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAA;AAChD,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAE1C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,UAAU;IACrB;;;;;;OAMG;IACI,8BAA8B,CACnC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,iBAAiB,EAC9B,MAAM,EAAE,MAAM,EAAE;IAoBlB;;;;;;OAMG;IACI,+BAA+B,CACpC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,iBAAiB,EAC9B,cAAc,EAAE,MAAM,CAAC,QAAQ;CAiBlC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.SnsManager = void 0;
|
|
23
|
+
const sns = __importStar(require("aws-cdk-lib/aws-sns"));
|
|
24
|
+
const subs = __importStar(require("aws-cdk-lib/aws-sns-subscriptions"));
|
|
25
|
+
const utils = __importStar(require("../../utils"));
|
|
26
|
+
/**
|
|
27
|
+
* @stability stable
|
|
28
|
+
* @category cdk-utils.sns-manager
|
|
29
|
+
* @subcategory Construct
|
|
30
|
+
* @classdesc Provides operations on AWS Simple Notification Service.
|
|
31
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
32
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
33
|
+
* @example
|
|
34
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
35
|
+
*
|
|
36
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
37
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
38
|
+
* super(parent, id, props)
|
|
39
|
+
* this.props = props
|
|
40
|
+
* this.snsManager.createEmailNotificationService('MySns', 'eu-west-1', ['test@example.com'])
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
*
|
|
44
|
+
* @see [CDK Simple Notification Service Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sns-readme.html}
|
|
45
|
+
*/
|
|
46
|
+
class SnsManager {
|
|
47
|
+
/**
|
|
48
|
+
* @summary Method to create an email notification service
|
|
49
|
+
* @param {string} id scoped id of the resource
|
|
50
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
51
|
+
* @param {types.SubscriptionProps} props
|
|
52
|
+
* @param {string[]} emails
|
|
53
|
+
*/
|
|
54
|
+
createEmailNotificationService(id, scope, props, emails) {
|
|
55
|
+
if (!props)
|
|
56
|
+
throw `Subscription props undefined`;
|
|
57
|
+
const topic = new sns.Topic(scope, id, {
|
|
58
|
+
displayName: `${props.topicName}-${scope.props.stage}`,
|
|
59
|
+
topicName: `${props.topicName}-${scope.props.stage}`,
|
|
60
|
+
fifo: props.fifo,
|
|
61
|
+
});
|
|
62
|
+
if (emails && emails.length > 0) {
|
|
63
|
+
emails.forEach((email) => topic.addSubscription(new subs.EmailSubscription(email)));
|
|
64
|
+
}
|
|
65
|
+
utils.createCfnOutput(`${id}-subscriptionArn`, scope, topic.topicArn);
|
|
66
|
+
utils.createCfnOutput(`${id}-subscriptionName`, scope, topic.topicName);
|
|
67
|
+
return topic;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @summary Method to create a lambda notification service
|
|
71
|
+
* @param {string} id scoped id of the resource
|
|
72
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
73
|
+
* @param {types.SubscriptionProps} props
|
|
74
|
+
* @param {lambda.Function} lambdaFunction
|
|
75
|
+
*/
|
|
76
|
+
createLambdaNotificationService(id, scope, props, lambdaFunction) {
|
|
77
|
+
if (!props)
|
|
78
|
+
throw `Subscription props undefined`;
|
|
79
|
+
const topic = new sns.Topic(scope, id, {
|
|
80
|
+
displayName: `${props.topicName}-${scope.props.stage}`,
|
|
81
|
+
topicName: `${props.topicName}-${scope.props.stage}`,
|
|
82
|
+
fifo: props.fifo,
|
|
83
|
+
});
|
|
84
|
+
topic.addSubscription(new subs.LambdaSubscription(lambdaFunction));
|
|
85
|
+
utils.createCfnOutput(`${id}-subscriptionArn`, scope, topic.topicArn);
|
|
86
|
+
utils.createCfnOutput(`${id}-subscriptionName`, scope, topic.topicName);
|
|
87
|
+
return topic;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.SnsManager = SnsManager;
|
|
91
|
+
//# sourceMappingURL=sns-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sns-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/s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