quidproquo-deploy-awscdk 0.0.26 → 0.0.28
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.
|
@@ -29,16 +29,8 @@ const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
|
29
29
|
const cdk = __importStar(require("aws-cdk-lib"));
|
|
30
30
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
31
31
|
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
32
|
-
const DeploymentType_1 = require("./DeploymentType");
|
|
33
|
-
const getEnvironmentDomain = (stackProps) => {
|
|
34
|
-
const apexDomain = quidproquo_webserver_1.qpqWebServerUtils.getDomainName(stackProps.qpqConfig);
|
|
35
|
-
if (stackProps.environment === DeploymentType_1.DeploymentType.Prod) {
|
|
36
|
-
return apexDomain;
|
|
37
|
-
}
|
|
38
|
-
return `${stackProps.environment}.${apexDomain}`;
|
|
39
|
-
};
|
|
40
32
|
const createApiDomainName = (stack, id, stackProps) => {
|
|
41
|
-
const apexDomain =
|
|
33
|
+
const apexDomain = quidproquo_webserver_1.qpqWebServerUtils.getFeatureDomainName(stackProps.qpqConfig);
|
|
42
34
|
const apiDomainName = `api.${apexDomain}`;
|
|
43
35
|
const apexHostedZone = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(stack, `${id}-apex-hostedZone`, {
|
|
44
36
|
domainName: apexDomain,
|
|
@@ -62,11 +54,12 @@ const createApiDomainName = (stack, id, stackProps) => {
|
|
|
62
54
|
return domainName;
|
|
63
55
|
};
|
|
64
56
|
const createWebDistribution = (stack, id, stackProps) => {
|
|
65
|
-
const
|
|
57
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getAppFeature(stackProps.qpqConfig);
|
|
58
|
+
const apexDomain = quidproquo_webserver_1.qpqWebServerUtils.getFeatureDomainName(stackProps.qpqConfig);
|
|
66
59
|
const serviceName = quidproquo_core_1.qpqCoreUtils.getAppName(stackProps.qpqConfig);
|
|
67
60
|
// create an s3 bucket
|
|
68
61
|
const staticWebFilesBucket = new aws_cdk_lib_1.aws_s3.Bucket(stack, `${id}-web`, {
|
|
69
|
-
bucketName: `${serviceName}-${
|
|
62
|
+
bucketName: `${serviceName}-${environment}-web`,
|
|
70
63
|
// Disable public access to this bucket, CloudFront will do that
|
|
71
64
|
publicReadAccess: false,
|
|
72
65
|
blockPublicAccess: aws_cdk_lib_1.aws_s3.BlockPublicAccess.BLOCK_ALL,
|
|
@@ -152,7 +145,7 @@ class QPQPrototypeSingleServiceStack extends aws_cdk_lib_1.Stack {
|
|
|
152
145
|
},
|
|
153
146
|
});
|
|
154
147
|
const settings = {
|
|
155
|
-
environment: props.
|
|
148
|
+
environment: quidproquo_core_1.qpqCoreUtils.getAppFeature(props.qpqConfig),
|
|
156
149
|
service: quidproquo_core_1.qpqCoreUtils.getAppName(props.qpqConfig),
|
|
157
150
|
};
|
|
158
151
|
const domainName = createApiDomainName(this, id, props);
|
|
@@ -260,7 +253,7 @@ class QPQPrototypeSingleServiceStack extends aws_cdk_lib_1.Stack {
|
|
|
260
253
|
functionName: `SE-${index}-${se.runtime}-${settings.environment}-${settings.service}`,
|
|
261
254
|
entry: props.lambdaEventBridgeEventPath ||
|
|
262
255
|
path.resolve(__dirname, 'lambdas', 'lambdaEventBridgeEvent.js'),
|
|
263
|
-
handler: '
|
|
256
|
+
handler: 'executeEventBridgeEvent',
|
|
264
257
|
timeout: cdk.Duration.minutes(15),
|
|
265
258
|
runtime: aws_cdk_lib_1.aws_lambda.Runtime.NODEJS_16_X,
|
|
266
259
|
// layers: [BLLayer],
|
|
@@ -51,6 +51,7 @@ const getAPIGatewayEventExecutor = (getCustomActionProcessors = () => ({})) => {
|
|
|
51
51
|
const result = yield resolveStory(quidproquo_core_1.askProcessEvent, [event, context]);
|
|
52
52
|
// // Run the callback
|
|
53
53
|
if (!result.error) {
|
|
54
|
+
console.log(result.result);
|
|
54
55
|
return {
|
|
55
56
|
statusCode: result.result.statusCode,
|
|
56
57
|
body: JSON.stringify(result.result.body),
|
package/lib/utils.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.getStackName = void 0;
|
|
|
4
4
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
5
5
|
const getStackName = (deploymentSettings) => {
|
|
6
6
|
const appName = quidproquo_core_1.qpqCoreUtils.getAppName(deploymentSettings.qpqConfig);
|
|
7
|
-
|
|
7
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getAppFeature(deploymentSettings.qpqConfig);
|
|
8
|
+
return `${appName}-${environment}`;
|
|
8
9
|
};
|
|
9
10
|
exports.getStackName = getStackName;
|