@gradientedge/cdk-utils 4.2.3 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -23
- package/api-docs/AcmManager.html +619 -0
- package/api-docs/AcmProps.html +235 -0
- package/api-docs/AlarmProps.html +235 -0
- package/api-docs/AlarmStatusWidgetProps.html +235 -0
- package/api-docs/ApiDestinationEvent.html +294 -0
- package/api-docs/ApiDestinationEventType.html +235 -0
- package/api-docs/ApiDestinedLambda.html +294 -0
- package/api-docs/ApiDestinedLambdaEnvironment.html +235 -0
- package/api-docs/ApiDestinedLambdaType.html +235 -0
- package/api-docs/ApiDestinedRestApi.html +294 -0
- package/api-docs/ApiDestinedRestApiType.html +235 -0
- package/api-docs/ApiManager.html +763 -0
- package/api-docs/ApiToEventBridgeTarget.html +1874 -0
- package/api-docs/ApiToEventBridgeTarget.jpg +0 -0
- package/api-docs/ApiToEventBridgeTargetEventProps.html +235 -0
- package/api-docs/ApiToEventBridgeTargetLambdaProps.html +235 -0
- package/api-docs/ApiToEventBridgeTargetProps.html +235 -0
- package/api-docs/AppConfigManager.html +1200 -0
- package/api-docs/AppConfigProps.html +235 -0
- package/api-docs/CloudFrontManager.html +2399 -0
- package/api-docs/CloudFrontProps.html +235 -0
- package/api-docs/CloudTrailManager.html +634 -0
- package/api-docs/CloudTrailProps.html +235 -0
- package/api-docs/CloudWatchManager.html +2983 -0
- package/api-docs/CloudfrontFunctionProps.html +235 -0
- package/api-docs/CodeBuildManager.html +733 -0
- package/api-docs/CommonConstruct.html +1296 -0
- package/api-docs/CommonStack.html +810 -0
- package/api-docs/CommonStackProps.html +235 -0
- package/api-docs/DashboardProps.html +235 -0
- package/api-docs/DistributionProps.html +235 -0
- package/api-docs/DynamodbManager.html +527 -0
- package/api-docs/EcrManager.html +527 -0
- package/api-docs/EcsClusterProps.html +235 -0
- package/api-docs/EcsManager.html +877 -0
- package/api-docs/EcsTaskProps.html +235 -0
- package/api-docs/EksClusterProps.html +235 -0
- package/api-docs/EksManager.html +577 -0
- package/api-docs/EventBusProps.html +235 -0
- package/api-docs/EventManager.html +1451 -0
- package/api-docs/EventRuleProps.html +235 -0
- package/api-docs/GraphQLApiLambda.html +1668 -0
- package/api-docs/GraphQLApiLambda.jpg +0 -0
- package/api-docs/GraphQlApiLambdaEnvironment.html +235 -0
- package/api-docs/GraphQlApiLambdaProps.html +235 -0
- package/api-docs/GraphWidgetProps.html +235 -0
- package/api-docs/HealthCheck.html +235 -0
- package/api-docs/IamManager.html +3818 -0
- package/api-docs/LambdaEdgeProps.html +235 -0
- package/api-docs/LambdaEnvironment.html +235 -0
- package/api-docs/LambdaManager.html +2375 -0
- package/api-docs/LambdaProps.html +235 -0
- package/api-docs/LogManager.html +952 -0
- package/api-docs/LogProps.html +235 -0
- package/api-docs/LogQueryWidgetProps.html +235 -0
- package/api-docs/MetricFilterProps.html +235 -0
- package/api-docs/MetricProps.html +235 -0
- package/api-docs/NumericWidgetProps.html +235 -0
- package/api-docs/Route53Manager.html +1457 -0
- package/api-docs/Route53Props.html +235 -0
- package/api-docs/RuleProps.html +235 -0
- package/api-docs/S3BucketProps.html +235 -0
- package/api-docs/S3Manager.html +1543 -0
- package/api-docs/SSMParameterReader.html +428 -0
- package/api-docs/SSMParameterReaderProps.html +235 -0
- package/api-docs/SecretsManager.html +1137 -0
- package/api-docs/SiteWithEcsBackend.html +2388 -0
- package/api-docs/SiteWithEcsBackendProps.html +235 -0
- package/api-docs/SnsManager.html +777 -0
- package/api-docs/SsmManager.html +952 -0
- package/api-docs/StaticSite.html +1355 -0
- package/api-docs/StaticSiteProps.html +235 -0
- package/api-docs/SubscriptionProps.html +235 -0
- package/api-docs/TableProps.html +235 -0
- package/api-docs/TextWidgetProps.html +235 -0
- package/api-docs/VpcManager.html +930 -0
- package/api-docs/WafIPSetProps.html +235 -0
- package/api-docs/WafManager.html +727 -0
- package/api-docs/WafWebACLProps.html +235 -0
- package/api-docs/common_construct.ts.html +275 -0
- package/api-docs/common_stack.ts.html +299 -0
- package/api-docs/construct_api-to-eventbridge-target_api-destination-event.ts.html +171 -0
- package/api-docs/construct_api-to-eventbridge-target_api-destined-lambda.ts.html +174 -0
- package/api-docs/construct_api-to-eventbridge-target_api-destined-rest-api.ts.html +186 -0
- package/api-docs/construct_api-to-eventbridge-target_main.ts.html +747 -0
- package/api-docs/construct_graphql-api-lambda_main.ts.html +404 -0
- package/api-docs/construct_site-with-ecs-backend_main.ts.html +540 -0
- package/api-docs/construct_static-site_main.ts.html +370 -0
- package/api-docs/global.html +1527 -0
- package/api-docs/index.html +207 -0
- package/api-docs/manager_aws_acm-manager.ts.html +232 -0
- package/api-docs/manager_aws_api-manager.ts.html +256 -0
- package/api-docs/manager_aws_app-config-manager.ts.html +305 -0
- package/api-docs/manager_aws_cloudfront-manager.ts.html +487 -0
- package/api-docs/manager_aws_cloudtrail-manager.ts.html +247 -0
- package/api-docs/manager_aws_cloudwatch-manager.ts.html +548 -0
- package/api-docs/manager_aws_codebuild-manager.ts.html +236 -0
- package/api-docs/manager_aws_dynamodb-manager.ts.html +215 -0
- package/api-docs/manager_aws_ecr-manager.ts.html +195 -0
- package/api-docs/manager_aws_ecs-manager.ts.html +255 -0
- package/api-docs/manager_aws_eks-manager.ts.html +256 -0
- package/api-docs/manager_aws_event-manager.ts.html +332 -0
- package/api-docs/manager_aws_iam-manager.ts.html +569 -0
- package/api-docs/manager_aws_lambda-manager.ts.html +396 -0
- package/api-docs/manager_aws_log-manager.ts.html +255 -0
- package/api-docs/manager_aws_route53-manager.ts.html +329 -0
- package/api-docs/manager_aws_s3-manager.ts.html +357 -0
- package/api-docs/manager_aws_secrets-manager.ts.html +270 -0
- package/api-docs/manager_aws_sns-manager.ts.html +242 -0
- package/api-docs/manager_aws_ssm-manager.ts.html +268 -0
- package/api-docs/manager_aws_vpc-manager.ts.html +238 -0
- package/api-docs/manager_aws_waf-manager.ts.html +228 -0
- package/api-docs/scripts/app.min.js +1 -0
- package/api-docs/scripts/linenumber.js +26 -0
- package/api-docs/scripts/search.js +39 -0
- package/api-docs/styles/app.min.css +1 -0
- package/api-docs/styles/iframe.css +13 -0
- package/api-docs/styles/prettify-jsdoc.css +111 -0
- package/api-docs/styles/prettify-tomorrow.css +132 -0
- package/api-docs/styles/reset.css +44 -0
- package/api-docs/tutorial-Architecture.html +147 -0
- package/api-docs/tutorial-Build.html +146 -0
- package/api-docs/tutorial-CI-CD.html +150 -0
- package/api-docs/tutorial-Development.html +223 -0
- package/api-docs/types_aws_index.ts.html +611 -0
- package/api-docs/utils_aws_index.ts.html +189 -0
- package/api-docs/utils_index.ts.html +225 -0
- package/app/api-destined-function/node_modules/.yarn-integrity +180 -0
- package/app/api-destined-function/node_modules/@types/uuid/LICENSE +21 -0
- package/app/api-destined-function/node_modules/@types/uuid/README.md +16 -0
- package/app/api-destined-function/node_modules/@types/uuid/index.d.mts +10 -0
- package/app/api-destined-function/node_modules/@types/uuid/index.d.ts +80 -0
- package/app/api-destined-function/node_modules/@types/uuid/package.json +54 -0
- package/app/api-destined-function/node_modules/balanced-match/LICENSE.md +21 -0
- package/app/api-destined-function/node_modules/balanced-match/README.md +97 -0
- package/app/api-destined-function/node_modules/balanced-match/index.js +62 -0
- package/app/api-destined-function/node_modules/balanced-match/package.json +48 -0
- package/app/api-destined-function/node_modules/brace-expansion/LICENSE +21 -0
- package/app/api-destined-function/node_modules/brace-expansion/README.md +129 -0
- package/app/api-destined-function/node_modules/brace-expansion/index.js +201 -0
- package/app/api-destined-function/node_modules/brace-expansion/package.json +47 -0
- package/app/api-destined-function/node_modules/concat-map/.travis.yml +4 -0
- package/app/api-destined-function/node_modules/concat-map/LICENSE +18 -0
- package/app/api-destined-function/node_modules/concat-map/README.markdown +62 -0
- package/app/api-destined-function/node_modules/concat-map/example/map.js +6 -0
- package/app/api-destined-function/node_modules/concat-map/index.js +13 -0
- package/app/api-destined-function/node_modules/concat-map/package.json +43 -0
- package/app/api-destined-function/node_modules/fs.realpath/LICENSE +43 -0
- package/app/api-destined-function/node_modules/fs.realpath/README.md +33 -0
- package/app/api-destined-function/node_modules/fs.realpath/index.js +66 -0
- package/app/api-destined-function/node_modules/fs.realpath/old.js +303 -0
- package/app/api-destined-function/node_modules/fs.realpath/package.json +26 -0
- package/app/api-destined-function/node_modules/glob/LICENSE +21 -0
- package/app/api-destined-function/node_modules/glob/README.md +378 -0
- package/app/api-destined-function/node_modules/glob/common.js +236 -0
- package/app/api-destined-function/node_modules/glob/glob.js +787 -0
- package/app/api-destined-function/node_modules/glob/package.json +52 -0
- package/app/api-destined-function/node_modules/glob/sync.js +483 -0
- package/app/api-destined-function/node_modules/inflight/LICENSE +15 -0
- package/app/api-destined-function/node_modules/inflight/README.md +37 -0
- package/app/api-destined-function/node_modules/inflight/inflight.js +54 -0
- package/app/api-destined-function/node_modules/inflight/package.json +29 -0
- package/app/api-destined-function/node_modules/inherits/LICENSE +16 -0
- package/app/api-destined-function/node_modules/inherits/README.md +42 -0
- package/app/api-destined-function/node_modules/inherits/inherits.js +9 -0
- package/app/api-destined-function/node_modules/inherits/inherits_browser.js +27 -0
- package/app/api-destined-function/node_modules/inherits/package.json +29 -0
- package/app/api-destined-function/node_modules/minimatch/LICENSE +15 -0
- package/app/api-destined-function/node_modules/minimatch/README.md +209 -0
- package/app/api-destined-function/node_modules/minimatch/minimatch.js +923 -0
- package/app/api-destined-function/node_modules/minimatch/package.json +30 -0
- package/app/api-destined-function/node_modules/mkdirp/LICENSE +21 -0
- package/app/api-destined-function/node_modules/mkdirp/bin/cmd.js +68 -0
- package/app/api-destined-function/node_modules/mkdirp/index.js +31 -0
- package/app/api-destined-function/node_modules/mkdirp/lib/find-made.js +29 -0
- package/app/api-destined-function/node_modules/mkdirp/lib/mkdirp-manual.js +64 -0
- package/app/api-destined-function/node_modules/mkdirp/lib/mkdirp-native.js +39 -0
- package/app/api-destined-function/node_modules/mkdirp/lib/opts-arg.js +23 -0
- package/app/api-destined-function/node_modules/mkdirp/lib/path-arg.js +29 -0
- package/app/api-destined-function/node_modules/mkdirp/lib/use-native.js +10 -0
- package/app/api-destined-function/node_modules/mkdirp/package.json +44 -0
- package/app/api-destined-function/node_modules/mkdirp/readme.markdown +266 -0
- package/app/api-destined-function/node_modules/once/LICENSE +15 -0
- package/app/api-destined-function/node_modules/once/README.md +79 -0
- package/app/api-destined-function/node_modules/once/once.js +42 -0
- package/app/api-destined-function/node_modules/once/package.json +33 -0
- package/app/api-destined-function/node_modules/path-is-absolute/index.js +20 -0
- package/app/api-destined-function/node_modules/path-is-absolute/license +21 -0
- package/app/api-destined-function/node_modules/path-is-absolute/package.json +43 -0
- package/app/api-destined-function/node_modules/path-is-absolute/readme.md +59 -0
- package/app/api-destined-function/node_modules/rimraf/LICENSE +15 -0
- package/app/api-destined-function/node_modules/rimraf/README.md +101 -0
- package/app/api-destined-function/node_modules/rimraf/bin.js +68 -0
- package/app/api-destined-function/node_modules/rimraf/package.json +32 -0
- package/app/api-destined-function/node_modules/rimraf/rimraf.js +360 -0
- package/app/api-destined-function/node_modules/uuid/LICENSE.md +9 -0
- package/app/api-destined-function/node_modules/uuid/README.md +505 -0
- 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/node_modules/uuid/package.json +135 -0
- package/app/api-destined-function/node_modules/uuid/wrapper.mjs +10 -0
- package/app/api-destined-function/node_modules/wrappy/LICENSE +15 -0
- package/app/api-destined-function/node_modules/wrappy/README.md +36 -0
- package/app/api-destined-function/node_modules/wrappy/package.json +29 -0
- package/app/api-destined-function/node_modules/wrappy/wrappy.js +33 -0
- package/app/api-destined-function/package.json +30 -0
- package/app/api-destined-function/src/lib/lambda.ts +31 -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/src/lib/common/{commonConstruct.d.ts → construct.d.ts} +3 -13
- package/dist/src/lib/common/construct.d.ts.map +1 -0
- package/dist/src/lib/common/{commonConstruct.js → construct.js} +4 -14
- package/dist/src/lib/common/construct.js.map +1 -0
- package/dist/src/lib/common/index.d.ts +2 -2
- package/dist/src/lib/common/index.d.ts.map +1 -1
- package/dist/src/lib/common/index.js +2 -2
- package/dist/src/lib/common/index.js.map +1 -1
- package/dist/src/lib/common/{commonStack.d.ts → stack.d.ts} +3 -14
- package/dist/src/lib/common/stack.d.ts.map +1 -0
- package/dist/src/lib/common/{commonStack.js → stack.js} +4 -15
- package/dist/src/lib/common/stack.js.map +1 -0
- package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.d.ts +16 -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 +17 -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 +19 -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 +19 -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 +35 -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 +29 -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 +134 -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 +487 -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/{graphQLApiLambda.d.ts → graphql-api-lambda/main.d.ts} +12 -22
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts.map +1 -0
- package/dist/src/lib/construct/{graphQLApiLambda.js → graphql-api-lambda/main.js} +14 -24
- package/dist/src/lib/construct/graphql-api-lambda/main.js.map +1 -0
- package/dist/src/lib/construct/index.d.ts +4 -3
- package/dist/src/lib/construct/index.d.ts.map +1 -1
- package/dist/src/lib/construct/index.js +4 -3
- package/dist/src/lib/construct/index.js.map +1 -1
- 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/{siteWithEcsBackend.d.ts → site-with-ecs-backend/main.d.ts} +4 -16
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts.map +1 -0
- package/dist/src/lib/construct/{siteWithEcsBackend.js → site-with-ecs-backend/main.js} +4 -16
- 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/{staticSite.d.ts → static-site/main.d.ts} +4 -16
- package/dist/src/lib/construct/static-site/main.d.ts.map +1 -0
- package/dist/src/lib/construct/{staticSite.js → static-site/main.js} +4 -16
- package/dist/src/lib/construct/static-site/main.js.map +1 -0
- package/dist/src/lib/manager/aws/{acmManager.d.ts → acm-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/acm-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{acmManager.js → acm-manager.js} +2 -2
- package/dist/src/lib/manager/aws/acm-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{apiManager.d.ts → api-manager.d.ts} +5 -5
- package/dist/src/lib/manager/aws/api-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{apiManager.js → api-manager.js} +5 -5
- package/dist/src/lib/manager/aws/api-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{appConfigManager.d.ts → app-config-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/app-config-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{appConfigManager.js → app-config-manager.js} +2 -2
- package/dist/src/lib/manager/aws/app-config-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{cloudFrontManager.d.ts → cloudfront-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/cloudfront-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{cloudFrontManager.js → cloudfront-manager.js} +2 -2
- package/dist/src/lib/manager/aws/cloudfront-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{cloudTrailManager.d.ts → cloudtrail-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/cloudtrail-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{cloudTrailManager.js → cloudtrail-manager.js} +2 -2
- package/dist/src/lib/manager/aws/cloudtrail-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{cloudWatchManager.d.ts → cloudwatch-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{cloudWatchManager.js → cloudwatch-manager.js} +2 -2
- package/dist/src/lib/manager/aws/cloudwatch-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{codeBuildManager.d.ts → codebuild-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/codebuild-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{codeBuildManager.js → codebuild-manager.js} +2 -2
- package/dist/src/lib/manager/aws/codebuild-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/dynamodb-manager.d.ts +32 -0
- package/dist/src/lib/manager/aws/dynamodb-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/dynamodb-manager.js +79 -0
- package/dist/src/lib/manager/aws/dynamodb-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{ecrManager.d.ts → ecr-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/ecr-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{ecrManager.js → ecr-manager.js} +2 -2
- package/dist/src/lib/manager/aws/ecr-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{ecsManager.d.ts → ecs-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/ecs-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{ecsManager.js → ecs-manager.js} +2 -2
- package/dist/src/lib/manager/aws/ecs-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{eksManager.d.ts → eks-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/eks-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{eksManager.js → eks-manager.js} +2 -2
- package/dist/src/lib/manager/aws/eks-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{eventManager.d.ts → event-manager.d.ts} +18 -2
- package/dist/src/lib/manager/aws/event-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{eventManager.js → event-manager.js} +44 -2
- package/dist/src/lib/manager/aws/event-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{iamManager.d.ts → iam-manager.d.ts} +12 -14
- package/dist/src/lib/manager/aws/iam-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{iamManager.js → iam-manager.js} +21 -17
- package/dist/src/lib/manager/aws/iam-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/index.d.ts +22 -21
- package/dist/src/lib/manager/aws/index.d.ts.map +1 -1
- package/dist/src/lib/manager/aws/index.js +22 -21
- package/dist/src/lib/manager/aws/index.js.map +1 -1
- package/dist/src/lib/manager/aws/{lambdaManager.d.ts → lambda-manager.d.ts} +28 -26
- package/dist/src/lib/manager/aws/lambda-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{lambdaManager.js → lambda-manager.js} +45 -37
- package/dist/src/lib/manager/aws/lambda-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{logManager.d.ts → log-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/log-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{logManager.js → log-manager.js} +2 -2
- package/dist/src/lib/manager/aws/log-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{route53Manager.d.ts → route53-manager.d.ts} +3 -3
- package/dist/src/lib/manager/aws/route53-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{route53Manager.js → route53-manager.js} +3 -3
- package/dist/src/lib/manager/aws/route53-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{s3Manager.d.ts → s3-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/s3-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{s3Manager.js → s3-manager.js} +2 -2
- package/dist/src/lib/manager/aws/s3-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{secretsManager.d.ts → secrets-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/secrets-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{secretsManager.js → secrets-manager.js} +2 -2
- package/dist/src/lib/manager/aws/secrets-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{snsManager.d.ts → sns-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/sns-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{snsManager.js → sns-manager.js} +2 -2
- package/dist/src/lib/manager/aws/sns-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{ssmManager.d.ts → ssm-manager.d.ts} +4 -9
- package/dist/src/lib/manager/aws/ssm-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{ssmManager.js → ssm-manager.js} +4 -9
- package/dist/src/lib/manager/aws/ssm-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{vpcManager.d.ts → vpc-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/vpc-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{vpcManager.js → vpc-manager.js} +3 -2
- package/dist/src/lib/manager/aws/vpc-manager.js.map +1 -0
- package/dist/src/lib/manager/aws/{wafManager.d.ts → waf-manager.d.ts} +2 -2
- package/dist/src/lib/manager/aws/waf-manager.d.ts.map +1 -0
- package/dist/src/lib/manager/aws/{wafManager.js → waf-manager.js} +2 -2
- package/dist/src/lib/manager/aws/waf-manager.js.map +1 -0
- package/dist/src/lib/types/aws/index.d.ts +143 -2
- package/dist/src/lib/types/aws/index.d.ts.map +1 -1
- package/dist/src/lib/utils/aws/index.d.ts +1 -1
- package/dist/src/lib/utils/aws/index.d.ts.map +1 -1
- package/dist/src/lib/utils/index.d.ts +1 -0
- package/dist/src/lib/utils/index.d.ts.map +1 -1
- package/dist/src/lib/utils/index.js +1 -0
- package/dist/src/lib/utils/index.js.map +1 -1
- package/img/ApiToEventBridgeTarget.jpg +0 -0
- package/img/GraphQLApiLambda.jpg +0 -0
- package/package.json +12 -13
- package/src/lib/common/{commonConstruct.ts → construct.ts} +3 -13
- package/src/lib/common/index.ts +2 -2
- package/src/lib/common/{commonStack.ts → stack.ts} +3 -13
- package/src/lib/construct/api-to-eventbridge-target/api-destination-event.ts +16 -0
- package/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.ts +19 -0
- package/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.ts +31 -0
- package/src/lib/construct/api-to-eventbridge-target/index.ts +4 -0
- package/src/lib/construct/api-to-eventbridge-target/main.ts +592 -0
- package/src/lib/construct/graphql-api-lambda/index.ts +1 -0
- package/src/lib/construct/{graphQLApiLambda.ts → graphql-api-lambda/main.ts} +13 -23
- package/src/lib/construct/index.ts +4 -3
- package/src/lib/construct/site-with-ecs-backend/index.ts +1 -0
- package/src/lib/construct/{siteWithEcsBackend.ts → site-with-ecs-backend/main.ts} +3 -15
- package/src/lib/construct/static-site/index.ts +1 -0
- package/src/lib/construct/{staticSite.ts → static-site/main.ts} +3 -15
- package/src/lib/manager/aws/{acmManager.ts → acm-manager.ts} +1 -1
- package/src/lib/manager/aws/{apiManager.ts → api-manager.ts} +4 -4
- package/src/lib/manager/aws/{appConfigManager.ts → app-config-manager.ts} +1 -1
- package/src/lib/manager/aws/{cloudFrontManager.ts → cloudfront-manager.ts} +1 -1
- package/src/lib/manager/aws/{cloudTrailManager.ts → cloudtrail-manager.ts} +1 -1
- package/src/lib/manager/aws/{cloudWatchManager.ts → cloudwatch-manager.ts} +1 -1
- package/src/lib/manager/aws/{codeBuildManager.ts → codebuild-manager.ts} +1 -1
- package/src/lib/manager/aws/dynamodb-manager.ts +60 -0
- package/src/lib/manager/aws/{ecrManager.ts → ecr-manager.ts} +1 -1
- package/src/lib/manager/aws/{ecsManager.ts → ecs-manager.ts} +1 -1
- package/src/lib/manager/aws/{eksManager.ts → eks-manager.ts} +1 -1
- package/src/lib/manager/aws/{eventManager.ts → event-manager.ts} +55 -1
- package/src/lib/manager/aws/{iamManager.ts → iam-manager.ts} +21 -16
- package/src/lib/manager/aws/index.ts +22 -21
- package/src/lib/manager/aws/{lambdaManager.ts → lambda-manager.ts} +51 -41
- package/src/lib/manager/aws/{logManager.ts → log-manager.ts} +1 -1
- package/src/lib/manager/aws/{route53Manager.ts → route53-manager.ts} +2 -2
- package/src/lib/manager/aws/{s3Manager.ts → s3-manager.ts} +1 -1
- package/src/lib/manager/aws/{secretsManager.ts → secrets-manager.ts} +1 -1
- package/src/lib/manager/aws/{snsManager.ts → sns-manager.ts} +1 -1
- package/src/lib/manager/aws/{ssmManager.ts → ssm-manager.ts} +3 -8
- package/src/lib/manager/aws/{vpcManager.ts → vpc-manager.ts} +2 -1
- package/src/lib/manager/aws/{wafManager.ts → waf-manager.ts} +1 -1
- package/src/lib/types/aws/index.ts +146 -2
- package/src/lib/utils/aws/index.ts +1 -1
- package/src/lib/utils/index.ts +1 -0
- package/.releaserc +0 -9
- package/dist/src/lib/common/commonConstruct.d.ts.map +0 -1
- package/dist/src/lib/common/commonConstruct.js.map +0 -1
- package/dist/src/lib/common/commonStack.d.ts.map +0 -1
- package/dist/src/lib/common/commonStack.js.map +0 -1
- package/dist/src/lib/construct/graphQLApiLambda.d.ts.map +0 -1
- package/dist/src/lib/construct/graphQLApiLambda.js.map +0 -1
- package/dist/src/lib/construct/siteWithEcsBackend.d.ts.map +0 -1
- package/dist/src/lib/construct/siteWithEcsBackend.js.map +0 -1
- package/dist/src/lib/construct/staticSite.d.ts.map +0 -1
- package/dist/src/lib/construct/staticSite.js.map +0 -1
- package/dist/src/lib/manager/aws/acmManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/acmManager.js.map +0 -1
- package/dist/src/lib/manager/aws/apiManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/apiManager.js.map +0 -1
- package/dist/src/lib/manager/aws/appConfigManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/appConfigManager.js.map +0 -1
- package/dist/src/lib/manager/aws/cloudFrontManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/cloudFrontManager.js.map +0 -1
- package/dist/src/lib/manager/aws/cloudTrailManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/cloudTrailManager.js.map +0 -1
- package/dist/src/lib/manager/aws/cloudWatchManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/cloudWatchManager.js.map +0 -1
- package/dist/src/lib/manager/aws/codeBuildManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/codeBuildManager.js.map +0 -1
- package/dist/src/lib/manager/aws/ecrManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/ecrManager.js.map +0 -1
- package/dist/src/lib/manager/aws/ecsManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/ecsManager.js.map +0 -1
- package/dist/src/lib/manager/aws/eksManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/eksManager.js.map +0 -1
- package/dist/src/lib/manager/aws/eventManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/eventManager.js.map +0 -1
- package/dist/src/lib/manager/aws/iamManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/iamManager.js.map +0 -1
- package/dist/src/lib/manager/aws/lambdaManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/lambdaManager.js.map +0 -1
- package/dist/src/lib/manager/aws/logManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/logManager.js.map +0 -1
- package/dist/src/lib/manager/aws/route53Manager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/route53Manager.js.map +0 -1
- package/dist/src/lib/manager/aws/s3Manager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/s3Manager.js.map +0 -1
- package/dist/src/lib/manager/aws/secretsManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/secretsManager.js.map +0 -1
- package/dist/src/lib/manager/aws/snsManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/snsManager.js.map +0 -1
- package/dist/src/lib/manager/aws/ssmManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/ssmManager.js.map +0 -1
- package/dist/src/lib/manager/aws/vpcManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/vpcManager.js.map +0 -1
- package/dist/src/lib/manager/aws/wafManager.d.ts.map +0 -1
- package/dist/src/lib/manager/aws/wafManager.js.map +0 -1
|
@@ -0,0 +1,747 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<!DOCTYPE html>
|
|
4
|
+
<html lang="en">
|
|
5
|
+
|
|
6
|
+
<head>
|
|
7
|
+
|
|
8
|
+
<meta charset="utf-8">
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
10
|
+
<title>Gradient Edge CDK Utils construct/api-to-eventbridge-target/main.ts</title>
|
|
11
|
+
|
|
12
|
+
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
|
|
13
|
+
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
|
|
14
|
+
<script src="./build/entry.js"></script>
|
|
15
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
|
16
|
+
<!--[if lt IE 9]>
|
|
17
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
18
|
+
<![endif]-->
|
|
19
|
+
<link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet">
|
|
20
|
+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
|
|
21
|
+
<link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
|
|
22
|
+
<link type="text/css" rel="stylesheet" href="styles/app.min.css">
|
|
23
|
+
<link type="text/css" rel="stylesheet" href="styles/iframe.css">
|
|
24
|
+
<link type="text/css" rel="stylesheet" href="">
|
|
25
|
+
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</head>
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<body class="layout small-header">
|
|
33
|
+
<div id="stickyNavbarOverlay"></div>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
<div class="top-nav">
|
|
37
|
+
<div class="inner">
|
|
38
|
+
<a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
|
|
39
|
+
<span aria-hidden="true"></span>
|
|
40
|
+
<span aria-hidden="true"></span>
|
|
41
|
+
<span aria-hidden="true"></span>
|
|
42
|
+
</a>
|
|
43
|
+
<div class="logo">
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<a href="index.html">
|
|
47
|
+
<h1 class="navbar-item">Gradient Edge CDK Utils Documentation</h1>
|
|
48
|
+
</a>
|
|
49
|
+
|
|
50
|
+
</div>
|
|
51
|
+
<div class="menu">
|
|
52
|
+
|
|
53
|
+
<div class="navigation">
|
|
54
|
+
<a
|
|
55
|
+
href="index.html"
|
|
56
|
+
class="link"
|
|
57
|
+
>
|
|
58
|
+
API Documentation
|
|
59
|
+
</a>
|
|
60
|
+
|
|
61
|
+
<div class="dropdown is-hoverable is-right">
|
|
62
|
+
<a class="dropdown-trigger link">
|
|
63
|
+
Tutorials
|
|
64
|
+
<i class="fas fa-chevron-down fa-xs"></i>
|
|
65
|
+
</a>
|
|
66
|
+
<div class="dropdown-menu">
|
|
67
|
+
<div class="dropdown-content">
|
|
68
|
+
|
|
69
|
+
<a class="dropdown-item" href="tutorial-Architecture.html">
|
|
70
|
+
Architecture
|
|
71
|
+
</a>
|
|
72
|
+
|
|
73
|
+
<a class="dropdown-item" href="tutorial-Build.html">
|
|
74
|
+
Build
|
|
75
|
+
</a>
|
|
76
|
+
|
|
77
|
+
<a class="dropdown-item" href="tutorial-CI-CD.html">
|
|
78
|
+
CI-CD
|
|
79
|
+
</a>
|
|
80
|
+
|
|
81
|
+
<a class="dropdown-item" href="tutorial-Development.html">
|
|
82
|
+
Development
|
|
83
|
+
</a>
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
<a
|
|
92
|
+
class="link user-link "
|
|
93
|
+
href="https://github.com/gradientedge/cdk-utils"
|
|
94
|
+
>
|
|
95
|
+
Github
|
|
96
|
+
</a>
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
<div id="main">
|
|
105
|
+
<div
|
|
106
|
+
class="sidebar "
|
|
107
|
+
id="sidebarNav"
|
|
108
|
+
>
|
|
109
|
+
|
|
110
|
+
<div class="search-wrapper">
|
|
111
|
+
<input id="search" type="text" placeholder="Search docs..." class="input">
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<nav>
|
|
115
|
+
|
|
116
|
+
<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>Application Integration</h2><h3>Classes</h3><ul><li><a href="EventManager.html">EventManager</a></li><li><a href="SnsManager.html">SnsManager</a></li></ul><h3>Interfaces</h3><ul><li><a href="EventBusProps.html">EventBusProps</a></li><li><a href="EventRuleProps.html">EventRuleProps</a></li><li><a href="RuleProps.html">RuleProps</a></li><li><a href="SubscriptionProps.html">SubscriptionProps</a></li></ul></div><div class="category"><h2>Compute</h2><h3>Classes</h3><ul><li><a href="LambdaManager.html">LambdaManager</a></li></ul><h3>Interfaces</h3><ul><li><a href="HealthCheck.html">HealthCheck</a></li><li><a href="LambdaEdgeProps.html">LambdaEdgeProps</a></li><li><a href="LambdaProps.html">LambdaProps</a></li></ul></div><div class="category"><h2>Constructs</h2><h3>Classes</h3><ul><li><a href="ApiDestinationEvent.html">ApiDestinationEvent</a></li><li><a href="ApiDestinedLambda.html">ApiDestinedLambda</a></li><li><a href="ApiDestinedRestApi.html">ApiDestinedRestApi</a></li><li><a href="ApiToEventBridgeTarget.html">ApiToEventBridgeTarget</a></li><li><a href="CommonConstruct.html">CommonConstruct</a></li><li><a href="GraphQLApiLambda.html">GraphQLApiLambda</a></li><li><a href="SiteWithEcsBackend.html">SiteWithEcsBackend</a></li><li><a href="StaticSite.html">StaticSite</a></li></ul><h3>Interfaces</h3><ul><li><a href="ApiDestinationEventType.html">ApiDestinationEventType</a></li><li><a href="ApiDestinedLambdaEnvironment.html">ApiDestinedLambdaEnvironment</a></li><li><a href="ApiDestinedLambdaType.html">ApiDestinedLambdaType</a></li><li><a href="ApiDestinedRestApiType.html">ApiDestinedRestApiType</a></li><li><a href="ApiToEventBridgeTargetEventProps.html">ApiToEventBridgeTargetEventProps</a></li><li><a href="ApiToEventBridgeTargetLambdaProps.html">ApiToEventBridgeTargetLambdaProps</a></li><li><a href="ApiToEventBridgeTargetProps.html">ApiToEventBridgeTargetProps</a></li><li><a href="CommonStackProps.html">CommonStackProps</a></li><li><a href="GraphQlApiLambdaEnvironment.html">GraphQlApiLambdaEnvironment</a></li><li><a href="GraphQlApiLambdaProps.html">GraphQlApiLambdaProps</a></li><li><a href="LambdaEnvironment.html">LambdaEnvironment</a></li><li><a href="SiteWithEcsBackendProps.html">SiteWithEcsBackendProps</a></li><li><a href="StaticSiteProps.html">StaticSiteProps</a></li></ul></div><div class="category"><h2>Containers</h2><h3>Classes</h3><ul><li><a href="EcrManager.html">EcrManager</a></li><li><a href="EcsManager.html">EcsManager</a></li><li><a href="EksManager.html">EksManager</a></li></ul><h3>Interfaces</h3><ul><li><a href="EcsClusterProps.html">EcsClusterProps</a></li><li><a href="EcsTaskProps.html">EcsTaskProps</a></li><li><a href="EksClusterProps.html">EksClusterProps</a></li></ul></div><div class="category"><h2>Developer Tools</h2><h3>Classes</h3><ul><li><a href="CodeBuildManager.html">CodeBuildManager</a></li></ul></div><div class="category"><h2>Management & Governance</h2><h3>Classes</h3><ul><li><a href="AppConfigManager.html">AppConfigManager</a></li><li><a href="CloudTrailManager.html">CloudTrailManager</a></li><li><a href="CloudWatchManager.html">CloudWatchManager</a></li><li><a href="LogManager.html">LogManager</a></li><li><a href="SsmManager.html">SsmManager</a></li><li><a href="SSMParameterReader.html">SSMParameterReader</a></li></ul><h3>Interfaces</h3><ul><li><a href="AlarmProps.html">AlarmProps</a></li><li><a href="AlarmStatusWidgetProps.html">AlarmStatusWidgetProps</a></li><li><a href="AppConfigProps.html">AppConfigProps</a></li><li><a href="CloudTrailProps.html">CloudTrailProps</a></li><li><a href="DashboardProps.html">DashboardProps</a></li><li><a href="GraphWidgetProps.html">GraphWidgetProps</a></li><li><a href="LogProps.html">LogProps</a></li><li><a href="LogQueryWidgetProps.html">LogQueryWidgetProps</a></li><li><a href="MetricFilterProps.html">MetricFilterProps</a></li><li><a href="MetricProps.html">MetricProps</a></li><li><a href="NumericWidgetProps.html">NumericWidgetProps</a></li><li><a href="SSMParameterReaderProps.html">SSMParameterReaderProps</a></li><li><a href="TextWidgetProps.html">TextWidgetProps</a></li></ul></div><div class="category"><h2>Networking & Content Delivery</h2><h3>Classes</h3><ul><li><a href="ApiManager.html">ApiManager</a></li><li><a href="CloudFrontManager.html">CloudFrontManager</a></li><li><a href="Route53Manager.html">Route53Manager</a></li><li><a href="VpcManager.html">VpcManager</a></li></ul><h3>Interfaces</h3><ul><li><a href="CloudfrontFunctionProps.html">CloudfrontFunctionProps</a></li><li><a href="CloudFrontProps.html">CloudFrontProps</a></li><li><a href="DistributionProps.html">DistributionProps</a></li><li><a href="Route53Props.html">Route53Props</a></li></ul></div><div class="category"><h2>Security, Identity & Compliance</h2><h3>Classes</h3><ul><li><a href="AcmManager.html">AcmManager</a></li><li><a href="IamManager.html">IamManager</a></li><li><a href="SecretsManager.html">SecretsManager</a></li><li><a href="WafManager.html">WafManager</a></li></ul><h3>Interfaces</h3><ul><li><a href="AcmProps.html">AcmProps</a></li><li><a href="WafIPSetProps.html">WafIPSetProps</a></li><li><a href="WafWebACLProps.html">WafWebACLProps</a></li></ul></div><div class="category"><h2>Stacks</h2><h3>Classes</h3><ul><li><a href="CommonStack.html">CommonStack</a></li></ul></div><div class="category"><h2>Storage</h2><h3>Classes</h3><ul><li><a href="DynamodbManager.html">DynamodbManager</a></li><li><a href="S3Manager.html">S3Manager</a></li></ul><h3>Interfaces</h3><ul><li><a href="S3BucketProps.html">S3BucketProps</a></li><li><a href="TableProps.html">TableProps</a></li></ul></div><div class="category"><h2>Utils</h2><h3>Global</h3><ul><li><a href="global.html#ArnsByRegion">ArnsByRegion</a></li><li><a href="global.html#CloudWatchWidgetType">CloudWatchWidgetType</a></li><li><a href="global.html#CommonVpcIdentifier">CommonVpcIdentifier</a></li><li><a href="global.html#createCfnOutput">createCfnOutput</a></li><li><a href="global.html#defaultResponseObject">defaultResponseObject</a></li><li><a href="global.html#isDevStage">isDevStage</a></li><li><a href="global.html#isPrdStage">isPrdStage</a></li><li><a href="global.html#isTestStage">isTestStage</a></li><li><a href="global.html#isUatStage">isUatStage</a></li><li><a href="global.html#redirectError">redirectError</a></li><li><a href="global.html#redirectSuccess">redirectSuccess</a></li></ul></div><div class="category"><h2>Utils
|
|
117
|
+
LogLevel enumeration</h2><h3>Global</h3><ul><li><a href="global.html#LogLevel">LogLevel</a></li></ul></div>
|
|
118
|
+
|
|
119
|
+
</nav>
|
|
120
|
+
</div>
|
|
121
|
+
<div class="core" id="main-content-wrapper">
|
|
122
|
+
<div class="content">
|
|
123
|
+
<header class="page-title">
|
|
124
|
+
<p>Source</p>
|
|
125
|
+
<h1>construct/api-to-eventbridge-target/main.ts</h1>
|
|
126
|
+
</header>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<section>
|
|
133
|
+
<article>
|
|
134
|
+
<pre class="prettyprint source linenums"><code>import * as apig from 'aws-cdk-lib/aws-apigateway'
|
|
135
|
+
import * as eventstargets from 'aws-cdk-lib/aws-events-targets'
|
|
136
|
+
import * as iam from 'aws-cdk-lib/aws-iam'
|
|
137
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda'
|
|
138
|
+
import * as destinations from 'aws-cdk-lib/aws-lambda-destinations'
|
|
139
|
+
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager'
|
|
140
|
+
import { Construct } from 'constructs'
|
|
141
|
+
import { CommonConstruct } from '../../common'
|
|
142
|
+
import * as types from '../../types'
|
|
143
|
+
import { ApiDestinationEvent } from './api-destination-event'
|
|
144
|
+
import { ApiDestinedLambda } from './api-destined-lambda'
|
|
145
|
+
import { ApiDestinedRestApi } from './api-destined-rest-api'
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @stability stable
|
|
149
|
+
* @category Constructs
|
|
150
|
+
* @classdesc Provides a construct to create and deploy API Gateway invocations to EventBridge
|
|
151
|
+
*
|
|
152
|
+
* <b>Architecture</b> 
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* import { ApiToEventBridgeTarget, ApiToEventBridgeTargetProps } '@gradientedge/cdk-utils'
|
|
156
|
+
* import { Construct } from 'constructs'
|
|
157
|
+
*
|
|
158
|
+
* class CustomConstruct extends ApiToEventBridgeTarget {
|
|
159
|
+
* constructor(parent: Construct, id: string, props: ApiToEventBridgeTargetProps) {
|
|
160
|
+
* super(parent, id, props)
|
|
161
|
+
* this.props = props
|
|
162
|
+
* this.id = id
|
|
163
|
+
* this.initResources()
|
|
164
|
+
* }
|
|
165
|
+
* }
|
|
166
|
+
*
|
|
167
|
+
*/
|
|
168
|
+
export class ApiToEventBridgeTarget extends CommonConstruct {
|
|
169
|
+
props: types.ApiToEventBridgeTargetProps
|
|
170
|
+
id: string
|
|
171
|
+
|
|
172
|
+
/* application related resources */
|
|
173
|
+
applicationSecrets: secretsmanager.ISecret[]
|
|
174
|
+
|
|
175
|
+
/* destined lambda related resources */
|
|
176
|
+
apiDestinedLambdaDirectory = 'app/api-destined-function'
|
|
177
|
+
apiDestinedLambda: types.ApiDestinedLambdaType
|
|
178
|
+
|
|
179
|
+
/* event related resources */
|
|
180
|
+
apiEvent: types.ApiDestinationEventType
|
|
181
|
+
|
|
182
|
+
/* rest restApi related resources */
|
|
183
|
+
apiDestinedRestApi: types.ApiDestinedRestApiType
|
|
184
|
+
apiDestinedBasePathMappings: apig.BasePathMapping[] = []
|
|
185
|
+
apiResource: string
|
|
186
|
+
|
|
187
|
+
constructor(parent: Construct, id: string, props: types.ApiToEventBridgeTargetProps) {
|
|
188
|
+
super(parent, id, props)
|
|
189
|
+
|
|
190
|
+
this.props = props
|
|
191
|
+
this.id = id
|
|
192
|
+
|
|
193
|
+
this.apiDestinedLambda = new ApiDestinedLambda()
|
|
194
|
+
this.apiEvent = new ApiDestinationEvent()
|
|
195
|
+
this.apiDestinedRestApi = new ApiDestinedRestApi()
|
|
196
|
+
this.apiResource = 'notify'
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
protected initResources() {
|
|
200
|
+
/* application related resources */
|
|
201
|
+
this.resolveSecrets()
|
|
202
|
+
|
|
203
|
+
/* core resources */
|
|
204
|
+
this.resolveHostedZone()
|
|
205
|
+
this.resolveCertificate()
|
|
206
|
+
|
|
207
|
+
/* optional custom event bus */
|
|
208
|
+
this.createApiDestinedEventBus()
|
|
209
|
+
|
|
210
|
+
/* destined lambda related resources */
|
|
211
|
+
this.createApiDestinedLambdaPolicy()
|
|
212
|
+
this.createApiDestinedLambdaRole()
|
|
213
|
+
this.createApiDestinedLambdaEnvironment()
|
|
214
|
+
this.createApiDestinedLambdaLayers()
|
|
215
|
+
this.createApiDestinedLambdaDestinations()
|
|
216
|
+
this.createApiDestinedLambdaFunction()
|
|
217
|
+
|
|
218
|
+
/* event related resources */
|
|
219
|
+
this.createApiDestinationLogGroupSuccess()
|
|
220
|
+
this.createApiDestinationRuleSuccess()
|
|
221
|
+
this.createApiDestinationLogGroupFailure()
|
|
222
|
+
this.createApiDestinationRuleFailure()
|
|
223
|
+
|
|
224
|
+
/* restApi related resources */
|
|
225
|
+
this.createApiDestinedTopicRole()
|
|
226
|
+
this.createApiDestinedTopic()
|
|
227
|
+
this.createApiDestinedRestApi()
|
|
228
|
+
this.createApiDestinedResponseModel()
|
|
229
|
+
this.createApiDestinedErrorResponseModel()
|
|
230
|
+
this.createApiDestinedResource()
|
|
231
|
+
this.createApiDestinedIntegrationRequestParameters()
|
|
232
|
+
this.createApiDestinedIntegrationRequestTemplates()
|
|
233
|
+
this.createApiDestinedIntegrationResponse()
|
|
234
|
+
this.createApiDestinedIntegrationErrorResponse()
|
|
235
|
+
this.createApiDestinedIntegration()
|
|
236
|
+
this.createApiDestinedMethodResponse()
|
|
237
|
+
this.createApiDestinedMethodErrorResponse()
|
|
238
|
+
this.createApiDestinedResourceMethod()
|
|
239
|
+
this.createApiDomain()
|
|
240
|
+
this.createApiBasePathMapping()
|
|
241
|
+
this.createApiRouteAssets()
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* @summary Method to resolve secrets from SecretsManager
|
|
246
|
+
* - To be implemented in the overriding method in the implementation class
|
|
247
|
+
* @protected
|
|
248
|
+
*/
|
|
249
|
+
protected resolveSecrets() {
|
|
250
|
+
this.applicationSecrets = []
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* @summary Method to resolve a hosted zone based on domain attributes
|
|
255
|
+
* @protected
|
|
256
|
+
*/
|
|
257
|
+
protected resolveHostedZone() {
|
|
258
|
+
this.apiDestinedRestApi.hostedZone = this.route53Manager.withHostedZoneFromFullyQualifiedDomainName(
|
|
259
|
+
`${this.id}-hosted-zone`,
|
|
260
|
+
this,
|
|
261
|
+
this.props.useExistingHostedZone
|
|
262
|
+
)
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* @summary Method to resolve a certificate based on attributes
|
|
267
|
+
* @protected
|
|
268
|
+
*/
|
|
269
|
+
protected resolveCertificate() {
|
|
270
|
+
if (
|
|
271
|
+
this.props.api.certificate.useExistingCertificate &&
|
|
272
|
+
this.props.api.certificate.certificateSsmName &&
|
|
273
|
+
this.props.api.certificate.certificateRegion
|
|
274
|
+
) {
|
|
275
|
+
this.props.api.certificate.certificateArn = this.ssMManager.readStringParameterFromRegion(
|
|
276
|
+
`${this.id}-certificate-param`,
|
|
277
|
+
this,
|
|
278
|
+
this.props.api.certificate.certificateSsmName,
|
|
279
|
+
this.props.api.certificate.certificateRegion
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
this.apiDestinedRestApi.certificate = this.acmManager.resolveCertificate(
|
|
284
|
+
`${this.id}-certificate`,
|
|
285
|
+
this,
|
|
286
|
+
this.props.api.certificate
|
|
287
|
+
)
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* @summary Method to create iam policy for Api Destined Lambda function
|
|
292
|
+
* @protected
|
|
293
|
+
*/
|
|
294
|
+
protected createApiDestinedLambdaPolicy() {
|
|
295
|
+
this.apiDestinedLambda.policy = new iam.PolicyDocument({
|
|
296
|
+
statements: [this.iamManager.statementForReadSecrets(this), this.iamManager.statementForPutEvents()],
|
|
297
|
+
})
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* @summary Method to create iam role for Api Destined Lambda function
|
|
302
|
+
* @protected
|
|
303
|
+
*/
|
|
304
|
+
protected createApiDestinedLambdaRole() {
|
|
305
|
+
this.apiDestinedLambda.role = this.iamManager.createRoleForLambda(
|
|
306
|
+
`${this.id}-lambda-destined-role`,
|
|
307
|
+
this,
|
|
308
|
+
this.apiDestinedLambda.policy
|
|
309
|
+
)
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* @summary Method to create environment variables for Api Destined Lambda function
|
|
314
|
+
* @protected
|
|
315
|
+
*/
|
|
316
|
+
protected createApiDestinedLambdaEnvironment() {
|
|
317
|
+
this.apiDestinedLambda.environment = {
|
|
318
|
+
NODE_ENV: this.props.nodeEnv,
|
|
319
|
+
LOG_LEVEL: this.props.logLevel,
|
|
320
|
+
TZ: this.props.timezone,
|
|
321
|
+
SOURCE_ID: this.id,
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
private createApiDestinedLambdaLayersSource() {
|
|
326
|
+
return this.props.lambda.useNative
|
|
327
|
+
? lambda.AssetCode.fromAsset(`${this.apiDestinedLambdaDirectory}/layers`)
|
|
328
|
+
: lambda.AssetCode.fromAsset(
|
|
329
|
+
`../node_modules/@gradientedge/cdk-utils/dist/${this.apiDestinedLambdaDirectory}/layers`
|
|
330
|
+
)
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* @summary Method to create layers for Api Destined Lambda function
|
|
335
|
+
* @protected
|
|
336
|
+
*/
|
|
337
|
+
protected createApiDestinedLambdaLayers() {
|
|
338
|
+
const layers: lambda.LayerVersion[] = []
|
|
339
|
+
layers.push(
|
|
340
|
+
this.lambdaManager.createLambdaLayer(
|
|
341
|
+
`${this.id}-lambda-destined-layer`,
|
|
342
|
+
this,
|
|
343
|
+
this.createApiDestinedLambdaLayersSource()
|
|
344
|
+
)
|
|
345
|
+
)
|
|
346
|
+
this.apiDestinedLambda.layers = layers
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* @summary Method to create destination for Api Destined function
|
|
351
|
+
* @protected
|
|
352
|
+
*/
|
|
353
|
+
protected createApiDestinedLambdaDestinations() {
|
|
354
|
+
this.apiDestinedLambda.destinationSuccess = new destinations.EventBridgeDestination(this.apiEvent.eventBus)
|
|
355
|
+
this.apiDestinedLambda.destinationFailure = new destinations.EventBridgeDestination(this.apiEvent.eventBus)
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
private createApiDestinedLambdaFunctionSource() {
|
|
359
|
+
return this.props.lambda.useNative
|
|
360
|
+
? lambda.AssetCode.fromAsset(`${this.apiDestinedLambdaDirectory}/src/lib`)
|
|
361
|
+
: lambda.AssetCode.fromAsset(
|
|
362
|
+
`../node_modules/@gradientedge/cdk-utils/dist/${this.apiDestinedLambdaDirectory}/src/lib`
|
|
363
|
+
)
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @summary Method to create lambda function for Api Destined
|
|
368
|
+
* @protected
|
|
369
|
+
*/
|
|
370
|
+
protected createApiDestinedLambdaFunction() {
|
|
371
|
+
this.apiDestinedLambda.function = this.lambdaManager.createLambdaFunction(
|
|
372
|
+
`${this.id}-lambda-destined`,
|
|
373
|
+
this,
|
|
374
|
+
{
|
|
375
|
+
...this.props.lambda.function,
|
|
376
|
+
...{
|
|
377
|
+
onSuccess: this.apiDestinedLambda.destinationSuccess,
|
|
378
|
+
onFailure: this.apiDestinedLambda.destinationFailure,
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
this.apiDestinedLambda.role,
|
|
382
|
+
this.apiDestinedLambda.layers,
|
|
383
|
+
this.createApiDestinedLambdaFunctionSource(),
|
|
384
|
+
'lambda.handler',
|
|
385
|
+
this.apiDestinedLambda.environment
|
|
386
|
+
)
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
protected createApiDestinedEventBus() {
|
|
390
|
+
this.apiEvent.eventBus = this.eventManager.createEventBus(`${this.id}-destined-event-bus`, this, {
|
|
391
|
+
eventBusName: `${this.props.event.eventBusName}`,
|
|
392
|
+
})
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
protected createApiDestinationLogGroupSuccess() {
|
|
396
|
+
this.apiEvent.logGroupSuccess = this.logManager.createLogGroup(`${this.id}-destination-success-log`, this, {
|
|
397
|
+
...{
|
|
398
|
+
logGroupName: `/${this.id}/events/api-destination-success`,
|
|
399
|
+
},
|
|
400
|
+
...this.props.event.logGroupSuccess,
|
|
401
|
+
})
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Method to create EventBridge rule with lambda target for success
|
|
406
|
+
* @protected
|
|
407
|
+
*/
|
|
408
|
+
protected createApiDestinationRuleSuccess() {
|
|
409
|
+
this.props.event.ruleSuccess = {
|
|
410
|
+
...{
|
|
411
|
+
ruleName: `${this.id}-api-destination-success`,
|
|
412
|
+
eventPattern: {
|
|
413
|
+
detail: {
|
|
414
|
+
requestContext: {
|
|
415
|
+
condition: ['Success'],
|
|
416
|
+
},
|
|
417
|
+
responsePayload: {
|
|
418
|
+
source: ['custom:api-destined-lambda'],
|
|
419
|
+
sourceId: [this.id],
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
...this.props.event.ruleSuccess,
|
|
425
|
+
}
|
|
426
|
+
this.apiEvent.ruleSuccess = this.eventManager.createRule(
|
|
427
|
+
`${this.id}-api-destination-rule-success`,
|
|
428
|
+
this,
|
|
429
|
+
this.props.event.ruleSuccess,
|
|
430
|
+
this.apiEvent.eventBus,
|
|
431
|
+
[new eventstargets.CloudWatchLogGroup(this.apiEvent.logGroupSuccess)]
|
|
432
|
+
)
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
protected createApiDestinationLogGroupFailure() {
|
|
436
|
+
this.apiEvent.logGroupFailure = this.logManager.createLogGroup(`${this.id}-destination-failure-log`, this, {
|
|
437
|
+
...{
|
|
438
|
+
logGroupName: `/${this.id}/events/api-destination-failure`,
|
|
439
|
+
},
|
|
440
|
+
...this.props.event.logGroupFailure,
|
|
441
|
+
})
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Method to create EventBridge rule with lambda target for failure
|
|
446
|
+
* @protected
|
|
447
|
+
*/
|
|
448
|
+
protected createApiDestinationRuleFailure() {
|
|
449
|
+
this.props.event.ruleFailure = {
|
|
450
|
+
...{
|
|
451
|
+
ruleName: `${this.id}-api-destination-failure`,
|
|
452
|
+
eventPattern: {
|
|
453
|
+
detail: {
|
|
454
|
+
responsePayload: {
|
|
455
|
+
errorType: ['Error'],
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
...this.props.event.ruleFailure,
|
|
461
|
+
}
|
|
462
|
+
this.apiEvent.ruleFailure = this.eventManager.createRule(
|
|
463
|
+
`${this.id}-api-destination-rule-failure`,
|
|
464
|
+
this,
|
|
465
|
+
this.props.event.ruleFailure,
|
|
466
|
+
this.apiEvent.eventBus,
|
|
467
|
+
[new eventstargets.CloudWatchLogGroup(this.apiEvent.logGroupFailure)]
|
|
468
|
+
)
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
protected createApiDestinedTopicRole() {
|
|
472
|
+
this.apiDestinedRestApi.topicRole = new iam.Role(this, `${this.id}-sns-rest-api-role`, {
|
|
473
|
+
assumedBy: new iam.ServicePrincipal('apigateway.amazonaws.com'),
|
|
474
|
+
})
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
protected createApiDestinedTopic() {
|
|
478
|
+
this.apiDestinedRestApi.topic = this.snsManager.createLambdaNotificationService(
|
|
479
|
+
`${this.id}-destined-topic`,
|
|
480
|
+
this,
|
|
481
|
+
{
|
|
482
|
+
topicName: `${this.id}-destined-topic`,
|
|
483
|
+
},
|
|
484
|
+
this.apiDestinedLambda.function
|
|
485
|
+
)
|
|
486
|
+
|
|
487
|
+
this.apiDestinedRestApi.topic.grantPublish(this.apiDestinedRestApi.topicRole)
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* @summary Method to create rest restApi for Api
|
|
492
|
+
* @protected
|
|
493
|
+
*/
|
|
494
|
+
protected createApiDestinedRestApi() {
|
|
495
|
+
this.apiDestinedRestApi.api = new apig.RestApi(this, `${this.id}-sns-rest-api`, {
|
|
496
|
+
...{
|
|
497
|
+
deployOptions: {
|
|
498
|
+
dataTraceEnabled: true,
|
|
499
|
+
description: `${this.id} - ${this.props.stage} stage`,
|
|
500
|
+
loggingLevel: apig.MethodLoggingLevel.INFO,
|
|
501
|
+
metricsEnabled: true,
|
|
502
|
+
stageName: this.props.stage,
|
|
503
|
+
},
|
|
504
|
+
endpointConfiguration: {
|
|
505
|
+
types: [apig.EndpointType.REGIONAL],
|
|
506
|
+
},
|
|
507
|
+
defaultCorsPreflightOptions: {
|
|
508
|
+
allowOrigins: apig.Cors.ALL_ORIGINS,
|
|
509
|
+
allowMethods: ['POST'],
|
|
510
|
+
allowHeaders: apig.Cors.DEFAULT_HEADERS,
|
|
511
|
+
},
|
|
512
|
+
restApiName: `${this.id}-destined-rest-api-${this.props.stage}`,
|
|
513
|
+
},
|
|
514
|
+
...this.props.api,
|
|
515
|
+
})
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
protected createApiDestinedResponseModel() {
|
|
519
|
+
this.apiDestinedRestApi.responseModel = this.apiDestinedRestApi.api.addModel(`${this.id}-response-model`, {
|
|
520
|
+
...{
|
|
521
|
+
contentType: 'application/json',
|
|
522
|
+
modelName: 'ResponseModel',
|
|
523
|
+
schema: {
|
|
524
|
+
schema: apig.JsonSchemaVersion.DRAFT4,
|
|
525
|
+
title: 'pollResponse',
|
|
526
|
+
type: apig.JsonSchemaType.OBJECT,
|
|
527
|
+
properties: { message: { type: apig.JsonSchemaType.STRING } },
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
...this.props.api.responseModel,
|
|
531
|
+
})
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
protected createApiDestinedErrorResponseModel() {
|
|
535
|
+
this.apiDestinedRestApi.errorResponseModel = this.apiDestinedRestApi.api.addModel(
|
|
536
|
+
`${this.id}-error-response-model`,
|
|
537
|
+
{
|
|
538
|
+
...{
|
|
539
|
+
contentType: 'application/json',
|
|
540
|
+
modelName: 'ErrorResponseModel',
|
|
541
|
+
schema: {
|
|
542
|
+
schema: apig.JsonSchemaVersion.DRAFT4,
|
|
543
|
+
title: 'errorResponse',
|
|
544
|
+
type: apig.JsonSchemaType.OBJECT,
|
|
545
|
+
properties: {
|
|
546
|
+
state: { type: apig.JsonSchemaType.STRING },
|
|
547
|
+
message: { type: apig.JsonSchemaType.STRING },
|
|
548
|
+
},
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
...this.props.api.errorResponseModel,
|
|
552
|
+
}
|
|
553
|
+
)
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
protected createApiDestinedResource() {
|
|
557
|
+
this.apiDestinedRestApi.resource = this.apiDestinedRestApi.api.root.addResource(
|
|
558
|
+
this.props.api.resource ?? this.apiResource
|
|
559
|
+
)
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
protected createApiDestinedIntegrationRequestParameters() {
|
|
563
|
+
this.apiDestinedRestApi.integrationRequestParameters = {
|
|
564
|
+
'integration.request.header.Content-Type': "'application/x-www-form-urlencoded'",
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
protected createApiDestinedIntegrationRequestTemplates() {
|
|
569
|
+
this.apiDestinedRestApi.integrationRequestTemplates = {
|
|
570
|
+
'application/json': [
|
|
571
|
+
'Action=Publish',
|
|
572
|
+
`TargetArn=$util.urlEncode('${this.apiDestinedRestApi.topic.topicArn}')`,
|
|
573
|
+
'Message=$input.body',
|
|
574
|
+
'Version=2010-03-31',
|
|
575
|
+
].join('&'),
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
protected createApiDestinedIntegrationResponse() {
|
|
580
|
+
this.apiDestinedRestApi.integrationResponse = {
|
|
581
|
+
...{
|
|
582
|
+
statusCode: '200',
|
|
583
|
+
responseTemplates: {
|
|
584
|
+
'application/json': JSON.stringify({ message: 'Payload Submitted' }),
|
|
585
|
+
},
|
|
586
|
+
},
|
|
587
|
+
...this.props.api.integrationResponse,
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
protected createApiDestinedIntegrationErrorResponse() {
|
|
592
|
+
this.apiDestinedRestApi.integrationErrorResponse = {
|
|
593
|
+
...{
|
|
594
|
+
selectionPattern: '^\\[Error\\].*',
|
|
595
|
+
statusCode: '400',
|
|
596
|
+
responseTemplates: {
|
|
597
|
+
'application/json': JSON.stringify({
|
|
598
|
+
state: 'error',
|
|
599
|
+
message: "$util.escapeJavaScript($input.path('$.errorMessage'))",
|
|
600
|
+
}),
|
|
601
|
+
},
|
|
602
|
+
responseParameters: {
|
|
603
|
+
'method.response.header.Content-Type': "'application/json'",
|
|
604
|
+
'method.response.header.Access-Control-Allow-Origin': "'*'",
|
|
605
|
+
'method.response.header.Access-Control-Allow-Credentials': "'true'",
|
|
606
|
+
},
|
|
607
|
+
},
|
|
608
|
+
...this.props.api.integrationErrorResponse,
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
protected createApiDestinedIntegration() {
|
|
613
|
+
this.apiDestinedRestApi.integration = new apig.Integration({
|
|
614
|
+
type: apig.IntegrationType.AWS,
|
|
615
|
+
integrationHttpMethod: 'POST',
|
|
616
|
+
uri: `arn:aws:apigateway:${this.props.region}:sns:path//`,
|
|
617
|
+
options: {
|
|
618
|
+
...{
|
|
619
|
+
credentialsRole: this.apiDestinedRestApi.topicRole,
|
|
620
|
+
requestParameters: this.apiDestinedRestApi.integrationRequestParameters,
|
|
621
|
+
requestTemplates: this.apiDestinedRestApi.integrationRequestTemplates,
|
|
622
|
+
passthroughBehavior: apig.PassthroughBehavior.NEVER,
|
|
623
|
+
integrationResponses: [
|
|
624
|
+
this.apiDestinedRestApi.integrationResponse,
|
|
625
|
+
this.apiDestinedRestApi.integrationErrorResponse,
|
|
626
|
+
],
|
|
627
|
+
},
|
|
628
|
+
...this.props.api.integrationOptions,
|
|
629
|
+
},
|
|
630
|
+
})
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
protected createApiDestinedMethodResponse() {
|
|
634
|
+
this.apiDestinedRestApi.methodResponse = {
|
|
635
|
+
...{
|
|
636
|
+
statusCode: '200',
|
|
637
|
+
responseParameters: {
|
|
638
|
+
'method.response.header.Content-Type': true,
|
|
639
|
+
'method.response.header.Access-Control-Allow-Origin': true,
|
|
640
|
+
'method.response.header.Access-Control-Allow-Credentials': true,
|
|
641
|
+
},
|
|
642
|
+
responseModels: {
|
|
643
|
+
'application/json': this.apiDestinedRestApi.responseModel,
|
|
644
|
+
},
|
|
645
|
+
},
|
|
646
|
+
...this.props.api.methodResponse,
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
protected createApiDestinedMethodErrorResponse() {
|
|
651
|
+
this.apiDestinedRestApi.methodErrorResponse = {
|
|
652
|
+
...{
|
|
653
|
+
statusCode: '400',
|
|
654
|
+
responseParameters: {
|
|
655
|
+
'method.response.header.Content-Type': true,
|
|
656
|
+
'method.response.header.Access-Control-Allow-Origin': true,
|
|
657
|
+
'method.response.header.Access-Control-Allow-Credentials': true,
|
|
658
|
+
},
|
|
659
|
+
responseModels: {
|
|
660
|
+
'application/json': this.apiDestinedRestApi.errorResponseModel,
|
|
661
|
+
},
|
|
662
|
+
},
|
|
663
|
+
...this.props.api.methodErrorResponse,
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
protected createApiDestinedResourceMethod() {
|
|
668
|
+
this.apiDestinedRestApi.method = this.apiDestinedRestApi.resource.addMethod(
|
|
669
|
+
'POST',
|
|
670
|
+
this.apiDestinedRestApi.integration,
|
|
671
|
+
{
|
|
672
|
+
methodResponses: [this.apiDestinedRestApi.methodResponse, this.apiDestinedRestApi.methodErrorResponse],
|
|
673
|
+
}
|
|
674
|
+
)
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* @summary Method to create custom restApi domain for Api API
|
|
679
|
+
* @protected
|
|
680
|
+
*/
|
|
681
|
+
protected createApiDomain() {
|
|
682
|
+
this.apiDestinedRestApi.domain = this.apiManager.createApiDomain(
|
|
683
|
+
`${this.id}-api-domain`,
|
|
684
|
+
this,
|
|
685
|
+
this.isProductionStage()
|
|
686
|
+
? `${this.props.apiSubDomain}.${this.fullyQualifiedDomainName}`
|
|
687
|
+
: `${this.props.apiSubDomain}-${this.props.stage}.${this.fullyQualifiedDomainName}`,
|
|
688
|
+
this.apiDestinedRestApi.certificate
|
|
689
|
+
)
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* @summary Method to create base path mappings for Api API
|
|
694
|
+
* @protected
|
|
695
|
+
*/
|
|
696
|
+
protected createApiBasePathMapping() {
|
|
697
|
+
const apiRootPaths = this.props.apiRootPaths
|
|
698
|
+
if (apiRootPaths && apiRootPaths.length > 0) {
|
|
699
|
+
apiRootPaths.forEach((apiRootPath: string) => {
|
|
700
|
+
this.apiDestinedBasePathMappings.push(
|
|
701
|
+
new apig.BasePathMapping(this, `${this.id}-base-bath-mapping-${apiRootPath}`, {
|
|
702
|
+
basePath: this.props.api.resource,
|
|
703
|
+
domainName: this.apiDestinedRestApi.domain,
|
|
704
|
+
restApi: this.apiDestinedRestApi.api,
|
|
705
|
+
stage: this.apiDestinedRestApi.api.deploymentStage,
|
|
706
|
+
})
|
|
707
|
+
)
|
|
708
|
+
})
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* @summary Method to create route53 records for Api API
|
|
714
|
+
* @protected
|
|
715
|
+
*/
|
|
716
|
+
protected createApiRouteAssets() {
|
|
717
|
+
this.route53Manager.createApiGatewayARecord(
|
|
718
|
+
`${this.id}-custom-domain-a-record`,
|
|
719
|
+
this,
|
|
720
|
+
this.props.apiSubDomain,
|
|
721
|
+
this.apiDestinedRestApi.domain,
|
|
722
|
+
this.apiDestinedRestApi.hostedZone
|
|
723
|
+
)
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
</code></pre>
|
|
727
|
+
</article>
|
|
728
|
+
</section>
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
</div>
|
|
734
|
+
|
|
735
|
+
</div>
|
|
736
|
+
<div id="side-nav" class="side-nav">
|
|
737
|
+
</div>
|
|
738
|
+
</div>
|
|
739
|
+
<script src="scripts/app.min.js"></script>
|
|
740
|
+
<script>PR.prettyPrint();</script>
|
|
741
|
+
<script src="scripts/linenumber.js"> </script>
|
|
742
|
+
|
|
743
|
+
<script src="scripts/search.js"> </script>
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
</body>
|
|
747
|
+
</html>
|