quidproquo-deploy-awscdk 0.0.70 → 0.0.71
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/lib/constructs/base/QpqConstructBlock.d.ts +18 -0
- package/lib/constructs/{core/QpqConstructBase.js → base/QpqConstructBlock.js} +11 -6
- package/lib/constructs/{core → base}/QpqResource.d.ts +2 -2
- package/lib/constructs/{core → base}/QpqResource.js +0 -0
- package/lib/constructs/base/index.d.ts +2 -0
- package/lib/constructs/base/index.js +18 -0
- package/lib/constructs/basic/Function.d.ts +3 -3
- package/lib/constructs/basic/Function.js +2 -2
- package/lib/constructs/basic/LambdaLayers.d.ts +15 -0
- package/lib/constructs/basic/LambdaLayers.js +21 -0
- package/lib/constructs/basic/SubdomainName.d.ts +3 -3
- package/lib/constructs/basic/SubdomainName.js +2 -2
- package/lib/constructs/basic/index.d.ts +3 -0
- package/lib/constructs/basic/index.js +19 -0
- package/lib/constructs/feature/core/index.d.ts +5 -0
- package/lib/constructs/feature/core/index.js +21 -0
- package/lib/constructs/{QpqCoreParameterConstruct.d.ts → feature/core/parameter/QpqCoreParameterConstruct.d.ts} +8 -7
- package/lib/constructs/{QpqCoreParameterConstruct.js → feature/core/parameter/QpqCoreParameterConstruct.js} +10 -10
- package/lib/constructs/feature/core/parameter/index.d.ts +1 -0
- package/lib/constructs/feature/core/parameter/index.js +17 -0
- package/lib/constructs/feature/core/queue/QpqApiCoreQueueConstruct.d.ts +11 -0
- package/lib/constructs/feature/core/queue/QpqApiCoreQueueConstruct.js +63 -0
- package/lib/constructs/feature/core/queue/QpqCoreQueueConstruct.d.ts +18 -0
- package/lib/constructs/feature/core/queue/QpqCoreQueueConstruct.js +72 -0
- package/lib/constructs/feature/core/queue/index.d.ts +2 -0
- package/lib/constructs/feature/core/queue/index.js +18 -0
- package/lib/constructs/{QpqCoreRecurringScheduleConstruct.d.ts → feature/core/schedule/QpqCoreRecurringScheduleConstruct.d.ts} +6 -3
- package/lib/constructs/{QpqCoreRecurringScheduleConstruct.js → feature/core/schedule/QpqCoreRecurringScheduleConstruct.js} +10 -11
- package/lib/constructs/feature/core/schedule/index.d.ts +1 -0
- package/lib/constructs/feature/core/schedule/index.js +17 -0
- package/lib/constructs/{QpqCoreSecretConstruct.d.ts → feature/core/secret/QpqCoreSecretConstruct.d.ts} +6 -5
- package/lib/constructs/{QpqCoreSecretConstruct.js → feature/core/secret/QpqCoreSecretConstruct.js} +7 -7
- package/lib/constructs/feature/core/secret/index.d.ts +1 -0
- package/lib/constructs/feature/core/secret/index.js +17 -0
- package/lib/constructs/{QpqCoreStorageDriveConstruct.d.ts → feature/core/storageDrive/QpqCoreStorageDriveConstruct.d.ts} +6 -5
- package/lib/constructs/{QpqCoreStorageDriveConstruct.js → feature/core/storageDrive/QpqCoreStorageDriveConstruct.js} +8 -8
- package/lib/constructs/feature/core/storageDrive/index.d.ts +1 -0
- package/lib/constructs/feature/core/storageDrive/index.js +17 -0
- package/lib/constructs/feature/index.d.ts +2 -0
- package/lib/constructs/feature/index.js +18 -0
- package/lib/constructs/{QpqWebserverApiConstruct.d.ts → feature/webserver/api/QpqWebserverApiConstruct.d.ts} +6 -3
- package/lib/constructs/{QpqWebserverApiConstruct.js → feature/webserver/api/QpqWebserverApiConstruct.js} +10 -12
- package/lib/constructs/feature/webserver/api/index.d.ts +1 -0
- package/lib/constructs/feature/webserver/api/index.js +17 -0
- package/lib/constructs/{QpqWebserverDomainConstruct.d.ts → feature/webserver/domain/QpqWebserverDomainConstruct.d.ts} +4 -3
- package/lib/constructs/{QpqWebserverDomainConstruct.js → feature/webserver/domain/QpqWebserverDomainConstruct.js} +4 -20
- package/lib/constructs/feature/webserver/domain/index.d.ts +1 -0
- package/lib/constructs/feature/webserver/domain/index.js +17 -0
- package/lib/constructs/feature/webserver/index.d.ts +4 -0
- package/lib/constructs/feature/webserver/index.js +20 -0
- package/lib/constructs/{QpqWebserverSubdomainRedirectConstruct.d.ts → feature/webserver/redirect/QpqWebserverSubdomainRedirectConstruct.d.ts} +4 -3
- package/lib/constructs/{QpqWebserverSubdomainRedirectConstruct.js → feature/webserver/redirect/QpqWebserverSubdomainRedirectConstruct.js} +8 -9
- package/lib/constructs/feature/webserver/redirect/index.d.ts +1 -0
- package/lib/constructs/feature/webserver/redirect/index.js +17 -0
- package/lib/constructs/{QpqWebserverWebEntryConstruct.d.ts → feature/webserver/webEntry/QpqWebserverWebEntryConstruct.d.ts} +4 -3
- package/lib/constructs/{QpqWebserverWebEntryConstruct.js → feature/webserver/webEntry/QpqWebserverWebEntryConstruct.js} +27 -27
- package/lib/constructs/feature/webserver/webEntry/index.d.ts +1 -0
- package/lib/constructs/feature/webserver/webEntry/index.js +17 -0
- package/lib/constructs/index.d.ts +3 -0
- package/lib/constructs/index.js +19 -0
- package/lib/index.d.ts +4 -7
- package/lib/index.js +17 -7
- package/lib/lambdas/lambdaAPIGatewayEvent.js +1 -1
- package/lib/lambdas/lambdaEventBridgeEvent.js +1 -1
- package/lib/lambdas/lambdaSQSEvent.d.ts +6 -0
- package/lib/lambdas/lambdaSQSEvent.js +64 -0
- package/lib/{QPQApp.d.ts → qpqApp.d.ts} +0 -0
- package/lib/{QPQApp.js → qpqApp.js} +0 -0
- package/lib/stacks/ApiQpqServiceStack.d.ts +11 -0
- package/lib/stacks/ApiQpqServiceStack.js +42 -0
- package/lib/stacks/InfQpqServiceStack.d.ts +7 -0
- package/lib/stacks/InfQpqServiceStack.js +43 -0
- package/lib/stacks/WebQpqServiceStack.d.ts +9 -0
- package/lib/stacks/WebQpqServiceStack.js +21 -0
- package/lib/stacks/base/QpqServiceStack.d.ts +12 -0
- package/lib/stacks/base/QpqServiceStack.js +18 -0
- package/lib/stacks/index.d.ts +3 -0
- package/lib/stacks/index.js +19 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +18 -0
- package/lib/utils/qpqAwsCdkNamingUtils.d.ts +5 -0
- package/lib/{utils.js → utils/qpqAwsCdkNamingUtils.js} +3 -14
- package/lib/{qpqDeployAwsCdkUtils.d.ts → utils/qpqDeployAwsCdkUtils.d.ts} +2 -2
- package/lib/{qpqDeployAwsCdkUtils.js → utils/qpqDeployAwsCdkUtils.js} +16 -13
- package/package.json +1 -1
- package/src/constructs/base/QpqConstructBlock.ts +40 -0
- package/src/constructs/{core → base}/QpqResource.ts +2 -2
- package/src/constructs/base/index.ts +2 -0
- package/src/constructs/basic/Function.ts +3 -4
- package/src/constructs/basic/LambdaLayers.ts +36 -0
- package/src/constructs/basic/SubdomainName.ts +3 -3
- package/src/constructs/basic/index.ts +3 -0
- package/src/constructs/feature/core/index.ts +5 -0
- package/src/constructs/{QpqCoreParameterConstruct.ts → feature/core/parameter/QpqCoreParameterConstruct.ts} +19 -20
- package/src/constructs/feature/core/parameter/index.ts +1 -0
- package/src/constructs/feature/core/queue/QpqApiCoreQueueConstruct.ts +69 -0
- package/src/constructs/feature/core/queue/QpqCoreQueueConstruct.ts +76 -0
- package/src/constructs/feature/core/queue/index.ts +2 -0
- package/src/constructs/{QpqCoreRecurringScheduleConstruct.ts → feature/core/schedule/QpqCoreRecurringScheduleConstruct.ts} +17 -14
- package/src/constructs/feature/core/schedule/index.ts +1 -0
- package/src/constructs/{QpqCoreSecretConstruct.ts → feature/core/secret/QpqCoreSecretConstruct.ts} +14 -13
- package/src/constructs/feature/core/secret/index.ts +1 -0
- package/src/constructs/{QpqCoreStorageDriveConstruct.ts → feature/core/storageDrive/QpqCoreStorageDriveConstruct.ts} +18 -12
- package/src/constructs/feature/core/storageDrive/index.ts +1 -0
- package/src/constructs/feature/index.ts +2 -0
- package/src/constructs/{QpqWebserverApiConstruct.ts → feature/webserver/api/QpqWebserverApiConstruct.ts} +16 -17
- package/src/constructs/feature/webserver/api/index.ts +1 -0
- package/src/constructs/{QpqWebserverDomainConstruct.ts → feature/webserver/domain/QpqWebserverDomainConstruct.ts} +8 -28
- package/src/constructs/feature/webserver/domain/index.ts +1 -0
- package/src/constructs/feature/webserver/index.ts +4 -0
- package/src/constructs/{QpqWebserverSubdomainRedirectConstruct.ts → feature/webserver/redirect/QpqWebserverSubdomainRedirectConstruct.ts} +13 -11
- package/src/constructs/feature/webserver/redirect/index.ts +1 -0
- package/src/constructs/{QpqWebserverWebEntryConstruct.ts → feature/webserver/webEntry/QpqWebserverWebEntryConstruct.ts} +30 -29
- package/src/constructs/feature/webserver/webEntry/index.ts +1 -0
- package/src/constructs/index.ts +3 -0
- package/src/index.ts +4 -8
- package/src/lambdas/lambdaAPIGatewayEvent.ts +2 -0
- package/src/lambdas/lambdaEventBridgeEvent.ts +2 -0
- package/src/lambdas/lambdaSQSEvent.ts +116 -0
- package/src/{QPQApp.ts → qpqApp.ts} +0 -0
- package/src/stacks/ApiQpqServiceStack.ts +72 -0
- package/src/stacks/InfQpqServiceStack.ts +76 -0
- package/src/stacks/WebQpqServiceStack.ts +33 -0
- package/src/stacks/base/QpqServiceStack.ts +28 -0
- package/src/stacks/index.ts +3 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/qpqAwsCdkNamingUtils.ts +28 -0
- package/src/{qpqDeployAwsCdkUtils.ts → utils/qpqDeployAwsCdkUtils.ts} +35 -11
- package/lib/ApiQPQServiceStack.d.ts +0 -9
- package/lib/ApiQPQServiceStack.js +0 -23
- package/lib/DeploymentSettings.d.ts +0 -4
- package/lib/DeploymentSettings.js +0 -2
- package/lib/DeploymentType.d.ts +0 -5
- package/lib/DeploymentType.js +0 -9
- package/lib/InfrastructureQPQServiceStack.d.ts +0 -7
- package/lib/InfrastructureQPQServiceStack.js +0 -25
- package/lib/QpqSettingConstructMap.d.ts +0 -4
- package/lib/QpqSettingConstructMap.js +0 -22
- package/lib/WebQPQServiceStack.d.ts +0 -9
- package/lib/WebQPQServiceStack.js +0 -19
- package/lib/constructs/core/QPQServiceStack.d.ts +0 -18
- package/lib/constructs/core/QPQServiceStack.js +0 -35
- package/lib/constructs/core/QpqConstruct.d.ts +0 -11
- package/lib/constructs/core/QpqConstruct.js +0 -11
- package/lib/constructs/core/QpqConstructBase.d.ts +0 -15
- package/lib/utils.d.ts +0 -8
- package/src/ApiQPQServiceStack.ts +0 -34
- package/src/DeploymentSettings.ts +0 -5
- package/src/DeploymentType.ts +0 -5
- package/src/InfrastructureQPQServiceStack.ts +0 -31
- package/src/QpqSettingConstructMap.ts +0 -27
- package/src/WebQPQServiceStack.ts +0 -29
- package/src/constructs/core/QPQServiceStack.ts +0 -50
- package/src/constructs/core/QpqConstruct.ts +0 -19
- package/src/constructs/core/QpqConstructBase.ts +0 -32
- package/src/utils.ts +0 -54
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { QPQConfig } from 'quidproquo-core';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
import { QpqResource } from './QpqResource';
|
|
4
|
+
import { IGrantable } from 'aws-cdk-lib/aws-iam';
|
|
5
|
+
export interface QpqConstructBlockProps {
|
|
6
|
+
awsAccountId: string;
|
|
7
|
+
qpqConfig: QPQConfig;
|
|
8
|
+
}
|
|
9
|
+
export declare class QpqConstructBlock extends Construct implements QpqResource {
|
|
10
|
+
awsAccountId: string;
|
|
11
|
+
qpqConfig: QPQConfig;
|
|
12
|
+
constructor(scope: Construct, id: string, props: QpqConstructBlockProps);
|
|
13
|
+
resourceName(name: string): string;
|
|
14
|
+
qpqResourceName(name: string, resourceType: string): string;
|
|
15
|
+
grantRead(grantee: IGrantable): void;
|
|
16
|
+
grantWrite(grantee: IGrantable): void;
|
|
17
|
+
grantAll(grantee: IGrantable): void;
|
|
18
|
+
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const constructs_1 = require("constructs");
|
|
3
|
+
exports.QpqConstructBlock = void 0;
|
|
5
4
|
const quidproquo_actionprocessor_awslambda_1 = require("quidproquo-actionprocessor-awslambda");
|
|
6
|
-
|
|
5
|
+
const constructs_1 = require("constructs");
|
|
6
|
+
class QpqConstructBlock extends constructs_1.Construct {
|
|
7
7
|
constructor(scope, id, props) {
|
|
8
8
|
super(scope, id);
|
|
9
|
-
this.
|
|
9
|
+
this.awsAccountId = props.awsAccountId;
|
|
10
10
|
this.qpqConfig = props.qpqConfig;
|
|
11
|
-
this.apiLayerVersions = props.apiLayerVersions;
|
|
12
11
|
}
|
|
13
12
|
resourceName(name) {
|
|
14
13
|
return quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getConfigRuntimeResourceName(name, this.qpqConfig);
|
|
@@ -16,5 +15,11 @@ class QpqConstructBase extends constructs_1.Construct {
|
|
|
16
15
|
qpqResourceName(name, resourceType) {
|
|
17
16
|
return quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getQpqRuntimeResourceName(name, this.qpqConfig, resourceType);
|
|
18
17
|
}
|
|
18
|
+
grantRead(grantee) { }
|
|
19
|
+
grantWrite(grantee) { }
|
|
20
|
+
grantAll(grantee) {
|
|
21
|
+
this.grantRead(grantee);
|
|
22
|
+
this.grantWrite(grantee);
|
|
23
|
+
}
|
|
19
24
|
}
|
|
20
|
-
exports.
|
|
25
|
+
exports.QpqConstructBlock = QpqConstructBlock;
|
|
@@ -5,13 +5,13 @@ export interface QpqResource {
|
|
|
5
5
|
*
|
|
6
6
|
* @param grantee the role to be granted read-only access to the resource.
|
|
7
7
|
*/
|
|
8
|
-
grantRead(grantee: aws_iam.IGrantable):
|
|
8
|
+
grantRead(grantee: aws_iam.IGrantable): void;
|
|
9
9
|
/**
|
|
10
10
|
* Grants write permissions on the resource.
|
|
11
11
|
*
|
|
12
12
|
* @param grantee the role to be granted write access to the resource.
|
|
13
13
|
*/
|
|
14
|
-
grantWrite(grantee: aws_iam.IGrantable):
|
|
14
|
+
grantWrite(grantee: aws_iam.IGrantable): void;
|
|
15
15
|
/**
|
|
16
16
|
* Grants read/write permissions on the resource.
|
|
17
17
|
*
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./QpqConstructBlock"), exports);
|
|
18
|
+
__exportStar(require("./QpqResource"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QpqConstructBlock, QpqConstructBlockProps } from '../base/QpqConstructBlock';
|
|
2
2
|
import { Construct } from 'constructs';
|
|
3
3
|
import { aws_lambda } from 'aws-cdk-lib';
|
|
4
|
-
export interface FunctionProps extends
|
|
4
|
+
export interface FunctionProps extends QpqConstructBlockProps {
|
|
5
5
|
functionName: string;
|
|
6
6
|
buildPath: string;
|
|
7
7
|
functionType: string;
|
|
@@ -13,7 +13,7 @@ export interface FunctionProps extends QpqConstructProps<any> {
|
|
|
13
13
|
};
|
|
14
14
|
apiLayerVersions?: aws_lambda.ILayerVersion[];
|
|
15
15
|
}
|
|
16
|
-
export declare class Function extends
|
|
16
|
+
export declare class Function extends QpqConstructBlock {
|
|
17
17
|
readonly lambdaFunction: aws_lambda.Function;
|
|
18
18
|
constructor(scope: Construct, id: string, props: FunctionProps);
|
|
19
19
|
}
|
|
@@ -28,10 +28,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.Function = void 0;
|
|
30
30
|
const path_1 = __importDefault(require("path"));
|
|
31
|
-
const
|
|
31
|
+
const QpqConstructBlock_1 = require("../base/QpqConstructBlock");
|
|
32
32
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
33
33
|
const cdk = __importStar(require("aws-cdk-lib"));
|
|
34
|
-
class Function extends
|
|
34
|
+
class Function extends QpqConstructBlock_1.QpqConstructBlock {
|
|
35
35
|
constructor(scope, id, props) {
|
|
36
36
|
super(scope, id, props);
|
|
37
37
|
this.lambdaFunction = new aws_cdk_lib_1.aws_lambda.Function(this, 'function', {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { QpqConstructBlock, QpqConstructBlockProps } from '../base/QpqConstructBlock';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
import { aws_lambda } from 'aws-cdk-lib';
|
|
4
|
+
export interface ApiLayer {
|
|
5
|
+
buildPath?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
layerArn?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface LambdaLayersProps extends QpqConstructBlockProps {
|
|
10
|
+
apiLayers?: ApiLayer[];
|
|
11
|
+
}
|
|
12
|
+
export declare class LambdaLayers extends QpqConstructBlock {
|
|
13
|
+
readonly layers: aws_lambda.ILayerVersion[];
|
|
14
|
+
constructor(scope: Construct, id: string, props: LambdaLayersProps);
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LambdaLayers = void 0;
|
|
4
|
+
const quidproquo_actionprocessor_awslambda_1 = require("quidproquo-actionprocessor-awslambda");
|
|
5
|
+
const QpqConstructBlock_1 = require("../base/QpqConstructBlock");
|
|
6
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
7
|
+
class LambdaLayers extends QpqConstructBlock_1.QpqConstructBlock {
|
|
8
|
+
constructor(scope, id, props) {
|
|
9
|
+
super(scope, id, props);
|
|
10
|
+
this.layers = (props.apiLayers || []).map((layer) => {
|
|
11
|
+
return layer.buildPath
|
|
12
|
+
? new aws_cdk_lib_1.aws_lambda.LayerVersion(this, `${layer.name}-layer`, {
|
|
13
|
+
layerVersionName: quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getQpqRuntimeResourceName(layer.name, props.qpqConfig),
|
|
14
|
+
code: new aws_cdk_lib_1.aws_lambda.AssetCode(layer.buildPath),
|
|
15
|
+
compatibleRuntimes: [aws_cdk_lib_1.aws_lambda.Runtime.NODEJS_18_X],
|
|
16
|
+
})
|
|
17
|
+
: aws_cdk_lib_1.aws_lambda.LayerVersion.fromLayerVersionArn(this, `${layer.name}-layer-ref`, layer.layerArn);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.LambdaLayers = LambdaLayers;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QpqConstructBlock, QpqConstructBlockProps } from '../base/QpqConstructBlock';
|
|
2
2
|
import { Construct } from 'constructs';
|
|
3
3
|
import { aws_apigateway } from 'aws-cdk-lib';
|
|
4
|
-
export interface SubdomainNameProps extends
|
|
4
|
+
export interface SubdomainNameProps extends QpqConstructBlockProps {
|
|
5
5
|
subdomain: string;
|
|
6
6
|
apexDomain: string;
|
|
7
7
|
}
|
|
8
|
-
export declare class SubdomainName extends
|
|
8
|
+
export declare class SubdomainName extends QpqConstructBlock {
|
|
9
9
|
readonly domainName: aws_apigateway.DomainName;
|
|
10
10
|
constructor(scope: Construct, id: string, props: SubdomainNameProps);
|
|
11
11
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SubdomainName = void 0;
|
|
4
|
-
const
|
|
4
|
+
const QpqConstructBlock_1 = require("../base/QpqConstructBlock");
|
|
5
5
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
6
|
-
class SubdomainName extends
|
|
6
|
+
class SubdomainName extends QpqConstructBlock_1.QpqConstructBlock {
|
|
7
7
|
constructor(scope, id, props) {
|
|
8
8
|
super(scope, id, props);
|
|
9
9
|
const newDomainName = `${props.subdomain}.${props.apexDomain}`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Function"), exports);
|
|
18
|
+
__exportStar(require("./LambdaLayers"), exports);
|
|
19
|
+
__exportStar(require("./SubdomainName"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./parameter"), exports);
|
|
18
|
+
__exportStar(require("./queue"), exports);
|
|
19
|
+
__exportStar(require("./schedule"), exports);
|
|
20
|
+
__exportStar(require("./secret"), exports);
|
|
21
|
+
__exportStar(require("./storageDrive"), exports);
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { ParameterQPQConfigSetting, QPQConfig } from 'quidproquo-core';
|
|
2
|
-
import {
|
|
3
|
-
import { QpqResource } from '
|
|
2
|
+
import { QpqConstructBlock, QpqConstructBlockProps } from '../../../base/QpqConstructBlock';
|
|
3
|
+
import { QpqResource } from '../../../base/QpqResource';
|
|
4
4
|
import { Construct } from 'constructs';
|
|
5
5
|
import { aws_ssm, aws_iam } from 'aws-cdk-lib';
|
|
6
|
-
export interface QpqCoreParameterConstructProps extends
|
|
6
|
+
export interface QpqCoreParameterConstructProps extends QpqConstructBlockProps {
|
|
7
|
+
parameterConfig: ParameterQPQConfigSetting;
|
|
7
8
|
}
|
|
8
|
-
export declare abstract class QpqCoreParameterConstructBase extends
|
|
9
|
+
export declare abstract class QpqCoreParameterConstructBase extends QpqConstructBlock {
|
|
9
10
|
abstract stringParameter: aws_ssm.IStringParameter;
|
|
10
|
-
grantRead(grantee: aws_iam.IGrantable):
|
|
11
|
-
grantWrite(grantee: aws_iam.IGrantable):
|
|
11
|
+
grantRead(grantee: aws_iam.IGrantable): void;
|
|
12
|
+
grantWrite(grantee: aws_iam.IGrantable): void;
|
|
12
13
|
grantAll(grantee: aws_iam.IGrantable): void;
|
|
13
14
|
}
|
|
14
15
|
export declare class QpqCoreParameterConstruct extends QpqCoreParameterConstructBase {
|
|
15
16
|
stringParameter: aws_ssm.IStringParameter;
|
|
16
|
-
static fromOtherStack(scope: Construct, id: string, qpqConfig: QPQConfig,
|
|
17
|
+
static fromOtherStack(scope: Construct, id: string, qpqConfig: QPQConfig, parameterConfig: ParameterQPQConfigSetting, awsAccountId: string): QpqResource;
|
|
17
18
|
constructor(scope: Construct, id: string, props: QpqCoreParameterConstructProps);
|
|
18
19
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QpqCoreParameterConstruct = exports.QpqCoreParameterConstructBase = void 0;
|
|
4
|
-
const
|
|
4
|
+
const QpqConstructBlock_1 = require("../../../base/QpqConstructBlock");
|
|
5
5
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
6
|
-
class QpqCoreParameterConstructBase extends
|
|
6
|
+
class QpqCoreParameterConstructBase extends QpqConstructBlock_1.QpqConstructBlock {
|
|
7
7
|
grantRead(grantee) {
|
|
8
|
-
|
|
8
|
+
this.stringParameter.grantRead(grantee);
|
|
9
9
|
}
|
|
10
10
|
grantWrite(grantee) {
|
|
11
|
-
|
|
11
|
+
this.stringParameter.grantWrite(grantee);
|
|
12
12
|
}
|
|
13
13
|
grantAll(grantee) {
|
|
14
14
|
this.grantRead(grantee);
|
|
@@ -17,21 +17,21 @@ class QpqCoreParameterConstructBase extends QpqConstruct_1.QpqConstruct {
|
|
|
17
17
|
}
|
|
18
18
|
exports.QpqCoreParameterConstructBase = QpqCoreParameterConstructBase;
|
|
19
19
|
class QpqCoreParameterConstruct extends QpqCoreParameterConstructBase {
|
|
20
|
-
static fromOtherStack(scope, id, qpqConfig,
|
|
20
|
+
static fromOtherStack(scope, id, qpqConfig, parameterConfig, awsAccountId) {
|
|
21
21
|
class Import extends QpqCoreParameterConstructBase {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments);
|
|
24
|
-
this.stringParameter = aws_cdk_lib_1.aws_ssm.StringParameter.fromStringParameterName(scope, `${id}-${
|
|
24
|
+
this.stringParameter = aws_cdk_lib_1.aws_ssm.StringParameter.fromStringParameterName(scope, `${id}-${parameterConfig.uniqueKey}`, this.resourceName(parameterConfig.key));
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
return new Import(scope, id, { qpqConfig,
|
|
27
|
+
return new Import(scope, id, { qpqConfig, awsAccountId });
|
|
28
28
|
}
|
|
29
29
|
constructor(scope, id, props) {
|
|
30
30
|
super(scope, id, props);
|
|
31
31
|
this.stringParameter = new aws_cdk_lib_1.aws_ssm.StringParameter(this, 'param', {
|
|
32
|
-
parameterName: this.resourceName(props.
|
|
33
|
-
description: props.
|
|
34
|
-
stringValue: props.
|
|
32
|
+
parameterName: this.resourceName(props.parameterConfig.key),
|
|
33
|
+
description: props.parameterConfig.key,
|
|
34
|
+
stringValue: props.parameterConfig.value,
|
|
35
35
|
// No additional costs ~ 4k max size
|
|
36
36
|
tier: aws_cdk_lib_1.aws_ssm.ParameterTier.STANDARD,
|
|
37
37
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './QpqCoreParameterConstruct';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./QpqCoreParameterConstruct"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { QueueQPQConfigSetting } from 'quidproquo-core';
|
|
2
|
+
import { QpqConstructBlock, QpqConstructBlockProps } from '../../../base/QpqConstructBlock';
|
|
3
|
+
import { Construct } from 'constructs';
|
|
4
|
+
import { aws_lambda } from 'aws-cdk-lib';
|
|
5
|
+
export interface QpqApiCoreQueueConstructProps extends QpqConstructBlockProps {
|
|
6
|
+
queueConfig: QueueQPQConfigSetting;
|
|
7
|
+
apiLayerVersions?: aws_lambda.ILayerVersion[];
|
|
8
|
+
}
|
|
9
|
+
export declare class QpqApiCoreQueueConstruct extends QpqConstructBlock {
|
|
10
|
+
constructor(scope: Construct, id: string, props: QpqApiCoreQueueConstructProps);
|
|
11
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.QpqApiCoreQueueConstruct = void 0;
|
|
27
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
28
|
+
const QpqConstructBlock_1 = require("../../../base/QpqConstructBlock");
|
|
29
|
+
const QpqCoreQueueConstruct_1 = require("./QpqCoreQueueConstruct");
|
|
30
|
+
const Function_1 = require("../../../basic/Function");
|
|
31
|
+
const qpqDeployAwsCdkUtils = __importStar(require("../../../../utils"));
|
|
32
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
33
|
+
const cdk = __importStar(require("aws-cdk-lib"));
|
|
34
|
+
class QpqApiCoreQueueConstruct extends QpqConstructBlock_1.QpqConstructBlock {
|
|
35
|
+
constructor(scope, id, props) {
|
|
36
|
+
super(scope, id, props);
|
|
37
|
+
const queueFunction = new Function_1.Function(this, props.queueConfig.uniqueKey, {
|
|
38
|
+
buildPath: quidproquo_core_1.qpqCoreUtils.getQueueEntryFullPath(props.qpqConfig, props.queueConfig),
|
|
39
|
+
functionName: this.resourceName(`${props.queueConfig.uniqueKey}-queue`),
|
|
40
|
+
functionType: 'lambdaSQSEvent',
|
|
41
|
+
executorName: 'executeSQSEvent',
|
|
42
|
+
qpqConfig: props.qpqConfig,
|
|
43
|
+
apiLayerVersions: props.apiLayerVersions,
|
|
44
|
+
awsAccountId: props.awsAccountId,
|
|
45
|
+
environment: {
|
|
46
|
+
queueQPQConfigSetting: JSON.stringify(props.queueConfig),
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
// TODO: Make this a utility function
|
|
50
|
+
const grantables = qpqDeployAwsCdkUtils.getQqpGrantableResources(this, 'grantable', this.qpqConfig, props.awsAccountId);
|
|
51
|
+
grantables.forEach((g) => {
|
|
52
|
+
g.grantAll(queueFunction.lambdaFunction);
|
|
53
|
+
});
|
|
54
|
+
// ///////// end todo
|
|
55
|
+
const queueResource = QpqCoreQueueConstruct_1.QpqCoreQueueConstruct.fromOtherStack(this, 'queue', props.qpqConfig, props.queueConfig, props.awsAccountId);
|
|
56
|
+
queueFunction.lambdaFunction.addEventSource(new aws_cdk_lib_1.aws_lambda_event_sources.SqsEventSource(queueResource.queue, {
|
|
57
|
+
batchSize: props.queueConfig.batchSize,
|
|
58
|
+
maxBatchingWindow: cdk.Duration.seconds(props.queueConfig.batchWindowInSeconds),
|
|
59
|
+
reportBatchItemFailures: true,
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.QpqApiCoreQueueConstruct = QpqApiCoreQueueConstruct;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { QueueQPQConfigSetting, QPQConfig } from 'quidproquo-core';
|
|
2
|
+
import { QpqConstructBlock, QpqConstructBlockProps } from '../../../base/QpqConstructBlock';
|
|
3
|
+
import { Construct } from 'constructs';
|
|
4
|
+
import { aws_sqs, aws_iam } from 'aws-cdk-lib';
|
|
5
|
+
export interface QpqCoreQueueConstructProps extends QpqConstructBlockProps {
|
|
6
|
+
queueConfig: QueueQPQConfigSetting;
|
|
7
|
+
}
|
|
8
|
+
export declare abstract class QpqCoreQueueConstructBase extends QpqConstructBlock {
|
|
9
|
+
abstract queue: aws_sqs.IQueue;
|
|
10
|
+
grantRead(grantee: aws_iam.IGrantable): aws_iam.Grant;
|
|
11
|
+
grantWrite(grantee: aws_iam.IGrantable): aws_iam.Grant;
|
|
12
|
+
grantAll(grantee: aws_iam.IGrantable): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class QpqCoreQueueConstruct extends QpqCoreQueueConstructBase {
|
|
15
|
+
queue: aws_sqs.IQueue;
|
|
16
|
+
static fromOtherStack(scope: Construct, id: string, qpqConfig: QPQConfig, queueConfig: QueueQPQConfigSetting, awsAccountId: string): QpqCoreQueueConstructBase;
|
|
17
|
+
constructor(scope: Construct, id: string, props: QpqCoreQueueConstructProps);
|
|
18
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.QpqCoreQueueConstruct = exports.QpqCoreQueueConstructBase = void 0;
|
|
27
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
28
|
+
const QpqConstructBlock_1 = require("../../../base/QpqConstructBlock");
|
|
29
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
30
|
+
const cdk = __importStar(require("aws-cdk-lib"));
|
|
31
|
+
class QpqCoreQueueConstructBase extends QpqConstructBlock_1.QpqConstructBlock {
|
|
32
|
+
grantRead(grantee) {
|
|
33
|
+
return this.queue.grant(grantee, 'sqs:GetQueueAttributes', 'sqs:GetQueueUrl', 'sqs:ListDeadLetterSourceQueues', 'sqs:ReceiveMessage', 'sqs:PeekMessage');
|
|
34
|
+
}
|
|
35
|
+
grantWrite(grantee) {
|
|
36
|
+
return this.queue.grant(grantee, 'sqs:SendMessage');
|
|
37
|
+
}
|
|
38
|
+
grantAll(grantee) {
|
|
39
|
+
this.grantRead(grantee);
|
|
40
|
+
this.grantWrite(grantee);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.QpqCoreQueueConstructBase = QpqCoreQueueConstructBase;
|
|
44
|
+
class QpqCoreQueueConstruct extends QpqCoreQueueConstructBase {
|
|
45
|
+
static fromOtherStack(scope, id, qpqConfig, queueConfig, awsAccountId) {
|
|
46
|
+
class Import extends QpqCoreQueueConstructBase {
|
|
47
|
+
constructor() {
|
|
48
|
+
super(...arguments);
|
|
49
|
+
this.queue = aws_cdk_lib_1.aws_sqs.Queue.fromQueueAttributes(scope, `${id}-${queueConfig.uniqueKey}`, {
|
|
50
|
+
queueArn: `arn:aws:sqs:${quidproquo_core_1.qpqCoreUtils.getApplicationModuleDeployRegion(qpqConfig)}:${awsAccountId}:${this.resourceName(queueConfig.name)}`,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return new Import(scope, id, { qpqConfig, awsAccountId });
|
|
55
|
+
}
|
|
56
|
+
constructor(scope, id, props) {
|
|
57
|
+
super(scope, id, props);
|
|
58
|
+
this.queue = new aws_cdk_lib_1.aws_sqs.Queue(this, 'MainQueue', {
|
|
59
|
+
queueName: this.resourceName(props.queueConfig.name),
|
|
60
|
+
visibilityTimeout: cdk.Duration.seconds(props.queueConfig.ttRetryInSeconds),
|
|
61
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
62
|
+
deadLetterQueue: {
|
|
63
|
+
maxReceiveCount: props.queueConfig.maxRetry,
|
|
64
|
+
queue: new aws_cdk_lib_1.aws_sqs.Queue(this, 'DeadLetterQueue', {
|
|
65
|
+
queueName: this.resourceName(`${props.queueConfig.name}-dead`),
|
|
66
|
+
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
67
|
+
}),
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.QpqCoreQueueConstruct = QpqCoreQueueConstruct;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./QpqCoreQueueConstruct"), exports);
|
|
18
|
+
__exportStar(require("./QpqApiCoreQueueConstruct"), exports);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ScheduleQPQConfigSetting } from 'quidproquo-core';
|
|
2
|
-
import {
|
|
2
|
+
import { QpqConstructBlock, QpqConstructBlockProps } from '../../../base/QpqConstructBlock';
|
|
3
3
|
import { Construct } from 'constructs';
|
|
4
|
-
|
|
4
|
+
import { aws_lambda } from 'aws-cdk-lib';
|
|
5
|
+
export interface QpqCoreRecurringScheduleConstructProps extends QpqConstructBlockProps {
|
|
6
|
+
scheduleConfig: ScheduleQPQConfigSetting;
|
|
7
|
+
apiLayerVersions?: aws_lambda.ILayerVersion[];
|
|
5
8
|
}
|
|
6
|
-
export declare class QpqCoreRecurringScheduleConstruct extends
|
|
9
|
+
export declare class QpqCoreRecurringScheduleConstruct extends QpqConstructBlock {
|
|
7
10
|
constructor(scope: Construct, id: string, props: QpqCoreRecurringScheduleConstructProps);
|
|
8
11
|
}
|
|
@@ -25,25 +25,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.QpqCoreRecurringScheduleConstruct = void 0;
|
|
27
27
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
28
|
-
const
|
|
28
|
+
const QpqConstructBlock_1 = require("../../../base/QpqConstructBlock");
|
|
29
29
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
30
|
-
const Function_1 = require("
|
|
31
|
-
const qpqDeployAwsCdkUtils = __importStar(require("
|
|
32
|
-
class QpqCoreRecurringScheduleConstruct extends
|
|
30
|
+
const Function_1 = require("../../../basic/Function");
|
|
31
|
+
const qpqDeployAwsCdkUtils = __importStar(require("../../../../utils"));
|
|
32
|
+
class QpqCoreRecurringScheduleConstruct extends QpqConstructBlock_1.QpqConstructBlock {
|
|
33
33
|
constructor(scope, id, props) {
|
|
34
34
|
super(scope, id, props);
|
|
35
|
-
const schedulerFunction = new Function_1.Function(this, props.
|
|
36
|
-
buildPath: quidproquo_core_1.qpqCoreUtils.getScheduleEntryFullPath(props.qpqConfig, props.
|
|
37
|
-
functionName: this.resourceName(`${props.
|
|
35
|
+
const schedulerFunction = new Function_1.Function(this, props.scheduleConfig.uniqueKey, {
|
|
36
|
+
buildPath: quidproquo_core_1.qpqCoreUtils.getScheduleEntryFullPath(props.qpqConfig, props.scheduleConfig),
|
|
37
|
+
functionName: this.resourceName(`${props.scheduleConfig.uniqueKey}-SE`),
|
|
38
38
|
functionType: 'lambdaEventBridgeEvent',
|
|
39
39
|
executorName: 'executeEventBridgeEvent',
|
|
40
40
|
qpqConfig: props.qpqConfig,
|
|
41
|
-
setting: props.setting,
|
|
42
41
|
apiLayerVersions: props.apiLayerVersions,
|
|
43
42
|
environment: {
|
|
44
43
|
lambdaRuntimeConfig: JSON.stringify({
|
|
45
|
-
src: props.
|
|
46
|
-
runtime: props.
|
|
44
|
+
src: props.scheduleConfig.src,
|
|
45
|
+
runtime: props.scheduleConfig.runtime,
|
|
47
46
|
}),
|
|
48
47
|
},
|
|
49
48
|
awsAccountId: props.awsAccountId,
|
|
@@ -56,7 +55,7 @@ class QpqCoreRecurringScheduleConstruct extends QpqConstruct_1.QpqConstruct {
|
|
|
56
55
|
// ///////// end todo
|
|
57
56
|
// EventBridge rule which runs every five minutes
|
|
58
57
|
const cronRule = new aws_cdk_lib_1.aws_events.Rule(this, 'cron', {
|
|
59
|
-
schedule: aws_cdk_lib_1.aws_events.Schedule.expression(`cron(${props.
|
|
58
|
+
schedule: aws_cdk_lib_1.aws_events.Schedule.expression(`cron(${props.scheduleConfig.cronExpression})`),
|
|
60
59
|
});
|
|
61
60
|
// Set the target as lambda function
|
|
62
61
|
cronRule.addTarget(new aws_cdk_lib_1.aws_events_targets.LambdaFunction(schedulerFunction.lambdaFunction));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './QpqCoreRecurringScheduleConstruct';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./QpqCoreRecurringScheduleConstruct"), exports);
|