@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,32 @@
|
|
|
1
|
+
import * as ecr from 'aws-cdk-lib/aws-ecr-assets';
|
|
2
|
+
import * as common from '../../common';
|
|
3
|
+
/**
|
|
4
|
+
* @stability stable
|
|
5
|
+
* @category cdk-utils.ecr-manager
|
|
6
|
+
* @subcategory Construct
|
|
7
|
+
* @classdesc Provides operations on AWS Elastic Container Registry.
|
|
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.ecrManager.createDockerImage('MyImage', this, dockerfilePath)
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* @see [CDK ECR Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecr-readme.html}
|
|
22
|
+
*/
|
|
23
|
+
export declare class EcrManager {
|
|
24
|
+
/**
|
|
25
|
+
* @summary Method to create a docker image in ecr
|
|
26
|
+
* @param {string} id scoped id of the resource
|
|
27
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
28
|
+
* @param {string} dockerfilePath
|
|
29
|
+
*/
|
|
30
|
+
createDockerImage(id: string, scope: common.CommonConstruct, dockerfilePath: string): ecr.DockerImageAsset;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=ecr-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ecr-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/ecr-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAA;AACjD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AAGtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,UAAU;IACrB;;;;;OAKG;IACI,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,cAAc,EAAE,MAAM;CAS3F"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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.EcrManager = void 0;
|
|
23
|
+
const ecr = __importStar(require("aws-cdk-lib/aws-ecr-assets"));
|
|
24
|
+
const utils = __importStar(require("../../utils"));
|
|
25
|
+
/**
|
|
26
|
+
* @stability stable
|
|
27
|
+
* @category cdk-utils.ecr-manager
|
|
28
|
+
* @subcategory Construct
|
|
29
|
+
* @classdesc Provides operations on AWS Elastic Container Registry.
|
|
30
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
31
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
32
|
+
* @example
|
|
33
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
34
|
+
*
|
|
35
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
36
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
37
|
+
* super(parent, id, props)
|
|
38
|
+
* this.props = props
|
|
39
|
+
* this.ecrManager.createDockerImage('MyImage', this, dockerfilePath)
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* @see [CDK ECR Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecr-readme.html}
|
|
44
|
+
*/
|
|
45
|
+
class EcrManager {
|
|
46
|
+
/**
|
|
47
|
+
* @summary Method to create a docker image in ecr
|
|
48
|
+
* @param {string} id scoped id of the resource
|
|
49
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
50
|
+
* @param {string} dockerfilePath
|
|
51
|
+
*/
|
|
52
|
+
createDockerImage(id, scope, dockerfilePath) {
|
|
53
|
+
const asset = new ecr.DockerImageAsset(scope, `${id}`, {
|
|
54
|
+
directory: dockerfilePath,
|
|
55
|
+
});
|
|
56
|
+
utils.createCfnOutput(`${id}-dockerImageArn`, scope, asset.imageUri);
|
|
57
|
+
return asset;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.EcrManager = EcrManager;
|
|
61
|
+
//# sourceMappingURL=ecr-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ecr-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/ecr-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAiD;AAEjD,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,UAAU;IACrB;;;;;OAKG;IACI,iBAAiB,CAAC,EAAU,EAAE,KAA6B,EAAE,cAAsB;QACxF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACrD,SAAS,EAAE,cAAc;SAC1B,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;QAEpE,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAhBD,gCAgBC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
2
|
+
import * as ecs from 'aws-cdk-lib/aws-ecs';
|
|
3
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
4
|
+
import * as logs from 'aws-cdk-lib/aws-logs';
|
|
5
|
+
import * as common from '../../common';
|
|
6
|
+
import * as types from '../../types';
|
|
7
|
+
/**
|
|
8
|
+
* @stability stable
|
|
9
|
+
* @category cdk-utils.ecs-manager
|
|
10
|
+
* @subcategory Construct
|
|
11
|
+
* @classdesc Provides operations on AWS Elastic Container Service.
|
|
12
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
13
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
14
|
+
* @example
|
|
15
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
16
|
+
*
|
|
17
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
18
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
19
|
+
* super(parent, id, props)
|
|
20
|
+
* this.props = props
|
|
21
|
+
* this.ecsManager.createEcsCluster('MyCluster', this, vpc)
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
*
|
|
25
|
+
* @see [CDK ECS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs-readme.html}
|
|
26
|
+
*/
|
|
27
|
+
export declare class EcsManager {
|
|
28
|
+
/**
|
|
29
|
+
* @summary Method to create an ecs cluster
|
|
30
|
+
* @param {string} id scoped id of the resource
|
|
31
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
32
|
+
* @param {types.EcsClusterProps} props
|
|
33
|
+
* @param {ec2.IVpc} vpc
|
|
34
|
+
*/
|
|
35
|
+
createEcsCluster(id: string, scope: common.CommonConstruct, props: types.EcsClusterProps, vpc: ec2.IVpc): ecs.Cluster;
|
|
36
|
+
/**
|
|
37
|
+
* @summary Method to create an ecs fargate task
|
|
38
|
+
* @param {string} id scoped id of the resource
|
|
39
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
40
|
+
* @param {types.EcsTaskProps} props
|
|
41
|
+
* @param {ecs.ICluster} cluster
|
|
42
|
+
* @param {iam.Role} role
|
|
43
|
+
* @param {logs.ILogGroup} logGroup
|
|
44
|
+
* @param {ecs.ContainerImage} containerImage
|
|
45
|
+
* @param {Map<string, string>} environment
|
|
46
|
+
*/
|
|
47
|
+
createEcsFargateTask(id: string, scope: common.CommonConstruct, props: types.EcsTaskProps, cluster: ecs.ICluster, role: iam.Role, logGroup: logs.ILogGroup, containerImage: ecs.ContainerImage, environment?: any): ecs.TaskDefinition;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=ecs-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ecs-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/ecs-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,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,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI;IAc9G;;;;;;;;;;OAUG;IACI,oBAAoB,CACzB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,YAAY,EACzB,OAAO,EAAE,GAAG,CAAC,QAAQ,EACrB,IAAI,EAAE,GAAG,CAAC,IAAI,EACd,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,cAAc,EAAE,GAAG,CAAC,cAAc,EAClC,WAAW,CAAC,EAAE,GAAG;CA+BpB"}
|
|
@@ -0,0 +1,104 @@
|
|
|
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.EcsManager = void 0;
|
|
23
|
+
const ecs = __importStar(require("aws-cdk-lib/aws-ecs"));
|
|
24
|
+
const utils = __importStar(require("../../utils"));
|
|
25
|
+
/**
|
|
26
|
+
* @stability stable
|
|
27
|
+
* @category cdk-utils.ecs-manager
|
|
28
|
+
* @subcategory Construct
|
|
29
|
+
* @classdesc Provides operations on AWS Elastic Container Service.
|
|
30
|
+
* - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
|
|
31
|
+
* - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
|
|
32
|
+
* @example
|
|
33
|
+
* import * as common from '@gradientedge/cdk-utils'
|
|
34
|
+
*
|
|
35
|
+
* class CustomConstruct extends common.common.CommonConstruct {
|
|
36
|
+
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
37
|
+
* super(parent, id, props)
|
|
38
|
+
* this.props = props
|
|
39
|
+
* this.ecsManager.createEcsCluster('MyCluster', this, vpc)
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* @see [CDK ECS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs-readme.html}
|
|
44
|
+
*/
|
|
45
|
+
class EcsManager {
|
|
46
|
+
/**
|
|
47
|
+
* @summary Method to create an ecs cluster
|
|
48
|
+
* @param {string} id scoped id of the resource
|
|
49
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
50
|
+
* @param {types.EcsClusterProps} props
|
|
51
|
+
* @param {ec2.IVpc} vpc
|
|
52
|
+
*/
|
|
53
|
+
createEcsCluster(id, scope, props, vpc) {
|
|
54
|
+
if (!props)
|
|
55
|
+
throw `Ecs Cluster props undefined`;
|
|
56
|
+
const ecsCluster = new ecs.Cluster(scope, `${id}`, {
|
|
57
|
+
clusterName: `${props.clusterName}-${scope.props.stage}`,
|
|
58
|
+
vpc: vpc,
|
|
59
|
+
});
|
|
60
|
+
utils.createCfnOutput(`${id}-clusterArn`, scope, ecsCluster.clusterArn);
|
|
61
|
+
utils.createCfnOutput(`${id}-clusterName`, scope, ecsCluster.clusterName);
|
|
62
|
+
return ecsCluster;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @summary Method to create an ecs fargate task
|
|
66
|
+
* @param {string} id scoped id of the resource
|
|
67
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
68
|
+
* @param {types.EcsTaskProps} props
|
|
69
|
+
* @param {ecs.ICluster} cluster
|
|
70
|
+
* @param {iam.Role} role
|
|
71
|
+
* @param {logs.ILogGroup} logGroup
|
|
72
|
+
* @param {ecs.ContainerImage} containerImage
|
|
73
|
+
* @param {Map<string, string>} environment
|
|
74
|
+
*/
|
|
75
|
+
createEcsFargateTask(id, scope, props, cluster, role, logGroup, containerImage, environment) {
|
|
76
|
+
if (!props)
|
|
77
|
+
throw `EcsTask props undefined`;
|
|
78
|
+
const ecsTask = new ecs.TaskDefinition(scope, `${id}`, {
|
|
79
|
+
compatibility: ecs.Compatibility.FARGATE,
|
|
80
|
+
cpu: props.cpu,
|
|
81
|
+
executionRole: role,
|
|
82
|
+
family: `${props.family}-${scope.props.stage}`,
|
|
83
|
+
memoryMiB: props.memoryMiB,
|
|
84
|
+
networkMode: ecs.NetworkMode.AWS_VPC,
|
|
85
|
+
taskRole: role,
|
|
86
|
+
});
|
|
87
|
+
ecsTask.addContainer('EcsContainer', {
|
|
88
|
+
cpu: props.cpu ? parseInt(props.cpu) : undefined,
|
|
89
|
+
disableNetworking: false,
|
|
90
|
+
environment: environment,
|
|
91
|
+
image: containerImage,
|
|
92
|
+
logging: ecs.LogDriver.awsLogs({
|
|
93
|
+
logGroup: logGroup,
|
|
94
|
+
streamPrefix: `${id}`,
|
|
95
|
+
}),
|
|
96
|
+
memoryLimitMiB: props.memoryMiB ? parseInt(props.memoryMiB) : undefined,
|
|
97
|
+
privileged: false,
|
|
98
|
+
});
|
|
99
|
+
utils.createCfnOutput(`${id}-taskArn`, scope, ecsTask.taskDefinitionArn);
|
|
100
|
+
return ecsTask;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.EcsManager = EcsManager;
|
|
104
|
+
//# sourceMappingURL=ecs-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ecs-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/ecs-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,yDAA0C;AAK1C,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,UAAU;IACrB;;;;;;OAMG;IACI,gBAAgB,CAAC,EAAU,EAAE,KAA6B,EAAE,KAA4B,EAAE,GAAa;QAC5G,IAAI,CAAC,KAAK;YAAE,MAAM,6BAA6B,CAAA;QAE/C,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACjD,WAAW,EAAE,GAAG,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YACxD,GAAG,EAAE,GAAG;SACT,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,CAAA;QACvE,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,CAAA;QAEzE,OAAO,UAAU,CAAA;IACnB,CAAC;IAED;;;;;;;;;;OAUG;IACI,oBAAoB,CACzB,EAAU,EACV,KAA6B,EAC7B,KAAyB,EACzB,OAAqB,EACrB,IAAc,EACd,QAAwB,EACxB,cAAkC,EAClC,WAAiB;QAEjB,IAAI,CAAC,KAAK;YAAE,MAAM,yBAAyB,CAAA;QAE3C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACrD,aAAa,EAAE,GAAG,CAAC,aAAa,CAAC,OAAO;YACxC,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,aAAa,EAAE,IAAI;YACnB,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YAC9C,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,OAAO;YACpC,QAAQ,EAAE,IAAI;SACf,CAAC,CAAA;QAEF,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE;YACnC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;YAChD,iBAAiB,EAAE,KAAK;YACxB,WAAW,EAAE,WAAW;YACxB,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC;gBAC7B,QAAQ,EAAE,QAAQ;gBAClB,YAAY,EAAE,GAAG,EAAE,EAAE;aACtB,CAAC;YACF,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;YACvE,UAAU,EAAE,KAAK;SAClB,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;QAExE,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AAxED,gCAwEC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
2
|
+
import * as ecr from 'aws-cdk-lib/aws-ecr-assets';
|
|
3
|
+
import * as eks from 'aws-cdk-lib/aws-eks';
|
|
4
|
+
import * as common from '../../common';
|
|
5
|
+
import * as types from '../../types';
|
|
6
|
+
/**
|
|
7
|
+
* @stability stable
|
|
8
|
+
* @category cdk-utils.eks-manager
|
|
9
|
+
* @subcategory Construct
|
|
10
|
+
* @classdesc Provides operations on AWS Elastic Kubernetes Service.
|
|
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.eksManager.createEksDeployment('MyEksDeployment', this, image, vpc)
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* @see [CDK EKS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks-readme.html}
|
|
25
|
+
*/
|
|
26
|
+
export declare class EksManager {
|
|
27
|
+
/**
|
|
28
|
+
* @summary Method to create an eks deployment
|
|
29
|
+
* @param {string} id scoped id of the resource
|
|
30
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
31
|
+
* @param {types.EksClusterProps} props
|
|
32
|
+
* @param {ecr.DockerImageAsset} image
|
|
33
|
+
* @param {ec2.IVpc} vpc
|
|
34
|
+
*/
|
|
35
|
+
createEksDeployment(id: string, scope: common.CommonConstruct, props: types.EksClusterProps, image: ecr.DockerImageAsset, vpc: ec2.IVpc): eks.Cluster;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=eks-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eks-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/eks-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAA;AACjD,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,UAAU;IACrB;;;;;;;OAOG;IACI,mBAAmB,CACxB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,eAAe,EAC5B,KAAK,EAAE,GAAG,CAAC,gBAAgB,EAC3B,GAAG,EAAE,GAAG,CAAC,IAAI;CA4DhB"}
|
|
@@ -0,0 +1,110 @@
|
|
|
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.EksManager = void 0;
|
|
23
|
+
const ec2 = __importStar(require("aws-cdk-lib/aws-ec2"));
|
|
24
|
+
const eks = __importStar(require("aws-cdk-lib/aws-eks"));
|
|
25
|
+
const utils = __importStar(require("../../utils"));
|
|
26
|
+
/**
|
|
27
|
+
* @stability stable
|
|
28
|
+
* @category cdk-utils.eks-manager
|
|
29
|
+
* @subcategory Construct
|
|
30
|
+
* @classdesc Provides operations on AWS Elastic Kubernetes 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.eksManager.createEksDeployment('MyEksDeployment', this, image, vpc)
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
*
|
|
44
|
+
* @see [CDK EKS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks-readme.html}
|
|
45
|
+
*/
|
|
46
|
+
class EksManager {
|
|
47
|
+
/**
|
|
48
|
+
* @summary Method to create an eks deployment
|
|
49
|
+
* @param {string} id scoped id of the resource
|
|
50
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
51
|
+
* @param {types.EksClusterProps} props
|
|
52
|
+
* @param {ecr.DockerImageAsset} image
|
|
53
|
+
* @param {ec2.IVpc} vpc
|
|
54
|
+
*/
|
|
55
|
+
createEksDeployment(id, scope, props, image, vpc) {
|
|
56
|
+
if (!props)
|
|
57
|
+
throw `EksCluster props undefined`;
|
|
58
|
+
const appLabel = { app: `${id}`.toLowerCase() };
|
|
59
|
+
const deployment = {
|
|
60
|
+
apiVersion: 'apps/v1',
|
|
61
|
+
kind: 'Deployment',
|
|
62
|
+
metadata: { name: `${id}`.toLowerCase() },
|
|
63
|
+
spec: {
|
|
64
|
+
selector: { matchLabels: appLabel },
|
|
65
|
+
template: {
|
|
66
|
+
metadata: { labels: appLabel },
|
|
67
|
+
spec: {
|
|
68
|
+
containers: [
|
|
69
|
+
{
|
|
70
|
+
name: `${id}`.toLowerCase(),
|
|
71
|
+
image: image.imageUri,
|
|
72
|
+
ports: [{ containerPort: props.appContainerPort }],
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
const service = {
|
|
80
|
+
apiVersion: 'v1',
|
|
81
|
+
kind: 'Service',
|
|
82
|
+
metadata: { name: `${id}`.toLowerCase() },
|
|
83
|
+
spec: {
|
|
84
|
+
type: 'LoadBalancer',
|
|
85
|
+
ports: [
|
|
86
|
+
{
|
|
87
|
+
name: 'http-port',
|
|
88
|
+
protocol: 'TCP',
|
|
89
|
+
port: 80,
|
|
90
|
+
targetPort: props.appContainerPort,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
selector: appLabel,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
const cluster = new eks.Cluster(scope, `${id}Cluster`, {
|
|
97
|
+
clusterName: `${id.toLowerCase()}-${scope.props.stage}`,
|
|
98
|
+
defaultCapacity: props.appCapacity,
|
|
99
|
+
defaultCapacityInstance: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.LARGE),
|
|
100
|
+
version: eks.KubernetesVersion.V1_18,
|
|
101
|
+
vpc,
|
|
102
|
+
});
|
|
103
|
+
cluster.addManifest(`${id}Pod`, service, deployment);
|
|
104
|
+
utils.createCfnOutput(`${id}-clusterArn`, scope, cluster.clusterArn);
|
|
105
|
+
utils.createCfnOutput(`${id}-clusterEndpoint`, scope, cluster.clusterEndpoint);
|
|
106
|
+
return cluster;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.EksManager = EksManager;
|
|
110
|
+
//# sourceMappingURL=eks-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eks-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/eks-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA0C;AAE1C,yDAA0C;AAG1C,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,UAAU;IACrB;;;;;;;OAOG;IACI,mBAAmB,CACxB,EAAU,EACV,KAA6B,EAC7B,KAA4B,EAC5B,KAA2B,EAC3B,GAAa;QAEb,IAAI,CAAC,KAAK;YAAE,MAAM,4BAA4B,CAAA;QAE9C,MAAM,QAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,EAAE,EAAE,CAAA;QAE/C,MAAM,UAAU,GAAG;YACjB,UAAU,EAAE,SAAS;YACrB,IAAI,EAAE,YAAY;YAClB,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,EAAE,EAAE;YACzC,IAAI,EAAE;gBACJ,QAAQ,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE;gBACnC,QAAQ,EAAE;oBACR,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;oBAC9B,IAAI,EAAE;wBACJ,UAAU,EAAE;4BACV;gCACE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,EAAE;gCAC3B,KAAK,EAAE,KAAK,CAAC,QAAQ;gCACrB,KAAK,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC;6BACnD;yBACF;qBACF;iBACF;aACF;SACF,CAAA;QAED,MAAM,OAAO,GAAG;YACd,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,EAAE,EAAE;YACzC,IAAI,EAAE;gBACJ,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,WAAW;wBACjB,QAAQ,EAAE,KAAK;wBACf,IAAI,EAAE,EAAE;wBACR,UAAU,EAAE,KAAK,CAAC,gBAAgB;qBACnC;iBACF;gBACD,QAAQ,EAAE,QAAQ;aACnB;SACF,CAAA;QAED,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE;YACrD,WAAW,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YACvD,eAAe,EAAE,KAAK,CAAC,WAAW;YAClC,uBAAuB,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,EAAE,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC;YAC1F,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAC,KAAK;YACpC,GAAG;SACJ,CAAC,CAAA;QAEF,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAA;QAEpD,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;QACpE,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;QAE9E,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AA1ED,gCA0EC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as ecs from 'aws-cdk-lib/aws-ecs';
|
|
2
|
+
import * as events from 'aws-cdk-lib/aws-events';
|
|
3
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
4
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
5
|
+
import * as common from '../../common';
|
|
6
|
+
import * as types from '../../types';
|
|
7
|
+
/**
|
|
8
|
+
* @stability stable
|
|
9
|
+
* @category cdk-utils.event-manager
|
|
10
|
+
* @subcategory Construct
|
|
11
|
+
* @classdesc Provides operations on AWS EventBridge.
|
|
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.eventManager.createLambdaRule('MyLambdaRule', this, lambdaFunction)
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
*
|
|
25
|
+
* @see [CDK EventBridge Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events-readme.html}
|
|
26
|
+
*/
|
|
27
|
+
export declare class EventManager {
|
|
28
|
+
/**
|
|
29
|
+
* Method to create an event bus
|
|
30
|
+
* @param {string} id scoped id of the resource
|
|
31
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
32
|
+
* @param {types.EventBusProps} props event bus properties
|
|
33
|
+
*/
|
|
34
|
+
createEventBus(id: string, scope: common.CommonConstruct, props: types.EventBusProps): events.EventBus;
|
|
35
|
+
/**
|
|
36
|
+
* Method to create an event rule
|
|
37
|
+
* @param {string} id scoped id of the resource
|
|
38
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
39
|
+
* @param {types.EventRuleProps} props event rule properties
|
|
40
|
+
* @param {events.IEventBus?} eventBus optional custom event bus
|
|
41
|
+
* @param {events.IRuleTarget[]?} targets optional event targets
|
|
42
|
+
*/
|
|
43
|
+
createRule(id: string, scope: common.CommonConstruct, props: types.EventRuleProps, eventBus?: events.IEventBus, targets?: events.IRuleTarget[]): events.Rule;
|
|
44
|
+
/**
|
|
45
|
+
* @summary Method to create an eventbridge rule with lambda target
|
|
46
|
+
* @param {string} id scoped id of the resource
|
|
47
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
48
|
+
* @param {types.RuleProps} props
|
|
49
|
+
* @param {lambda.Function} lambdaFunction
|
|
50
|
+
* @param {string} eventBusName
|
|
51
|
+
* @param {any} eventPattern
|
|
52
|
+
* @param {string} scheduleExpression
|
|
53
|
+
*/
|
|
54
|
+
createLambdaRule(id: string, scope: common.CommonConstruct, props: types.RuleProps, lambdaFunction: lambda.Function, eventBusName?: string, eventPattern?: any, scheduleExpression?: string): events.CfnRule;
|
|
55
|
+
/**
|
|
56
|
+
* @summary Method to create an eventbridge rule with fargate task target
|
|
57
|
+
* @param {string} id scoped id of the resource
|
|
58
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
59
|
+
* @param {types.RuleProps} props
|
|
60
|
+
* @param {ecs.ICluster} cluster
|
|
61
|
+
* @param {ecs.ITaskDefinition} task
|
|
62
|
+
* @param {string[]} subnetIds
|
|
63
|
+
* @param {iam.Role | iam.CfnRole} role
|
|
64
|
+
* @param {any} eventPattern
|
|
65
|
+
*/
|
|
66
|
+
createFargateTaskRule(id: string, scope: common.CommonConstruct, props: types.RuleProps, cluster: ecs.ICluster, task: ecs.ITaskDefinition, subnetIds: string[], role: iam.Role | iam.CfnRole, eventPattern?: any): events.CfnRule;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=event-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/event-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAA;AAChD,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,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,YAAY;IACvB;;;;;OAKG;IACI,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa;IAa3F;;;;;;;OAOG;IACI,UAAU,CACf,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,cAAc,EAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC,SAAS,EAC3B,OAAO,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE;IAsBhC;;;;;;;;;OASG;IACI,gBAAgB,CACrB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,cAAc,EAAE,MAAM,CAAC,QAAQ,EAC/B,YAAY,CAAC,EAAE,MAAM,EACrB,YAAY,CAAC,EAAE,GAAG,EAClB,kBAAkB,CAAC,EAAE,MAAM;IA2B7B;;;;;;;;;;OAUG;IACI,qBAAqB,CAC1B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,OAAO,EAAE,GAAG,CAAC,QAAQ,EACrB,IAAI,EAAE,GAAG,CAAC,eAAe,EACzB,SAAS,EAAE,MAAM,EAAE,EACnB,IAAI,EAAE,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,OAAO,EAC5B,YAAY,CAAC,EAAE,GAAG;CA+BrB"}
|
|
@@ -0,0 +1,163 @@
|
|
|
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.EventManager = void 0;
|
|
23
|
+
const events = __importStar(require("aws-cdk-lib/aws-events"));
|
|
24
|
+
const iam = __importStar(require("aws-cdk-lib/aws-iam"));
|
|
25
|
+
const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
|
|
26
|
+
const utils = __importStar(require("../../utils"));
|
|
27
|
+
/**
|
|
28
|
+
* @stability stable
|
|
29
|
+
* @category cdk-utils.event-manager
|
|
30
|
+
* @subcategory Construct
|
|
31
|
+
* @classdesc Provides operations on AWS EventBridge.
|
|
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.eventManager.createLambdaRule('MyLambdaRule', this, lambdaFunction)
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
*
|
|
45
|
+
* @see [CDK EventBridge Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events-readme.html}
|
|
46
|
+
*/
|
|
47
|
+
class EventManager {
|
|
48
|
+
/**
|
|
49
|
+
* Method to create an event bus
|
|
50
|
+
* @param {string} id scoped id of the resource
|
|
51
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
52
|
+
* @param {types.EventBusProps} props event bus properties
|
|
53
|
+
*/
|
|
54
|
+
createEventBus(id, scope, props) {
|
|
55
|
+
if (!props)
|
|
56
|
+
throw 'EventBus props undefined';
|
|
57
|
+
const eventBus = new events.EventBus(scope, `${id}`, {
|
|
58
|
+
eventBusName: `${props.eventBusName}-${scope.props.stage}`,
|
|
59
|
+
});
|
|
60
|
+
utils.createCfnOutput(`${id}-eventBusName`, scope, eventBus.eventBusName);
|
|
61
|
+
utils.createCfnOutput(`${id}-eventBusArn`, scope, eventBus.eventBusArn);
|
|
62
|
+
return eventBus;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Method to create an event rule
|
|
66
|
+
* @param {string} id scoped id of the resource
|
|
67
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
68
|
+
* @param {types.EventRuleProps} props event rule properties
|
|
69
|
+
* @param {events.IEventBus?} eventBus optional custom event bus
|
|
70
|
+
* @param {events.IRuleTarget[]?} targets optional event targets
|
|
71
|
+
*/
|
|
72
|
+
createRule(id, scope, props, eventBus, targets) {
|
|
73
|
+
if (!props)
|
|
74
|
+
throw `EventRule props undefined`;
|
|
75
|
+
const rule = new events.Rule(scope, `${id}`, {
|
|
76
|
+
eventBus: eventBus,
|
|
77
|
+
description: props.description,
|
|
78
|
+
ruleName: `${props.ruleName}-${scope.props.stage}`,
|
|
79
|
+
eventPattern: props.eventPattern,
|
|
80
|
+
});
|
|
81
|
+
if (targets && targets.length > 0) {
|
|
82
|
+
targets.forEach(target => {
|
|
83
|
+
rule.addTarget(target);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
utils.createCfnOutput(`${id}-ruleArn`, scope, rule.ruleArn);
|
|
87
|
+
utils.createCfnOutput(`${id}-ruleName`, scope, rule.ruleName);
|
|
88
|
+
return rule;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @summary Method to create an eventbridge rule with lambda target
|
|
92
|
+
* @param {string} id scoped id of the resource
|
|
93
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
94
|
+
* @param {types.RuleProps} props
|
|
95
|
+
* @param {lambda.Function} lambdaFunction
|
|
96
|
+
* @param {string} eventBusName
|
|
97
|
+
* @param {any} eventPattern
|
|
98
|
+
* @param {string} scheduleExpression
|
|
99
|
+
*/
|
|
100
|
+
createLambdaRule(id, scope, props, lambdaFunction, eventBusName, eventPattern, scheduleExpression) {
|
|
101
|
+
if (!props)
|
|
102
|
+
throw `EventRule props undefined`;
|
|
103
|
+
const eventRule = new events.CfnRule(scope, `${id}`, {
|
|
104
|
+
description: 'Rule to send notification to lambda function target',
|
|
105
|
+
eventBusName: eventBusName,
|
|
106
|
+
eventPattern: eventPattern,
|
|
107
|
+
scheduleExpression: scheduleExpression,
|
|
108
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
109
|
+
state: props.state,
|
|
110
|
+
targets: [{ arn: lambdaFunction.functionArn, id: `${id}-${scope.props.stage}` }],
|
|
111
|
+
});
|
|
112
|
+
new lambda.CfnPermission(scope, `${id}LambdaPermission`, {
|
|
113
|
+
action: 'lambda:InvokeFunction',
|
|
114
|
+
functionName: lambdaFunction.functionName,
|
|
115
|
+
principal: 'events.amazonaws.com',
|
|
116
|
+
sourceArn: eventRule.attrArn,
|
|
117
|
+
});
|
|
118
|
+
utils.createCfnOutput(`${id}-ruleArn`, scope, eventRule.attrArn);
|
|
119
|
+
utils.createCfnOutput(`${id}-ruleName`, scope, eventRule.name);
|
|
120
|
+
return eventRule;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @summary Method to create an eventbridge rule with fargate task target
|
|
124
|
+
* @param {string} id scoped id of the resource
|
|
125
|
+
* @param {common.CommonConstruct} scope scope in which this resource is defined
|
|
126
|
+
* @param {types.RuleProps} props
|
|
127
|
+
* @param {ecs.ICluster} cluster
|
|
128
|
+
* @param {ecs.ITaskDefinition} task
|
|
129
|
+
* @param {string[]} subnetIds
|
|
130
|
+
* @param {iam.Role | iam.CfnRole} role
|
|
131
|
+
* @param {any} eventPattern
|
|
132
|
+
*/
|
|
133
|
+
createFargateTaskRule(id, scope, props, cluster, task, subnetIds, role, eventPattern) {
|
|
134
|
+
if (!props)
|
|
135
|
+
throw `EventRule props undefined`;
|
|
136
|
+
const eventRule = new events.CfnRule(scope, `${id}`, {
|
|
137
|
+
description: 'Rule to send notification on new objects in data bucket to ecs task target',
|
|
138
|
+
eventPattern: eventPattern,
|
|
139
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
140
|
+
state: props.state,
|
|
141
|
+
targets: [
|
|
142
|
+
{
|
|
143
|
+
arn: cluster.clusterArn,
|
|
144
|
+
id: `${id}-${scope.props.stage}`,
|
|
145
|
+
ecsParameters: {
|
|
146
|
+
launchType: 'FARGATE',
|
|
147
|
+
networkConfiguration: {
|
|
148
|
+
awsVpcConfiguration: { assignPublicIp: 'ENABLED', subnets: subnetIds },
|
|
149
|
+
},
|
|
150
|
+
taskCount: 1,
|
|
151
|
+
taskDefinitionArn: task.taskDefinitionArn,
|
|
152
|
+
},
|
|
153
|
+
roleArn: role instanceof iam.Role ? role.roleArn : role.attrArn,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
});
|
|
157
|
+
utils.createCfnOutput(`${id}-ruleArn`, scope, eventRule.attrArn);
|
|
158
|
+
utils.createCfnOutput(`${id}-ruleName`, scope, eventRule.name);
|
|
159
|
+
return eventRule;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exports.EventManager = EventManager;
|
|
163
|
+
//# sourceMappingURL=event-manager.js.map
|