@gradientedge/cdk-utils 4.4.5 → 4.4.9
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/.yarn-integrity +1 -1
- package/app/api-destined-function/node_modules/minimatch/README.md +1 -1
- package/app/api-destined-function/node_modules/minimatch/minimatch.js +74 -45
- package/app/api-destined-function/node_modules/minimatch/package.json +3 -3
- 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/package.json +1 -0
- 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 +19 -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 +34 -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 +80 -0
- package/dist/src/lib/common/construct.d.ts.map +1 -0
- package/dist/src/lib/common/construct.js +134 -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 +135 -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 +488 -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/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 +23 -0
- package/dist/src/lib/manager/aws/index.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/index.js +35 -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 +480 -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 +8 -7
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as pylambda from '@aws-cdk/aws-lambda-python-alpha';
|
|
2
|
+
import * as cdk from 'aws-cdk-lib';
|
|
3
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
4
|
+
import * as efs from 'aws-cdk-lib/aws-efs';
|
|
5
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
6
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
7
|
+
import * as common from '../../common';
|
|
8
|
+
import * as types from '../../types';
|
|
9
|
+
/**
|
|
10
|
+
* @stability stable
|
|
11
|
+
* @category cdk-utils.lambda-manager
|
|
12
|
+
* @subcategory Construct
|
|
13
|
+
* @classdesc Provides operations on AWS Lambda.
|
|
14
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
15
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
16
|
+
* @example
|
|
17
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
18
|
+
*
|
|
19
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
20
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
21
|
+
* super(parent, id, props)
|
|
22
|
+
* this.props = props
|
|
23
|
+
* this.lambdaManager.createLambdaFunction('MyFunction', this, role, layers, code)
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
*
|
|
27
|
+
* @see [CDK Lambda Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda-readme.html}
|
|
28
|
+
*/
|
|
29
|
+
export declare class LambdaManager {
|
|
30
|
+
/**
|
|
31
|
+
* @summary Method to create a lambda layer (nodejs)
|
|
32
|
+
* @param {string} id scoped id of the resource
|
|
33
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
34
|
+
* @param {lambda.AssetCode} code
|
|
35
|
+
*/
|
|
36
|
+
createLambdaLayer(id: string, scope: common.CommonConstruct, code: lambda.AssetCode): cdk.aws_lambda.LayerVersion;
|
|
37
|
+
/**
|
|
38
|
+
* @summary Method to create a lambda layer (python)
|
|
39
|
+
* @param {string} id scoped id of the resource
|
|
40
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
41
|
+
* @param {string} entry path to layer source
|
|
42
|
+
*/
|
|
43
|
+
createPythonLambdaLayer(id: string, scope: common.CommonConstruct, entry: string): pylambda.PythonLayerVersion;
|
|
44
|
+
/**
|
|
45
|
+
* @summary Method to create a lambda function (python)
|
|
46
|
+
* @param {string} id scoped id of the resource
|
|
47
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
48
|
+
* @param {types.LambdaProps} props
|
|
49
|
+
* @param {iam.Role | iam.CfnRole} role
|
|
50
|
+
* @param {lambda.ILayerVersion[]} layers
|
|
51
|
+
* @param {string} entry path to lambda source
|
|
52
|
+
* @param {string?} index
|
|
53
|
+
* @param {string?} handler
|
|
54
|
+
* @param {Map<string, string>?} environment
|
|
55
|
+
* @param {ec2.IVpc?} vpc
|
|
56
|
+
* @param {ec2.ISecurityGroup[]?} securityGroups
|
|
57
|
+
* @param {efs.IAccessPoint?} accessPoint
|
|
58
|
+
* @param {string?} mountPath
|
|
59
|
+
* @param {ec2.SubnetSelection?} vpcSubnets
|
|
60
|
+
*/
|
|
61
|
+
createPythonLambdaFunction(id: string, scope: common.CommonConstruct, props: types.LambdaProps, role: iam.Role | iam.CfnRole, layers: lambda.ILayerVersion[], entry: string, index?: string, handler?: string, environment?: any, vpc?: ec2.IVpc, securityGroups?: ec2.ISecurityGroup[], accessPoint?: efs.IAccessPoint, mountPath?: string, vpcSubnets?: ec2.SubnetSelection): pylambda.PythonFunction;
|
|
62
|
+
/**
|
|
63
|
+
* @summary Method to create a lambda function (nodejs)
|
|
64
|
+
* @param {string} id scoped id of the resource
|
|
65
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
66
|
+
* @param {types.LambdaProps} props
|
|
67
|
+
* @param {iam.Role | iam.CfnRole} role
|
|
68
|
+
* @param {lambda.ILayerVersion[]} layers
|
|
69
|
+
* @param {lambda.AssetCode} code
|
|
70
|
+
* @param {string?} handler
|
|
71
|
+
* @param {Map<string, string>?} environment
|
|
72
|
+
* @param {ec2.IVpc?} vpc
|
|
73
|
+
* @param {ec2.ISecurityGroup[]?} securityGroups
|
|
74
|
+
* @param {efs.IAccessPoint?} accessPoint
|
|
75
|
+
* @param {string?} mountPath
|
|
76
|
+
* @param {ec2.SubnetSelection?} vpcSubnets
|
|
77
|
+
*/
|
|
78
|
+
createLambdaFunction(id: string, scope: common.CommonConstruct, props: types.LambdaProps, role: iam.Role | iam.CfnRole, layers: lambda.ILayerVersion[], code: lambda.AssetCode, handler?: string, environment?: any, vpc?: ec2.IVpc, securityGroups?: ec2.ISecurityGroup[], accessPoint?: efs.IAccessPoint, mountPath?: string, vpcSubnets?: ec2.SubnetSelection): cdk.aws_lambda.Function;
|
|
79
|
+
/**
|
|
80
|
+
* @summary Method to provision a Lambda@Edge function
|
|
81
|
+
*
|
|
82
|
+
* @param {string} id scoped id of the resource
|
|
83
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
84
|
+
* @param {types.LambdaEdgeProps} props lambda@edge properties
|
|
85
|
+
* @param {lambda.ILayerVersion[]} layers
|
|
86
|
+
* @param {lambda.AssetCode} code
|
|
87
|
+
* @param {Map<string, string>?} environment
|
|
88
|
+
* @param {ec2.IVpc?} vpc
|
|
89
|
+
* @param {ec2.ISecurityGroup[]?} securityGroups
|
|
90
|
+
* @param {efs.IAccessPoint?} accessPoint
|
|
91
|
+
* @param {string?} mountPath
|
|
92
|
+
*/
|
|
93
|
+
createEdgeFunction(id: string, scope: common.CommonConstruct, props: types.LambdaEdgeProps, layers: lambda.ILayerVersion[], code: lambda.AssetCode, environment?: any, vpc?: ec2.IVpc, securityGroups?: ec2.ISecurityGroup[], accessPoint?: efs.IAccessPoint, mountPath?: string): cdk.aws_cloudfront.experimental.EdgeFunction;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=lambda-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lambda-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/lambda-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAA;AAC5D,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAA;AAChD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM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EAAE,GAAG,CAAC,IAAI,EACd,cAAc,CAAC,EAAE,GAAG,CAAC,cAAc,EAAE,EACrC,WAAW,CAAC,EAAE,GAAG,CAAC,YAAY,EAC9B,SAAS,CAAC,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,GAAG,CAAC,eAAe;IAmClC;;;;;;;;;;;;;OAaG;IACI,kBAAkB,CACvB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,eAAe,EAC5B,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,EAC9B,IAAI,EAAE,MAAM,CAAC,SAAS,EACtB,WAAW,CAAC,EAAE,GAAG,EACjB,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,EACd,cAAc,CAAC,EAAE,GAAG,CAAC,cAAc,EAAE,EACrC,WAAW,CAAC,EAAE,GAAG,CAAC,YAAY,EAC9B,SAAS,CAAC,EAAE,MAAM;CAerB"}
|
|
@@ -0,0 +1,197 @@
|
|
|
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.LambdaManager = void 0;
|
|
23
|
+
const pylambda = __importStar(require("@aws-cdk/aws-lambda-python-alpha"));
|
|
24
|
+
const cdk = __importStar(require("aws-cdk-lib"));
|
|
25
|
+
const iam = __importStar(require("aws-cdk-lib/aws-iam"));
|
|
26
|
+
const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
|
|
27
|
+
const utils = __importStar(require("../../utils"));
|
|
28
|
+
const cloudfront_manager_1 = require("./cloudfront-manager");
|
|
29
|
+
/**
|
|
30
|
+
* @stability stable
|
|
31
|
+
* @category cdk-utils.lambda-manager
|
|
32
|
+
* @subcategory Construct
|
|
33
|
+
* @classdesc Provides operations on AWS Lambda.
|
|
34
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
35
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
36
|
+
* @example
|
|
37
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
38
|
+
*
|
|
39
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
40
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
41
|
+
* super(parent, id, props)
|
|
42
|
+
* this.props = props
|
|
43
|
+
* this.lambdaManager.createLambdaFunction('MyFunction', this, role, layers, code)
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
*
|
|
47
|
+
* @see [CDK Lambda Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda-readme.html}
|
|
48
|
+
*/
|
|
49
|
+
class LambdaManager {
|
|
50
|
+
/**
|
|
51
|
+
* @summary Method to create a lambda layer (nodejs)
|
|
52
|
+
* @param {string} id scoped id of the resource
|
|
53
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
54
|
+
* @param {lambda.AssetCode} code
|
|
55
|
+
*/
|
|
56
|
+
createLambdaLayer(id, scope, code) {
|
|
57
|
+
const lambdaLayer = new lambda.LayerVersion(scope, `${id}`, {
|
|
58
|
+
compatibleRuntimes: [lambda.Runtime.NODEJS_14_X],
|
|
59
|
+
code: code,
|
|
60
|
+
description: `${id}`,
|
|
61
|
+
layerVersionName: `${id}-${scope.props.stage}`,
|
|
62
|
+
});
|
|
63
|
+
utils.createCfnOutput(`${id}-lambdaLayerArn`, scope, lambdaLayer.layerVersionArn);
|
|
64
|
+
return lambdaLayer;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @summary Method to create a lambda layer (python)
|
|
68
|
+
* @param {string} id scoped id of the resource
|
|
69
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
70
|
+
* @param {string} entry path to layer source
|
|
71
|
+
*/
|
|
72
|
+
createPythonLambdaLayer(id, scope, entry) {
|
|
73
|
+
const lambdaLayer = new pylambda.PythonLayerVersion(scope, `${id}`, {
|
|
74
|
+
compatibleRuntimes: [lambda.Runtime.PYTHON_3_8],
|
|
75
|
+
description: `${id}`,
|
|
76
|
+
entry: entry,
|
|
77
|
+
layerVersionName: `${id}-${scope.props.stage}`,
|
|
78
|
+
});
|
|
79
|
+
utils.createCfnOutput(`${id}-lambdaLayerArn`, scope, lambdaLayer.layerVersionArn);
|
|
80
|
+
return lambdaLayer;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @summary Method to create a lambda function (python)
|
|
84
|
+
* @param {string} id scoped id of the resource
|
|
85
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
86
|
+
* @param {types.LambdaProps} props
|
|
87
|
+
* @param {iam.Role | iam.CfnRole} role
|
|
88
|
+
* @param {lambda.ILayerVersion[]} layers
|
|
89
|
+
* @param {string} entry path to lambda source
|
|
90
|
+
* @param {string?} index
|
|
91
|
+
* @param {string?} handler
|
|
92
|
+
* @param {Map<string, string>?} environment
|
|
93
|
+
* @param {ec2.IVpc?} vpc
|
|
94
|
+
* @param {ec2.ISecurityGroup[]?} securityGroups
|
|
95
|
+
* @param {efs.IAccessPoint?} accessPoint
|
|
96
|
+
* @param {string?} mountPath
|
|
97
|
+
* @param {ec2.SubnetSelection?} vpcSubnets
|
|
98
|
+
*/
|
|
99
|
+
createPythonLambdaFunction(id, scope, props, role, layers, entry, index, handler, environment, vpc, securityGroups, accessPoint, mountPath, vpcSubnets) {
|
|
100
|
+
if (!props)
|
|
101
|
+
throw `Lambda props undefined`;
|
|
102
|
+
const functionName = `${props.functionName}-${scope.props.stage}`;
|
|
103
|
+
const lambdaFunction = new pylambda.PythonFunction(scope, `${id}`, {
|
|
104
|
+
allowPublicSubnet: !!vpc,
|
|
105
|
+
functionName: functionName,
|
|
106
|
+
index: index,
|
|
107
|
+
handler: handler,
|
|
108
|
+
runtime: lambda.Runtime.PYTHON_3_8,
|
|
109
|
+
entry: entry,
|
|
110
|
+
environment: {
|
|
111
|
+
REGION: scope.props.region,
|
|
112
|
+
...environment,
|
|
113
|
+
},
|
|
114
|
+
filesystem: accessPoint ? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
|
|
115
|
+
layers: layers,
|
|
116
|
+
logRetention: props.logRetention,
|
|
117
|
+
memorySize: props.memorySize,
|
|
118
|
+
onFailure: props.onFailure,
|
|
119
|
+
onSuccess: props.onSuccess,
|
|
120
|
+
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
121
|
+
role: role instanceof iam.Role ? role : undefined,
|
|
122
|
+
securityGroups: securityGroups,
|
|
123
|
+
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
124
|
+
vpc: vpc,
|
|
125
|
+
vpcSubnets: vpcSubnets,
|
|
126
|
+
});
|
|
127
|
+
utils.createCfnOutput(`${id}-lambdaArn`, scope, lambdaFunction.functionArn);
|
|
128
|
+
utils.createCfnOutput(`${id}-lambdaName`, scope, lambdaFunction.functionName);
|
|
129
|
+
return lambdaFunction;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* @summary Method to create a lambda function (nodejs)
|
|
133
|
+
* @param {string} id scoped id of the resource
|
|
134
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
135
|
+
* @param {types.LambdaProps} props
|
|
136
|
+
* @param {iam.Role | iam.CfnRole} role
|
|
137
|
+
* @param {lambda.ILayerVersion[]} layers
|
|
138
|
+
* @param {lambda.AssetCode} code
|
|
139
|
+
* @param {string?} handler
|
|
140
|
+
* @param {Map<string, string>?} environment
|
|
141
|
+
* @param {ec2.IVpc?} vpc
|
|
142
|
+
* @param {ec2.ISecurityGroup[]?} securityGroups
|
|
143
|
+
* @param {efs.IAccessPoint?} accessPoint
|
|
144
|
+
* @param {string?} mountPath
|
|
145
|
+
* @param {ec2.SubnetSelection?} vpcSubnets
|
|
146
|
+
*/
|
|
147
|
+
createLambdaFunction(id, scope, props, role, layers, code, handler, environment, vpc, securityGroups, accessPoint, mountPath, vpcSubnets) {
|
|
148
|
+
if (!props)
|
|
149
|
+
throw `Lambda props undefined`;
|
|
150
|
+
const functionName = `${props.functionName}-${scope.props.stage}`;
|
|
151
|
+
const lambdaFunction = new lambda.Function(scope, `${id}`, {
|
|
152
|
+
allowPublicSubnet: !!vpc,
|
|
153
|
+
functionName: functionName,
|
|
154
|
+
handler: handler || 'index.lambda_handler',
|
|
155
|
+
runtime: lambda.Runtime.NODEJS_14_X,
|
|
156
|
+
code: code,
|
|
157
|
+
environment: {
|
|
158
|
+
REGION: scope.props.region,
|
|
159
|
+
...environment,
|
|
160
|
+
},
|
|
161
|
+
filesystem: accessPoint ? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
|
|
162
|
+
layers: layers,
|
|
163
|
+
logRetention: props.logRetention,
|
|
164
|
+
memorySize: props.memorySize,
|
|
165
|
+
onFailure: props.onFailure,
|
|
166
|
+
onSuccess: props.onSuccess,
|
|
167
|
+
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
168
|
+
role: role instanceof iam.Role ? role : undefined,
|
|
169
|
+
securityGroups: securityGroups,
|
|
170
|
+
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
171
|
+
vpc: vpc,
|
|
172
|
+
vpcSubnets: vpcSubnets,
|
|
173
|
+
});
|
|
174
|
+
utils.createCfnOutput(`${id}-lambdaArn`, scope, lambdaFunction.functionArn);
|
|
175
|
+
utils.createCfnOutput(`${id}-lambdaName`, scope, lambdaFunction.functionName);
|
|
176
|
+
return lambdaFunction;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* @summary Method to provision a Lambda@Edge function
|
|
180
|
+
*
|
|
181
|
+
* @param {string} id scoped id of the resource
|
|
182
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
183
|
+
* @param {types.LambdaEdgeProps} props lambda@edge properties
|
|
184
|
+
* @param {lambda.ILayerVersion[]} layers
|
|
185
|
+
* @param {lambda.AssetCode} code
|
|
186
|
+
* @param {Map<string, string>?} environment
|
|
187
|
+
* @param {ec2.IVpc?} vpc
|
|
188
|
+
* @param {ec2.ISecurityGroup[]?} securityGroups
|
|
189
|
+
* @param {efs.IAccessPoint?} accessPoint
|
|
190
|
+
* @param {string?} mountPath
|
|
191
|
+
*/
|
|
192
|
+
createEdgeFunction(id, scope, props, layers, code, environment, vpc, securityGroups, accessPoint, mountPath) {
|
|
193
|
+
return new cloudfront_manager_1.CloudFrontManager().createEdgeFunction(id, scope, props, layers, code, environment, vpc, securityGroups, accessPoint, mountPath);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
exports.LambdaManager = LambdaManager;
|
|
197
|
+
//# sourceMappingURL=lambda-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lambda-manager.js","sourceRoot":"","sources":["../../../../../src/lib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CAAA;IACH,CAAC;CACF;AAlND,sCAkNC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as cdk from 'aws-cdk-lib';
|
|
2
|
+
import * as logs from 'aws-cdk-lib/aws-logs';
|
|
3
|
+
import * as common from '../../common';
|
|
4
|
+
import * as types from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* @stability stable
|
|
7
|
+
* @category cdk-utils.cloudwatch-manager
|
|
8
|
+
* @subcategory Construct
|
|
9
|
+
* @classdesc Provides operations on AWS CloudWatch.
|
|
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.logsManager.createMetricFilter('MyMetricFilter', this, logGroup)
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* @see [CDK CloudWatch Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs-readme.html}
|
|
24
|
+
*/
|
|
25
|
+
export declare class LogManager {
|
|
26
|
+
/**
|
|
27
|
+
* @summary Method to create a cloudwatch metric filter
|
|
28
|
+
* @param {string} id scoped id of the resource
|
|
29
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
30
|
+
* @param {types.MetricFilterProps} props
|
|
31
|
+
* @param {logs.ILogGroup} logGroup
|
|
32
|
+
*/
|
|
33
|
+
createMetricFilter(id: string, scope: common.CommonConstruct, props: types.MetricFilterProps, logGroup: logs.ILogGroup): {
|
|
34
|
+
metricFilter: cdk.aws_logs.MetricFilter;
|
|
35
|
+
metric: cdk.aws_cloudwatch.Metric;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @summary Method to create a cloudwatch log group (cfn)
|
|
39
|
+
* @param {string} id scoped id of the resource
|
|
40
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
41
|
+
* @param {types.LogProps} props
|
|
42
|
+
*/
|
|
43
|
+
createCfnLogGroup(id: string, scope: common.CommonConstruct, props: types.LogProps): cdk.aws_logs.CfnLogGroup;
|
|
44
|
+
/**
|
|
45
|
+
* @summary Method to create a cloudwatch log group
|
|
46
|
+
* @param {string} id scoped id of the resource
|
|
47
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
48
|
+
* @param {types.LogProps} props
|
|
49
|
+
*/
|
|
50
|
+
createLogGroup(id: string, scope: common.CommonConstruct, props: types.LogProps): cdk.aws_logs.LogGroup;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=log-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/log-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAA;AAC5C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,UAAU;IACrB;;;;;;OAMG;IACI,kBAAkB,CACvB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,iBAAiB,EAC9B,QAAQ,EAAE,IAAI,CAAC,SAAS;;;;IAwB1B;;;;;OAKG;IACI,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ;IAazF;;;;;OAKG;IACI,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ;CAavF"}
|
|
@@ -0,0 +1,109 @@
|
|
|
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.LogManager = void 0;
|
|
23
|
+
const cdk = __importStar(require("aws-cdk-lib"));
|
|
24
|
+
const logs = __importStar(require("aws-cdk-lib/aws-logs"));
|
|
25
|
+
const utils = __importStar(require("../../utils"));
|
|
26
|
+
/**
|
|
27
|
+
* @stability stable
|
|
28
|
+
* @category cdk-utils.cloudwatch-manager
|
|
29
|
+
* @subcategory Construct
|
|
30
|
+
* @classdesc Provides operations on AWS CloudWatch.
|
|
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.logsManager.createMetricFilter('MyMetricFilter', this, logGroup)
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
*
|
|
44
|
+
* @see [CDK CloudWatch Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs-readme.html}
|
|
45
|
+
*/
|
|
46
|
+
class LogManager {
|
|
47
|
+
/**
|
|
48
|
+
* @summary Method to create a cloudwatch metric filter
|
|
49
|
+
* @param {string} id scoped id of the resource
|
|
50
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
51
|
+
* @param {types.MetricFilterProps} props
|
|
52
|
+
* @param {logs.ILogGroup} logGroup
|
|
53
|
+
*/
|
|
54
|
+
createMetricFilter(id, scope, props, logGroup) {
|
|
55
|
+
if (!props)
|
|
56
|
+
throw `MetricFilter props undefined`;
|
|
57
|
+
const metricFilter = new logs.MetricFilter(scope, `${id}`, {
|
|
58
|
+
logGroup: logGroup,
|
|
59
|
+
metricName: props.metricName,
|
|
60
|
+
metricNamespace: props.metricNamespace,
|
|
61
|
+
metricValue: props.metricValue,
|
|
62
|
+
defaultValue: props.defaultValue,
|
|
63
|
+
filterPattern: props.filterPattern,
|
|
64
|
+
});
|
|
65
|
+
const metric = props.options
|
|
66
|
+
? metricFilter.metric({
|
|
67
|
+
dimensionsMap: props.options.dimensionsMap,
|
|
68
|
+
statistic: props.options.statistic,
|
|
69
|
+
period: props.periodInSecs ? cdk.Duration.seconds(props.periodInSecs) : cdk.Duration.minutes(5),
|
|
70
|
+
})
|
|
71
|
+
: metricFilter.metric();
|
|
72
|
+
return { metricFilter, metric };
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @summary Method to create a cloudwatch log group (cfn)
|
|
76
|
+
* @param {string} id scoped id of the resource
|
|
77
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
78
|
+
* @param {types.LogProps} props
|
|
79
|
+
*/
|
|
80
|
+
createCfnLogGroup(id, scope, props) {
|
|
81
|
+
if (!props)
|
|
82
|
+
throw `Logs props undefined`;
|
|
83
|
+
const logGroup = new logs.CfnLogGroup(scope, `${id}`, {
|
|
84
|
+
logGroupName: `${props.logGroupName}-${scope.props.stage}`,
|
|
85
|
+
retentionInDays: props.retention,
|
|
86
|
+
});
|
|
87
|
+
utils.createCfnOutput(`${id}-logGroupArn`, scope, logGroup.attrArn);
|
|
88
|
+
return logGroup;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @summary Method to create a cloudwatch log group
|
|
92
|
+
* @param {string} id scoped id of the resource
|
|
93
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
94
|
+
* @param {types.LogProps} props
|
|
95
|
+
*/
|
|
96
|
+
createLogGroup(id, scope, props) {
|
|
97
|
+
if (!props)
|
|
98
|
+
throw `Logs props undefined`;
|
|
99
|
+
const logGroup = new logs.LogGroup(scope, `${id}`, {
|
|
100
|
+
logGroupName: `${props.logGroupName}-${scope.props.stage}`,
|
|
101
|
+
retention: props.retention,
|
|
102
|
+
removalPolicy: props.removalPolicy ?? cdk.RemovalPolicy.DESTROY,
|
|
103
|
+
});
|
|
104
|
+
utils.createCfnOutput(`${id}-logGroupArn`, scope, logGroup.logGroupArn);
|
|
105
|
+
return logGroup;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.LogManager = LogManager;
|
|
109
|
+
//# sourceMappingURL=log-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/log-manager.ts"],"names":[],"mappings":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AW,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACpD,YAAY,EAAE,GAAG,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YAC1D,eAAe,EAAE,KAAK,CAAC,SAAS;SACjC,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;QAEnE,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED;;;;;OAKG;IACI,cAAc,CAAC,EAAU,EAAE,KAA6B,EAAE,KAAqB;QACpF,IAAI,CAAC,KAAK;YAAE,MAAM,sBAAsB,CAAA;QAExC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACjD,YAAY,EAAE,GAAG,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YAC1D,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,GAAG,CAAC,aAAa,CAAC,OAAO;SAChE,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAA;QAEvE,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AA1ED,gCA0EC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as apig from 'aws-cdk-lib/aws-apigateway';
|
|
2
|
+
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
|
|
3
|
+
import * as route53 from 'aws-cdk-lib/aws-route53';
|
|
4
|
+
import * as common from '../../common';
|
|
5
|
+
import * as types from '../../types';
|
|
6
|
+
/**
|
|
7
|
+
* @stability stable
|
|
8
|
+
* @category cdk-utils.route53-manager
|
|
9
|
+
* @subcategory Construct
|
|
10
|
+
* @classdesc Provides operations on AWS Route53.
|
|
11
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
12
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
13
|
+
* @example
|
|
14
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
15
|
+
*
|
|
16
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
17
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
18
|
+
* super(parent, id, props)
|
|
19
|
+
* this.props = props
|
|
20
|
+
* this.route53Manager.createHostedZone('MyHostedZone', this)
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* @see [CDK Route53 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53-readme.html}
|
|
25
|
+
*/
|
|
26
|
+
export declare class Route53Manager {
|
|
27
|
+
/**
|
|
28
|
+
* @summary Method to create a hosted zone
|
|
29
|
+
* @param {string} id scoped id of the resource
|
|
30
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
31
|
+
* @param {types.Route53Props} props
|
|
32
|
+
*/
|
|
33
|
+
createHostedZone(id: string, scope: common.CommonConstruct, props: types.Route53Props): route53.IHostedZone;
|
|
34
|
+
/**
|
|
35
|
+
* @summary Method to create/lookup a hosted zone
|
|
36
|
+
* @param {string} id scoped id of the resource
|
|
37
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
38
|
+
* @param useExistingHostedZone Flag to indicate whether to lookup vs create new hosted zone
|
|
39
|
+
*/
|
|
40
|
+
withHostedZoneFromFullyQualifiedDomainName(id: string, scope: common.CommonConstruct, useExistingHostedZone: boolean): route53.IHostedZone;
|
|
41
|
+
/**
|
|
42
|
+
* @summary Method to create a-record for cloudfront target
|
|
43
|
+
* @param {string} id scoped id of the resource
|
|
44
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
45
|
+
* @param {cloudfront.IDistribution} distribution
|
|
46
|
+
* @param {route53.IHostedZone} hostedZone
|
|
47
|
+
* @param {string} recordName
|
|
48
|
+
*/
|
|
49
|
+
createCloudFrontTargetARecord(id: string, scope: common.CommonConstruct, distribution?: cloudfront.IDistribution, hostedZone?: route53.IHostedZone, recordName?: string): route53.ARecord;
|
|
50
|
+
/**
|
|
51
|
+
* @summary Method to create a-record for cloudfront target
|
|
52
|
+
* @param {string} id scoped id of the resource
|
|
53
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
54
|
+
* @param {cloudfront.IDistribution} distribution
|
|
55
|
+
* @param {route53.IHostedZone} hostedZone
|
|
56
|
+
* @param {string} recordName
|
|
57
|
+
*/
|
|
58
|
+
createCloudFrontTargetARecordV2(id: string, scope: common.CommonConstruct, distribution?: cloudfront.IDistribution, hostedZone?: route53.IHostedZone, recordName?: string): route53.ARecord;
|
|
59
|
+
/**
|
|
60
|
+
* @summary Method to create a-record for restApi gateway target
|
|
61
|
+
* @param {string} id scoped id of the resource
|
|
62
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
63
|
+
* @param recordName
|
|
64
|
+
* @param apiDomain
|
|
65
|
+
* @param hostedZone
|
|
66
|
+
*/
|
|
67
|
+
createApiGatewayARecord(id: string, scope: common.CommonConstruct, recordName: string, apiDomain: apig.DomainName, hostedZone: route53.IHostedZone): route53.ARecord;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=route53-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route53-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/route53-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAA;AAClD,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAA;AAElD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;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