quidproquo-deploy-awscdk 0.0.52 → 0.0.53
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/QpqCoreParameterConstruct.js +1 -1
- package/lib/constructs/QpqCoreRecurringScheduleConstruct.js +3 -3
- package/lib/constructs/QpqCoreSecretConstruct.js +1 -1
- package/lib/constructs/QpqCoreStorageDriveConstruct.js +1 -1
- package/lib/constructs/QpqWebserverApiConstruct.js +6 -6
- package/lib/constructs/QpqWebserverDomainConstruct.d.ts +1 -1
- package/lib/constructs/QpqWebserverDomainConstruct.js +60 -16
- package/lib/constructs/QpqWebserverSubdomainRedirectConstruct.js +5 -5
- package/lib/constructs/QpqWebserverWebEntryConstruct.js +12 -15
- package/lib/constructs/basic/Function.js +1 -1
- package/lib/constructs/basic/SubdomainName.js +5 -5
- package/lib/constructs/core/QPQServiceStack.d.ts +0 -2
- package/lib/constructs/core/QPQServiceStack.js +3 -11
- package/lib/constructs/core/QpqConstructBase.d.ts +2 -5
- package/lib/constructs/core/QpqConstructBase.js +5 -15
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/qpqDeployAwsCdkUtils.js +5 -2
- package/lib/utils.d.ts +1 -2
- package/lib/utils.js +13 -15
- package/package.json +1 -1
- package/src/constructs/QpqCoreParameterConstruct.ts +1 -1
- package/src/constructs/QpqCoreRecurringScheduleConstruct.ts +3 -3
- package/src/constructs/QpqCoreSecretConstruct.ts +1 -1
- package/src/constructs/QpqCoreStorageDriveConstruct.ts +1 -1
- package/src/constructs/QpqWebserverApiConstruct.ts +6 -6
- package/src/constructs/QpqWebserverDomainConstruct.ts +44 -21
- package/src/constructs/QpqWebserverSubdomainRedirectConstruct.ts +5 -5
- package/src/constructs/QpqWebserverWebEntryConstruct.ts +44 -52
- package/src/constructs/basic/Function.ts +1 -1
- package/src/constructs/basic/SubdomainName.ts +5 -5
- package/src/constructs/core/QPQServiceStack.ts +3 -14
- package/src/constructs/core/QpqConstructBase.ts +5 -17
- package/src/index.ts +1 -1
- package/src/qpqDeployAwsCdkUtils.ts +6 -2
- package/src/utils.ts +12 -17
- package/lib/QPQPrototypeSingleServiceStack.d.ts +0 -14
- package/lib/QPQPrototypeSingleServiceStack.js +0 -391
- package/src/QPQPrototypeSingleServiceStack.ts +0 -573
|
@@ -28,7 +28,7 @@ class QpqCoreParameterConstruct extends QpqCoreParameterConstructBase {
|
|
|
28
28
|
}
|
|
29
29
|
constructor(scope, id, props) {
|
|
30
30
|
super(scope, id, props);
|
|
31
|
-
this.stringParameter = new aws_cdk_lib_1.aws_ssm.StringParameter(this,
|
|
31
|
+
this.stringParameter = new aws_cdk_lib_1.aws_ssm.StringParameter(this, 'param', {
|
|
32
32
|
parameterName: this.resourceName(props.setting.key),
|
|
33
33
|
description: props.setting.key,
|
|
34
34
|
stringValue: props.setting.value,
|
|
@@ -32,7 +32,7 @@ const qpqDeployAwsCdkUtils = __importStar(require("../qpqDeployAwsCdkUtils"));
|
|
|
32
32
|
class QpqCoreRecurringScheduleConstruct extends QpqConstruct_1.QpqConstruct {
|
|
33
33
|
constructor(scope, id, props) {
|
|
34
34
|
super(scope, id, props);
|
|
35
|
-
const schedulerFunction = new Function_1.Function(this,
|
|
35
|
+
const schedulerFunction = new Function_1.Function(this, props.setting.uniqueKey, {
|
|
36
36
|
buildPath: quidproquo_core_1.qpqCoreUtils.getScheduleEntryFullPath(props.qpqConfig, props.setting),
|
|
37
37
|
functionName: this.resourceName(`${props.setting.uniqueKey}-SE`),
|
|
38
38
|
functionType: 'lambdaEventBridgeEvent',
|
|
@@ -48,13 +48,13 @@ class QpqCoreRecurringScheduleConstruct extends QpqConstruct_1.QpqConstruct {
|
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
50
|
// TODO: Make this a utility function
|
|
51
|
-
const grantables = qpqDeployAwsCdkUtils.getQqpGrantableResources(this,
|
|
51
|
+
const grantables = qpqDeployAwsCdkUtils.getQqpGrantableResources(this, 'grantable', this.qpqConfig);
|
|
52
52
|
grantables.forEach((g) => {
|
|
53
53
|
g.grantAll(schedulerFunction.lambdaFunction);
|
|
54
54
|
});
|
|
55
55
|
// ///////// end todo
|
|
56
56
|
// EventBridge rule which runs every five minutes
|
|
57
|
-
const cronRule = new aws_cdk_lib_1.aws_events.Rule(this,
|
|
57
|
+
const cronRule = new aws_cdk_lib_1.aws_events.Rule(this, 'cron', {
|
|
58
58
|
schedule: aws_cdk_lib_1.aws_events.Schedule.expression(`cron(${props.setting.cronExpression})`),
|
|
59
59
|
});
|
|
60
60
|
// Set the target as lambda function
|
|
@@ -52,7 +52,7 @@ class QpqCoreSecretConstruct extends QpqCoreSecretConstructBase {
|
|
|
52
52
|
}
|
|
53
53
|
constructor(scope, id, props) {
|
|
54
54
|
super(scope, id, props);
|
|
55
|
-
this.secret = new aws_cdk_lib_1.aws_secretsmanager.Secret(this,
|
|
55
|
+
this.secret = new aws_cdk_lib_1.aws_secretsmanager.Secret(this, 'secret', {
|
|
56
56
|
secretName: this.resourceName(props.setting.key),
|
|
57
57
|
removalPolicy: cdk.RemovalPolicy.DESTROY,
|
|
58
58
|
description: props.setting.key,
|
|
@@ -52,7 +52,7 @@ class QpqCoreStorageDriveConstruct extends QpqCoreStorageDriveConstructBase {
|
|
|
52
52
|
}
|
|
53
53
|
constructor(scope, id, props) {
|
|
54
54
|
super(scope, id, props);
|
|
55
|
-
this.bucket = new aws_cdk_lib_1.aws_s3.Bucket(this,
|
|
55
|
+
this.bucket = new aws_cdk_lib_1.aws_s3.Bucket(this, 'bucket', {
|
|
56
56
|
bucketName: this.resourceName(props.setting.storageDrive),
|
|
57
57
|
// Disable public access to this bucket, CloudFront will do that
|
|
58
58
|
publicReadAccess: false,
|
|
@@ -35,17 +35,17 @@ class QpqWebserverApiConstruct extends QpqConstruct_1.QpqConstruct {
|
|
|
35
35
|
super(scope, id, props);
|
|
36
36
|
// api.service.domain.com or api.domain.com
|
|
37
37
|
const apexDomain = props.setting.onRootDomain
|
|
38
|
-
? quidproquo_webserver_1.qpqWebServerUtils.
|
|
38
|
+
? quidproquo_webserver_1.qpqWebServerUtils.getBaseDomainName(props.qpqConfig)
|
|
39
39
|
: quidproquo_webserver_1.qpqWebServerUtils.getServiceDomainName(props.qpqConfig);
|
|
40
40
|
// Create subdomain
|
|
41
|
-
const subdomain = new SubdomainName_1.SubdomainName(this,
|
|
41
|
+
const subdomain = new SubdomainName_1.SubdomainName(this, 'subdomain', {
|
|
42
42
|
apexDomain,
|
|
43
43
|
subdomain: props.setting.apiSubdomain,
|
|
44
44
|
qpqConfig: props.qpqConfig,
|
|
45
45
|
setting: props.setting,
|
|
46
46
|
});
|
|
47
47
|
// Build Function
|
|
48
|
-
const func = new Function_1.Function(this,
|
|
48
|
+
const func = new Function_1.Function(this, 'api-function', {
|
|
49
49
|
buildPath: quidproquo_webserver_1.qpqWebServerUtils.getApiEntryFullPath(props.qpqConfig, props.setting),
|
|
50
50
|
functionName: this.resourceName(`${props.setting.apiName}-route`),
|
|
51
51
|
functionType: 'lambdaAPIGatewayEvent',
|
|
@@ -54,12 +54,12 @@ class QpqWebserverApiConstruct extends QpqConstruct_1.QpqConstruct {
|
|
|
54
54
|
setting: props.setting,
|
|
55
55
|
apiLayerVersions: props.apiLayerVersions,
|
|
56
56
|
});
|
|
57
|
-
const grantables = qpqDeployAwsCdkUtils.getQqpGrantableResources(this,
|
|
57
|
+
const grantables = qpqDeployAwsCdkUtils.getQqpGrantableResources(this, 'grantable', this.qpqConfig);
|
|
58
58
|
grantables.forEach((g) => {
|
|
59
59
|
g.grantAll(func.lambdaFunction);
|
|
60
60
|
});
|
|
61
61
|
// Create a rest api
|
|
62
|
-
const api = new aws_cdk_lib_1.aws_apigateway.LambdaRestApi(this,
|
|
62
|
+
const api = new aws_cdk_lib_1.aws_apigateway.LambdaRestApi(this, 'lambda-rest-api', {
|
|
63
63
|
restApiName: this.resourceName(`${props.setting.apiName}-rest-api`),
|
|
64
64
|
handler: func.lambdaFunction,
|
|
65
65
|
deployOptions: {
|
|
@@ -70,7 +70,7 @@ class QpqWebserverApiConstruct extends QpqConstruct_1.QpqConstruct {
|
|
|
70
70
|
proxy: true,
|
|
71
71
|
});
|
|
72
72
|
// Map all requests to this service to /serviceName/*
|
|
73
|
-
new aws_cdk_lib_1.aws_apigateway.BasePathMapping(this,
|
|
73
|
+
new aws_cdk_lib_1.aws_apigateway.BasePathMapping(this, 'rest-bpm', {
|
|
74
74
|
domainName: subdomain.domainName,
|
|
75
75
|
restApi: api,
|
|
76
76
|
// the properties below are optional
|
|
@@ -4,7 +4,7 @@ import { DnsQPQWebServerConfigSetting } from 'quidproquo-webserver';
|
|
|
4
4
|
import { QpqConstruct, QpqConstructProps } from './core/QpqConstruct';
|
|
5
5
|
export interface QpqWebserverDomainConstructProps extends QpqConstructProps<DnsQPQWebServerConfigSetting> {
|
|
6
6
|
}
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const getEnvironmentDomainName: (qpqConfig: QPQConfig, domain: string) => string;
|
|
8
8
|
export declare class QpqWebserverDomainConstruct extends QpqConstruct<DnsQPQWebServerConfigSetting> {
|
|
9
9
|
constructor(scope: Construct, id: string, props: QpqWebserverDomainConstructProps);
|
|
10
10
|
}
|
|
@@ -1,43 +1,87 @@
|
|
|
1
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
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QpqWebserverDomainConstruct = exports.
|
|
26
|
+
exports.QpqWebserverDomainConstruct = exports.getEnvironmentDomainName = void 0;
|
|
4
27
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
28
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
6
29
|
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
7
|
-
const
|
|
30
|
+
const qpqDeployAwsCdkUtils = __importStar(require("../qpqDeployAwsCdkUtils"));
|
|
8
31
|
const QpqConstruct_1 = require("./core/QpqConstruct");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
32
|
+
const getEnvironmentDomainName = (qpqConfig, domain) => {
|
|
33
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationEnvironment(qpqConfig);
|
|
34
|
+
if (environment === 'production') {
|
|
12
35
|
return domain;
|
|
13
36
|
}
|
|
14
|
-
return `${
|
|
37
|
+
return `${environment}.${domain}`;
|
|
15
38
|
};
|
|
16
|
-
exports.
|
|
39
|
+
exports.getEnvironmentDomainName = getEnvironmentDomainName;
|
|
17
40
|
class QpqWebserverDomainConstruct extends QpqConstruct_1.QpqConstruct {
|
|
18
41
|
constructor(scope, id, props) {
|
|
19
42
|
super(scope, id, props);
|
|
20
|
-
// Only create a shared hosted zone if we need to
|
|
21
|
-
if (!(0, qpqDeployAwsCdkUtils_1.serviceNeedsServiceHostedZone)(this.qpqConfig)) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
43
|
// example.com
|
|
25
44
|
// dev.example.com
|
|
26
|
-
const
|
|
45
|
+
const feature = quidproquo_core_1.qpqCoreUtils.getApplicationFeature(props.qpqConfig);
|
|
46
|
+
const environmentDomain = (0, exports.getEnvironmentDomainName)(props.qpqConfig, props.setting.dnsBase);
|
|
47
|
+
const featureDomainName = quidproquo_webserver_1.qpqWebServerUtils.getBaseDomainName(props.qpqConfig);
|
|
27
48
|
// The hosted zone already setup
|
|
28
|
-
|
|
29
|
-
|
|
49
|
+
// development.example.com
|
|
50
|
+
// staging.example.com
|
|
51
|
+
// example.com
|
|
52
|
+
let apexHostedZone = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(this, 'hosted-zone', {
|
|
53
|
+
domainName: feature ? featureDomainName : environmentDomain,
|
|
30
54
|
});
|
|
55
|
+
// const feature = qpqCoreUtils.getApplicationFeature(props.qpqConfig);
|
|
56
|
+
// if (feature) {
|
|
57
|
+
// const featureDomainName = qpqWebServerUtils.getBaseDomainName(props.qpqConfig);
|
|
58
|
+
// console.log('featureDomainName', featureDomainName);
|
|
59
|
+
// // Create the root hosted zone for our service
|
|
60
|
+
// const featureHostedZone = new aws_route53.HostedZone(this, 'feature-hosted-zone', {
|
|
61
|
+
// zoneName: featureDomainName,
|
|
62
|
+
// });
|
|
63
|
+
// // Add the new NS Records to the root hosted zone so subdomains can be resolved
|
|
64
|
+
// new aws_route53.NsRecord(this, 'feature-ns-records', {
|
|
65
|
+
// zone: apexHostedZone,
|
|
66
|
+
// recordName: featureDomainName,
|
|
67
|
+
// values: featureHostedZone.hostedZoneNameServers || [],
|
|
68
|
+
// });
|
|
69
|
+
// apexHostedZone = featureHostedZone;
|
|
70
|
+
// }
|
|
71
|
+
// Only create a shared hosted zone if we need to
|
|
72
|
+
if (!qpqDeployAwsCdkUtils.serviceNeedsServiceHostedZone(props.qpqConfig)) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
31
75
|
// Root domain name for our service
|
|
32
76
|
// search.example.com
|
|
33
77
|
// search.dev.example.com
|
|
34
78
|
const serviceDomainName = quidproquo_webserver_1.qpqWebServerUtils.getServiceDomainName(props.qpqConfig);
|
|
35
79
|
// Create the root hosted zone for our service
|
|
36
|
-
const serviceHostedZone = new aws_cdk_lib_1.aws_route53.HostedZone(this,
|
|
80
|
+
const serviceHostedZone = new aws_cdk_lib_1.aws_route53.HostedZone(this, 'service-hosted-zone', {
|
|
37
81
|
zoneName: serviceDomainName,
|
|
38
82
|
});
|
|
39
83
|
// Add the new NS Records to the root hosted zone so subdomains can be resolved
|
|
40
|
-
new aws_cdk_lib_1.aws_route53.NsRecord(this,
|
|
84
|
+
new aws_cdk_lib_1.aws_route53.NsRecord(this, 'service-ns-records', {
|
|
41
85
|
zone: apexHostedZone,
|
|
42
86
|
recordName: serviceDomainName,
|
|
43
87
|
values: serviceHostedZone.hostedZoneNameServers || [],
|
|
@@ -37,8 +37,8 @@ class QpqWebserverSubdomainRedirectConstruct extends QpqConstruct_1.QpqConstruct
|
|
|
37
37
|
constructor(scope, id, props) {
|
|
38
38
|
super(scope, id, props);
|
|
39
39
|
const buildPath = quidproquo_core_1.qpqCoreUtils.getBuildPath(props.qpqConfig);
|
|
40
|
-
const environment = quidproquo_core_1.qpqCoreUtils.
|
|
41
|
-
const redirectLambda = new aws_cdk_lib_1.aws_lambda.Function(this,
|
|
40
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationEnvironment(props.qpqConfig);
|
|
41
|
+
const redirectLambda = new aws_cdk_lib_1.aws_lambda.Function(this, 'lambda', {
|
|
42
42
|
functionName: this.resourceName(`redirect-${props.setting.subdomain}`),
|
|
43
43
|
timeout: cdk.Duration.seconds(25),
|
|
44
44
|
runtime: aws_cdk_lib_1.aws_lambda.Runtime.NODEJS_16_X,
|
|
@@ -50,7 +50,7 @@ class QpqWebserverSubdomainRedirectConstruct extends QpqConstruct_1.QpqConstruct
|
|
|
50
50
|
environment: JSON.stringify(environment),
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
|
-
const restApi = new aws_cdk_lib_1.aws_apigateway.LambdaRestApi(this,
|
|
53
|
+
const restApi = new aws_cdk_lib_1.aws_apigateway.LambdaRestApi(this, 'rest-api', {
|
|
54
54
|
restApiName: this.resourceName(`${props.setting.subdomain}-redirect`),
|
|
55
55
|
handler: redirectLambda,
|
|
56
56
|
deployOptions: {
|
|
@@ -60,14 +60,14 @@ class QpqWebserverSubdomainRedirectConstruct extends QpqConstruct_1.QpqConstruct
|
|
|
60
60
|
proxy: true,
|
|
61
61
|
});
|
|
62
62
|
// TODO: Fix this
|
|
63
|
-
const serviceDomainName = new SubdomainName_1.SubdomainName(this,
|
|
63
|
+
const serviceDomainName = new SubdomainName_1.SubdomainName(this, 'service-domain-name', {
|
|
64
64
|
subdomain: props.setting.subdomain,
|
|
65
65
|
apexDomain: '',
|
|
66
66
|
setting: props.setting,
|
|
67
67
|
qpqConfig: props.qpqConfig,
|
|
68
68
|
});
|
|
69
69
|
// Map all requests to this service to /serviceName/*
|
|
70
|
-
new aws_cdk_lib_1.aws_apigateway.BasePathMapping(this,
|
|
70
|
+
new aws_cdk_lib_1.aws_apigateway.BasePathMapping(this, 'base-path-mapping', {
|
|
71
71
|
domainName: serviceDomainName.domainName,
|
|
72
72
|
restApi: restApi,
|
|
73
73
|
// the properties below are optional
|
|
@@ -36,13 +36,12 @@ const qpqDeployAwsCdkUtils = __importStar(require("../qpqDeployAwsCdkUtils"));
|
|
|
36
36
|
class QpqWebserverWebEntryConstruct extends QpqConstruct_1.QpqConstruct {
|
|
37
37
|
constructor(scope, id, props) {
|
|
38
38
|
super(scope, id, props);
|
|
39
|
-
|
|
40
|
-
const apexDomain = quidproquo_webserver_1.qpqWebServerUtils.getFeatureDomainName(props.qpqConfig);
|
|
39
|
+
const apexDomain = quidproquo_webserver_1.qpqWebServerUtils.getBaseDomainName(props.qpqConfig);
|
|
41
40
|
const webEntryBuildPath = quidproquo_webserver_1.qpqWebServerUtils.getWebEntryFullPath(props.qpqConfig, props.setting);
|
|
42
41
|
const seoEntryBuildPath = quidproquo_webserver_1.qpqWebServerUtils.getWebEntrySeoFullPath(props.qpqConfig, props.setting);
|
|
43
42
|
// create an s3 bucket
|
|
44
|
-
const staticWebFilesBucket = new aws_cdk_lib_1.aws_s3.Bucket(this,
|
|
45
|
-
bucketName: this.
|
|
43
|
+
const staticWebFilesBucket = new aws_cdk_lib_1.aws_s3.Bucket(this, 'bucket', {
|
|
44
|
+
bucketName: this.qpqResourceName('web-files'),
|
|
46
45
|
// Disable public access to this bucket, CloudFront will do that
|
|
47
46
|
publicReadAccess: false,
|
|
48
47
|
blockPublicAccess: aws_cdk_lib_1.aws_s3.BlockPublicAccess.BLOCK_ALL,
|
|
@@ -53,17 +52,17 @@ class QpqWebserverWebEntryConstruct extends QpqConstruct_1.QpqConstruct {
|
|
|
53
52
|
autoDeleteObjects: true,
|
|
54
53
|
});
|
|
55
54
|
// Create OriginAccessIdentity for the bucket.
|
|
56
|
-
const websiteOAI = new aws_cdk_lib_1.aws_cloudfront.OriginAccessIdentity(this,
|
|
55
|
+
const websiteOAI = new aws_cdk_lib_1.aws_cloudfront.OriginAccessIdentity(this, 'website-oai');
|
|
57
56
|
staticWebFilesBucket.grantRead(websiteOAI);
|
|
58
57
|
// Grab the hosted zone we want to add
|
|
59
|
-
const serviceHostedZone = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(this,
|
|
58
|
+
const serviceHostedZone = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(this, 'hosted-zone', {
|
|
60
59
|
domainName: apexDomain,
|
|
61
60
|
});
|
|
62
61
|
// Create a certificate for the distribution - Seems to a bug where Route 53 records not cleaned up
|
|
63
62
|
// after removing the DNS Validated certificate see: https://github.com/aws/aws-cdk/issues/3333
|
|
64
63
|
// `switch over to using the Certificate with the new built-in (CloudFormation-based) DNS validation`
|
|
65
64
|
const validationCertificate = aws_cdk_lib_1.aws_certificatemanager.CertificateValidation.fromDns(serviceHostedZone);
|
|
66
|
-
const certificate = new aws_cdk_lib_1.aws_certificatemanager.DnsValidatedCertificate(this,
|
|
65
|
+
const certificate = new aws_cdk_lib_1.aws_certificatemanager.DnsValidatedCertificate(this, 'viewer-cert', {
|
|
67
66
|
hostedZone: serviceHostedZone,
|
|
68
67
|
domainName: apexDomain,
|
|
69
68
|
region: 'us-east-1',
|
|
@@ -72,23 +71,21 @@ class QpqWebserverWebEntryConstruct extends QpqConstruct_1.QpqConstruct {
|
|
|
72
71
|
const viewerCertificate = aws_cdk_lib_1.aws_cloudfront.ViewerCertificate.fromAcmCertificate(certificate, {
|
|
73
72
|
aliases: [apexDomain],
|
|
74
73
|
});
|
|
75
|
-
console.log('\n\n\n webEntryBuildPath: ', webEntryBuildPath, '\n\n\n');
|
|
76
|
-
console.log('\n\n\n this.childId: ', this.childId('deploy'), '\n\n\n');
|
|
77
74
|
// TODO: This with an option
|
|
78
|
-
new aws_cdk_lib_1.aws_s3_deployment.BucketDeployment(this,
|
|
75
|
+
new aws_cdk_lib_1.aws_s3_deployment.BucketDeployment(this, 'deploy', {
|
|
79
76
|
sources: [aws_cdk_lib_1.aws_s3_deployment.Source.asset(webEntryBuildPath)],
|
|
80
77
|
destinationBucket: staticWebFilesBucket,
|
|
81
78
|
});
|
|
82
|
-
const grantables = qpqDeployAwsCdkUtils.getQqpGrantableResources(this,
|
|
79
|
+
const grantables = qpqDeployAwsCdkUtils.getQqpGrantableResources(this, 'grantable', this.qpqConfig);
|
|
83
80
|
const cloudFrontBehaviors = quidproquo_webserver_1.qpqWebServerUtils.getAllSeo(props.qpqConfig).map((seo) => {
|
|
84
|
-
const edgeFunctionVR = new aws_cdk_lib_1.aws_cloudfront.experimental.EdgeFunction(this,
|
|
81
|
+
const edgeFunctionVR = new aws_cdk_lib_1.aws_cloudfront.experimental.EdgeFunction(this, `SEO-${seo.uniqueKey}-VR`, {
|
|
85
82
|
functionName: this.resourceName(`SEO-VR-${seo.uniqueKey}`),
|
|
86
83
|
timeout: cdk.Duration.seconds(5),
|
|
87
84
|
runtime: aws_cdk_lib_1.aws_lambda.Runtime.NODEJS_16_X,
|
|
88
85
|
code: aws_cdk_lib_1.aws_lambda.Code.fromAsset(path_1.default.join(seoEntryBuildPath, 'lambdaEventViewerRequest')),
|
|
89
86
|
handler: 'index.executeEventViewerRequest',
|
|
90
87
|
});
|
|
91
|
-
const edgeFunctionOR = new aws_cdk_lib_1.aws_cloudfront.experimental.EdgeFunction(this,
|
|
88
|
+
const edgeFunctionOR = new aws_cdk_lib_1.aws_cloudfront.experimental.EdgeFunction(this, `SEO-${seo.uniqueKey}-OR`, {
|
|
92
89
|
functionName: this.resourceName(`SEO-OR-${seo.uniqueKey}`),
|
|
93
90
|
timeout: cdk.Duration.seconds(30),
|
|
94
91
|
runtime: aws_cdk_lib_1.aws_lambda.Runtime.NODEJS_16_X,
|
|
@@ -126,7 +123,7 @@ class QpqWebserverWebEntryConstruct extends QpqConstruct_1.QpqConstruct {
|
|
|
126
123
|
// TODO: Somehow expose query strings: Note ~
|
|
127
124
|
// (Lambda@Edge only) To access the query string in an origin request or origin response function,
|
|
128
125
|
// your cache policy or origin request policy must be set to All for Query strings.
|
|
129
|
-
const distribution = new aws_cdk_lib_1.aws_cloudfront.CloudFrontWebDistribution(this,
|
|
126
|
+
const distribution = new aws_cdk_lib_1.aws_cloudfront.CloudFrontWebDistribution(this, 'cf-distribution', {
|
|
130
127
|
originConfigs: [
|
|
131
128
|
{
|
|
132
129
|
s3OriginSource: {
|
|
@@ -155,7 +152,7 @@ class QpqWebserverWebEntryConstruct extends QpqConstruct_1.QpqConstruct {
|
|
|
155
152
|
],
|
|
156
153
|
});
|
|
157
154
|
// Create a cdn link
|
|
158
|
-
new aws_cdk_lib_1.aws_route53.ARecord(this,
|
|
155
|
+
new aws_cdk_lib_1.aws_route53.ARecord(this, 'web-alias', {
|
|
159
156
|
zone: serviceHostedZone,
|
|
160
157
|
recordName: apexDomain,
|
|
161
158
|
target: aws_cdk_lib_1.aws_route53.RecordTarget.fromAlias(new aws_cdk_lib_1.aws_route53_targets.CloudFrontTarget(distribution)),
|
|
@@ -34,7 +34,7 @@ const cdk = __importStar(require("aws-cdk-lib"));
|
|
|
34
34
|
class Function extends QpqConstruct_1.QpqConstruct {
|
|
35
35
|
constructor(scope, id, props) {
|
|
36
36
|
super(scope, id, props);
|
|
37
|
-
this.lambdaFunction = new aws_cdk_lib_1.aws_lambda.Function(this,
|
|
37
|
+
this.lambdaFunction = new aws_cdk_lib_1.aws_lambda.Function(this, 'function', {
|
|
38
38
|
functionName: props.functionName,
|
|
39
39
|
timeout: cdk.Duration.seconds(props.timeoutInSeconds || 25),
|
|
40
40
|
runtime: aws_cdk_lib_1.aws_lambda.Runtime.NODEJS_16_X,
|
|
@@ -7,21 +7,21 @@ class SubdomainName extends QpqConstruct_1.QpqConstruct {
|
|
|
7
7
|
constructor(scope, id, props) {
|
|
8
8
|
super(scope, id, props);
|
|
9
9
|
const newDomainName = `${props.subdomain}.${props.apexDomain}`;
|
|
10
|
-
const apexHostedZone = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(this,
|
|
10
|
+
const apexHostedZone = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(this, 'hosted-zone', {
|
|
11
11
|
domainName: props.apexDomain,
|
|
12
12
|
});
|
|
13
|
-
const certificate = new aws_cdk_lib_1.aws_certificatemanager.Certificate(this,
|
|
13
|
+
const certificate = new aws_cdk_lib_1.aws_certificatemanager.Certificate(this, 'certificate', {
|
|
14
14
|
domainName: newDomainName,
|
|
15
|
-
certificateName: this.
|
|
15
|
+
certificateName: this.qpqResourceName(props.subdomain),
|
|
16
16
|
validation: aws_cdk_lib_1.aws_certificatemanager.CertificateValidation.fromDns(apexHostedZone),
|
|
17
17
|
});
|
|
18
|
-
this.domainName = new aws_cdk_lib_1.aws_apigateway.DomainName(this,
|
|
18
|
+
this.domainName = new aws_cdk_lib_1.aws_apigateway.DomainName(this, 'domain-name', {
|
|
19
19
|
domainName: newDomainName,
|
|
20
20
|
certificate,
|
|
21
21
|
securityPolicy: aws_cdk_lib_1.aws_apigateway.SecurityPolicy.TLS_1_2,
|
|
22
22
|
endpointType: aws_cdk_lib_1.aws_apigateway.EndpointType.REGIONAL,
|
|
23
23
|
});
|
|
24
|
-
new aws_cdk_lib_1.aws_route53.ARecord(this,
|
|
24
|
+
new aws_cdk_lib_1.aws_route53.ARecord(this, 'a-record', {
|
|
25
25
|
zone: apexHostedZone,
|
|
26
26
|
recordName: newDomainName,
|
|
27
27
|
target: aws_cdk_lib_1.aws_route53.RecordTarget.fromAlias(new aws_cdk_lib_1.aws_route53_targets.ApiGatewayDomain(this.domainName)),
|
|
@@ -13,7 +13,5 @@ export declare class QpqServiceStack extends Stack {
|
|
|
13
13
|
qpqConfig: QPQConfig;
|
|
14
14
|
apiLayerVersions?: aws_lambda.ILayerVersion[];
|
|
15
15
|
constructor(scope: Construct, id: string, { account, qpqConfig, apiLayers }: QpqServiceStackProps);
|
|
16
|
-
resourceName(name: string, maxLength?: number): string;
|
|
17
|
-
childId(uniqueName: string): string;
|
|
18
16
|
childProps(setting: QPQConfigSetting): QpqConstructProps<any>;
|
|
19
17
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.QpqServiceStack = void 0;
|
|
4
4
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
5
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
6
|
+
const quidproquo_actionprocessor_awslambda_1 = require("quidproquo-actionprocessor-awslambda");
|
|
6
7
|
class QpqServiceStack extends aws_cdk_lib_1.Stack {
|
|
7
8
|
constructor(scope, id, { account, qpqConfig, apiLayers }) {
|
|
8
9
|
super(scope, id, {
|
|
@@ -14,22 +15,13 @@ class QpqServiceStack extends aws_cdk_lib_1.Stack {
|
|
|
14
15
|
this.id = id;
|
|
15
16
|
this.qpqConfig = qpqConfig;
|
|
16
17
|
this.apiLayerVersions = (apiLayers || []).map((layer) => {
|
|
17
|
-
return new aws_cdk_lib_1.aws_lambda.LayerVersion(this,
|
|
18
|
-
layerVersionName:
|
|
18
|
+
return new aws_cdk_lib_1.aws_lambda.LayerVersion(this, `${layer.name}-layer`, {
|
|
19
|
+
layerVersionName: quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getQpqRuntimeResourceName(layer.name, qpqConfig),
|
|
19
20
|
code: new aws_cdk_lib_1.aws_lambda.AssetCode(layer.buildPath),
|
|
20
21
|
compatibleRuntimes: [aws_cdk_lib_1.aws_lambda.Runtime.NODEJS_16_X],
|
|
21
22
|
});
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
|
-
resourceName(name, maxLength = 60) {
|
|
25
|
-
const app = quidproquo_core_1.qpqCoreUtils.getAppName(this.qpqConfig);
|
|
26
|
-
const env = quidproquo_core_1.qpqCoreUtils.getAppFeature(this.qpqConfig);
|
|
27
|
-
return `${name}-${app}-${env}`;
|
|
28
|
-
}
|
|
29
|
-
childId(uniqueName) {
|
|
30
|
-
// return `${uniqueName}-${this.id}`;
|
|
31
|
-
return uniqueName;
|
|
32
|
-
}
|
|
33
25
|
childProps(setting) {
|
|
34
26
|
return {
|
|
35
27
|
qpqConfig: this.qpqConfig,
|
|
@@ -10,9 +10,6 @@ export declare class QpqConstructBase extends Construct {
|
|
|
10
10
|
qpqConfig: QPQConfig;
|
|
11
11
|
apiLayerVersions?: aws_lambda.ILayerVersion[];
|
|
12
12
|
constructor(scope: Construct, id: string, props: QpqConstructBaseProps);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
deploymentPrefix(): string;
|
|
16
|
-
resourceName(name: string, maxLength?: number): string;
|
|
17
|
-
childId(uniqueName: string): string;
|
|
13
|
+
resourceName(name: string): string;
|
|
14
|
+
qpqResourceName(name: string): string;
|
|
18
15
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QpqConstructBase = void 0;
|
|
4
4
|
const constructs_1 = require("constructs");
|
|
5
|
-
const
|
|
5
|
+
const quidproquo_actionprocessor_awslambda_1 = require("quidproquo-actionprocessor-awslambda");
|
|
6
6
|
class QpqConstructBase extends constructs_1.Construct {
|
|
7
7
|
constructor(scope, id, props) {
|
|
8
8
|
super(scope, id);
|
|
@@ -10,21 +10,11 @@ class QpqConstructBase extends constructs_1.Construct {
|
|
|
10
10
|
this.qpqConfig = props.qpqConfig;
|
|
11
11
|
this.apiLayerVersions = props.apiLayerVersions;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
return
|
|
13
|
+
resourceName(name) {
|
|
14
|
+
return quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getConfigRuntimeResourceName(name, this.qpqConfig);
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
return
|
|
18
|
-
}
|
|
19
|
-
deploymentPrefix() {
|
|
20
|
-
return `${this.service()}-${this.environment()}`;
|
|
21
|
-
}
|
|
22
|
-
resourceName(name, maxLength = 60) {
|
|
23
|
-
return `${name}-${this.service()}-${this.environment()}`;
|
|
24
|
-
}
|
|
25
|
-
childId(uniqueName) {
|
|
26
|
-
// return `${uniqueName}-${this.id}`;
|
|
27
|
-
return uniqueName;
|
|
16
|
+
qpqResourceName(name) {
|
|
17
|
+
return quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getQpqRuntimeResourceName(name, this.qpqConfig);
|
|
28
18
|
}
|
|
29
19
|
}
|
|
30
20
|
exports.QpqConstructBase = QpqConstructBase;
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from './utils';
|
|
|
2
2
|
export * from './DeploymentType';
|
|
3
3
|
export * from './DeploymentSettings';
|
|
4
4
|
export * from './QPQApp';
|
|
5
|
-
export * from './QPQPrototypeSingleServiceStack';
|
|
6
5
|
export * from './ApiQPQServiceStack';
|
|
7
6
|
export * from './InfrastructureQPQServiceStack';
|
|
8
7
|
export * from './WebQPQServiceStack';
|
package/lib/index.js
CHANGED
|
@@ -18,7 +18,6 @@ __exportStar(require("./utils"), exports);
|
|
|
18
18
|
__exportStar(require("./DeploymentType"), exports);
|
|
19
19
|
__exportStar(require("./DeploymentSettings"), exports);
|
|
20
20
|
__exportStar(require("./QPQApp"), exports);
|
|
21
|
-
__exportStar(require("./QPQPrototypeSingleServiceStack"), exports);
|
|
22
21
|
__exportStar(require("./ApiQPQServiceStack"), exports);
|
|
23
22
|
__exportStar(require("./InfrastructureQPQServiceStack"), exports);
|
|
24
23
|
__exportStar(require("./WebQPQServiceStack"), exports);
|
|
@@ -8,7 +8,7 @@ const QpqCoreSecretConstruct_1 = require("./constructs/QpqCoreSecretConstruct");
|
|
|
8
8
|
const QpqCoreStorageDriveConstruct_1 = require("./constructs/QpqCoreStorageDriveConstruct");
|
|
9
9
|
const getResourceName = (name, qpqConfig) => {
|
|
10
10
|
const service = quidproquo_core_1.qpqCoreUtils.getAppName(qpqConfig);
|
|
11
|
-
const environment = quidproquo_core_1.qpqCoreUtils.
|
|
11
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationEnvironment(qpqConfig);
|
|
12
12
|
return `${name}-${service}-${environment}`;
|
|
13
13
|
};
|
|
14
14
|
exports.getResourceName = getResourceName;
|
|
@@ -43,10 +43,13 @@ const getQqpStorageDriveGrantables = (scope, id, qpqConfig) => {
|
|
|
43
43
|
};
|
|
44
44
|
exports.getQqpStorageDriveGrantables = getQqpStorageDriveGrantables;
|
|
45
45
|
const serviceNeedsServiceHostedZone = (qpqConfig) => {
|
|
46
|
+
// We need it if we are deploying our api to a service domain
|
|
46
47
|
const apiConfigs = quidproquo_core_1.qpqCoreUtils
|
|
47
48
|
.getConfigSettings(qpqConfig, quidproquo_webserver_1.QPQWebServerConfigSettingType.Api)
|
|
48
49
|
.filter((config) => !config.onRootDomain);
|
|
49
|
-
|
|
50
|
+
// // Or if we are deploying to a feature env ~ like joecoady
|
|
51
|
+
// const hasFeatureName = !!qpqCoreUtils.getApplicationFeature(qpqConfig);
|
|
52
|
+
return apiConfigs.length > 0; // || hasFeatureName;
|
|
50
53
|
};
|
|
51
54
|
exports.serviceNeedsServiceHostedZone = serviceNeedsServiceHostedZone;
|
|
52
55
|
// Get resources that we can use to grant permissions to lambdas etc
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { QPQConfig } from 'quidproquo-core';
|
|
2
|
-
import { DeploymentSettings } from './DeploymentSettings';
|
|
3
2
|
import { QpqSettingConstructMap } from './QpqSettingConstructMap';
|
|
4
3
|
import { QpqServiceStack } from './constructs/core/QPQServiceStack';
|
|
5
|
-
export declare const
|
|
4
|
+
export declare const getBaseStackName: (qpqConfig: QPQConfig) => string;
|
|
6
5
|
export declare const getInfrastructureStackName: (qpqConfig: QPQConfig) => string;
|
|
7
6
|
export declare const getWebStackName: (qpqConfig: QPQConfig) => string;
|
|
8
7
|
export declare const getApiStackName: (qpqConfig: QPQConfig) => string;
|
package/lib/utils.js
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createConstructs = exports.getApiStackName = exports.getWebStackName = exports.getInfrastructureStackName = exports.
|
|
3
|
+
exports.createConstructs = exports.getApiStackName = exports.getWebStackName = exports.getInfrastructureStackName = exports.getBaseStackName = void 0;
|
|
4
4
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
5
|
-
const
|
|
6
|
-
const appName = quidproquo_core_1.qpqCoreUtils.getAppName(
|
|
7
|
-
const environment = quidproquo_core_1.qpqCoreUtils.
|
|
5
|
+
const getBaseStackName = (qpqConfig) => {
|
|
6
|
+
const appName = quidproquo_core_1.qpqCoreUtils.getAppName(qpqConfig);
|
|
7
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationEnvironment(qpqConfig);
|
|
8
|
+
const feature = quidproquo_core_1.qpqCoreUtils.getApplicationFeature(qpqConfig);
|
|
9
|
+
if (feature) {
|
|
10
|
+
return `${appName}-${environment}-${feature}`;
|
|
11
|
+
}
|
|
8
12
|
return `${appName}-${environment}`;
|
|
9
13
|
};
|
|
10
|
-
exports.
|
|
14
|
+
exports.getBaseStackName = getBaseStackName;
|
|
11
15
|
const getInfrastructureStackName = (qpqConfig) => {
|
|
12
|
-
|
|
13
|
-
const environment = quidproquo_core_1.qpqCoreUtils.getAppFeature(qpqConfig);
|
|
14
|
-
return `${appName}-${environment}-inf`;
|
|
16
|
+
return `${(0, exports.getBaseStackName)(qpqConfig)}-inf`;
|
|
15
17
|
};
|
|
16
18
|
exports.getInfrastructureStackName = getInfrastructureStackName;
|
|
17
19
|
const getWebStackName = (qpqConfig) => {
|
|
18
|
-
|
|
19
|
-
const environment = quidproquo_core_1.qpqCoreUtils.getAppFeature(qpqConfig);
|
|
20
|
-
return `${appName}-${environment}-web`;
|
|
20
|
+
return `${(0, exports.getBaseStackName)(qpqConfig)}-web`;
|
|
21
21
|
};
|
|
22
22
|
exports.getWebStackName = getWebStackName;
|
|
23
23
|
const getApiStackName = (qpqConfig) => {
|
|
24
|
-
|
|
25
|
-
const environment = quidproquo_core_1.qpqCoreUtils.getAppFeature(qpqConfig);
|
|
26
|
-
return `${appName}-${environment}-api`;
|
|
24
|
+
return `${(0, exports.getBaseStackName)(qpqConfig)}-api`;
|
|
27
25
|
};
|
|
28
26
|
exports.getApiStackName = getApiStackName;
|
|
29
27
|
const createConstructs = (owner, qpqConfig, settingsToCreate, qpqSettingConstructMap) => {
|
|
@@ -32,7 +30,7 @@ const createConstructs = (owner, qpqConfig, settingsToCreate, qpqSettingConstruc
|
|
|
32
30
|
if (settingsToCreate.indexOf(qpqCoreConfigSettingType) >= 0 &&
|
|
33
31
|
qpqSettingConstructMap[qpqCoreConfigSettingType]) {
|
|
34
32
|
const ConstructClass = qpqSettingConstructMap[qpqCoreConfigSettingType];
|
|
35
|
-
new ConstructClass(owner,
|
|
33
|
+
new ConstructClass(owner, quidproquo_core_1.qpqCoreUtils.getUniqueKeyForSetting(setting), owner.childProps(setting));
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
};
|
package/package.json
CHANGED
|
@@ -51,7 +51,7 @@ export class QpqCoreParameterConstruct extends QpqCoreParameterConstructBase {
|
|
|
51
51
|
constructor(scope: Construct, id: string, props: QpqCoreParameterConstructProps) {
|
|
52
52
|
super(scope, id, props);
|
|
53
53
|
|
|
54
|
-
this.stringParameter = new aws_ssm.StringParameter(this,
|
|
54
|
+
this.stringParameter = new aws_ssm.StringParameter(this, 'param', {
|
|
55
55
|
parameterName: this.resourceName(props.setting.key),
|
|
56
56
|
description: props.setting.key,
|
|
57
57
|
stringValue: props.setting.value,
|
|
@@ -15,7 +15,7 @@ export class QpqCoreRecurringScheduleConstruct extends QpqConstruct<ScheduleQPQC
|
|
|
15
15
|
constructor(scope: Construct, id: string, props: QpqCoreRecurringScheduleConstructProps) {
|
|
16
16
|
super(scope, id, props);
|
|
17
17
|
|
|
18
|
-
const schedulerFunction = new Function(this,
|
|
18
|
+
const schedulerFunction = new Function(this, props.setting.uniqueKey, {
|
|
19
19
|
buildPath: qpqCoreUtils.getScheduleEntryFullPath(props.qpqConfig, props.setting),
|
|
20
20
|
functionName: this.resourceName(`${props.setting.uniqueKey}-SE`),
|
|
21
21
|
functionType: 'lambdaEventBridgeEvent',
|
|
@@ -37,7 +37,7 @@ export class QpqCoreRecurringScheduleConstruct extends QpqConstruct<ScheduleQPQC
|
|
|
37
37
|
// TODO: Make this a utility function
|
|
38
38
|
const grantables = qpqDeployAwsCdkUtils.getQqpGrantableResources(
|
|
39
39
|
this,
|
|
40
|
-
|
|
40
|
+
'grantable',
|
|
41
41
|
this.qpqConfig,
|
|
42
42
|
);
|
|
43
43
|
|
|
@@ -47,7 +47,7 @@ export class QpqCoreRecurringScheduleConstruct extends QpqConstruct<ScheduleQPQC
|
|
|
47
47
|
// ///////// end todo
|
|
48
48
|
|
|
49
49
|
// EventBridge rule which runs every five minutes
|
|
50
|
-
const cronRule = new aws_events.Rule(this,
|
|
50
|
+
const cronRule = new aws_events.Rule(this, 'cron', {
|
|
51
51
|
schedule: aws_events.Schedule.expression(`cron(${props.setting.cronExpression})`),
|
|
52
52
|
});
|
|
53
53
|
|