quidproquo-deploy-awscdk 0.1.1 → 0.1.2

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.
@@ -59,9 +59,7 @@ class Function extends QpqConstructBlock_1.QpqConstructBlock {
59
59
  code: aws_cdk_lib_1.aws_lambda.Code.fromAsset((0, upath_1.join)(utils_1.qpqAwsCdkPathUtils.getApiBuildPathFullPath(props.qpqConfig), props.functionType)),
60
60
  handler: `${handlerFile}.${props.executorName}`,
61
61
  environment: Object.assign({ AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1' }, (props.environment || {})),
62
- reservedConcurrentExecutions: quidproquo_config_aws_2.qpqConfigAwsUtils.isReservedConcurrencyDisabled(props.qpqConfig)
63
- ? undefined
64
- : props.reservedConcurrentExecutions,
62
+ reservedConcurrentExecutions: quidproquo_config_aws_2.qpqConfigAwsUtils.isReservedConcurrencyDisabled(props.qpqConfig) ? undefined : props.reservedConcurrentExecutions,
65
63
  tracing: quidproquo_config_aws_2.qpqConfigAwsUtils.isTracingDisabled(props.qpqConfig) ? aws_cdk_lib_1.aws_lambda.Tracing.DISABLED : aws_cdk_lib_1.aws_lambda.Tracing.ACTIVE,
66
64
  logGroup: new aws_cdk_lib_1.aws_logs.LogGroup(this, 'LogGroup', {
67
65
  retention: aws_cdk_lib_1.aws_logs.RetentionDays.ONE_YEAR,
@@ -12,9 +12,7 @@ class QpqApiCoreStorageDriveConstruct extends QpqConstructBlock_1.QpqConstructBl
12
12
  super(scope, id, props);
13
13
  // Event handlers live on the owner's API stack only. Skipping foreign drives
14
14
  // avoids attaching a bucket notification to another service's bucket
15
- const isOwnedHere = quidproquo_core_1.qpqCoreUtils
16
- .getOwnedStorageDrives(props.qpqConfig)
17
- .some((d) => d.uniqueKey === props.storageDriveConfig.uniqueKey);
15
+ const isOwnedHere = quidproquo_core_1.qpqCoreUtils.getOwnedStorageDrives(props.qpqConfig).some((d) => d.uniqueKey === props.storageDriveConfig.uniqueKey);
18
16
  if (!isOwnedHere) {
19
17
  return;
20
18
  }
@@ -108,12 +108,7 @@ class QpqCoreStorageDriveConstruct extends QpqCoreStorageDriveConstructBase {
108
108
  cors: [
109
109
  {
110
110
  allowedOrigins: (_a = props.corsAllowedOrigins) !== null && _a !== void 0 ? _a : ['*'],
111
- allowedMethods: [
112
- aws_cdk_lib_1.aws_s3.HttpMethods.GET,
113
- aws_cdk_lib_1.aws_s3.HttpMethods.HEAD,
114
- aws_cdk_lib_1.aws_s3.HttpMethods.PUT,
115
- aws_cdk_lib_1.aws_s3.HttpMethods.POST,
116
- ],
111
+ allowedMethods: [aws_cdk_lib_1.aws_s3.HttpMethods.GET, aws_cdk_lib_1.aws_s3.HttpMethods.HEAD, aws_cdk_lib_1.aws_s3.HttpMethods.PUT, aws_cdk_lib_1.aws_s3.HttpMethods.POST],
117
112
  allowedHeaders: ['*'],
118
113
  exposedHeaders: ['ETag'],
119
114
  },
@@ -87,9 +87,7 @@ class WebQpqWebserverWebEntryConstruct extends QpqConstructBlock_1.QpqConstructB
87
87
  const hostedZone = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(this, 'apex-zone', {
88
88
  domainName: apexDomain,
89
89
  });
90
- const domainNames = props.webEntryConfig.domain.subDomainName
91
- ? [`${props.webEntryConfig.domain.subDomainName}.${apexDomain}`]
92
- : [];
90
+ const domainNames = props.webEntryConfig.domain.subDomainName ? [`${props.webEntryConfig.domain.subDomainName}.${apexDomain}`] : [];
93
91
  if (props.webEntryConfig.domain.onRootDomain && domainNames.length === 0) {
94
92
  domainNames.unshift(apexDomain);
95
93
  }
@@ -26,9 +26,7 @@ export class Function extends QpqConstructBlock {
26
26
  AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1',
27
27
  ...(props.environment || {}),
28
28
  },
29
- reservedConcurrentExecutions: qpqConfigAwsUtils.isReservedConcurrencyDisabled(props.qpqConfig)
30
- ? undefined
31
- : props.reservedConcurrentExecutions,
29
+ reservedConcurrentExecutions: qpqConfigAwsUtils.isReservedConcurrencyDisabled(props.qpqConfig) ? undefined : props.reservedConcurrentExecutions,
32
30
  tracing: qpqConfigAwsUtils.isTracingDisabled(props.qpqConfig) ? aws_lambda.Tracing.DISABLED : aws_lambda.Tracing.ACTIVE,
33
31
  logGroup: new aws_logs.LogGroup(this, 'LogGroup', {
34
32
  retention: aws_logs.RetentionDays.ONE_YEAR,
@@ -8,9 +8,7 @@ export class QpqApiCoreStorageDriveConstruct extends QpqConstructBlock {
8
8
  super(scope, id, props);
9
9
  // Event handlers live on the owner's API stack only. Skipping foreign drives
10
10
  // avoids attaching a bucket notification to another service's bucket
11
- const isOwnedHere = qpqCoreUtils
12
- .getOwnedStorageDrives(props.qpqConfig)
13
- .some((d) => d.uniqueKey === props.storageDriveConfig.uniqueKey);
11
+ const isOwnedHere = qpqCoreUtils.getOwnedStorageDrives(props.qpqConfig).some((d) => d.uniqueKey === props.storageDriveConfig.uniqueKey);
14
12
  if (!isOwnedHere) {
15
13
  return;
16
14
  }
@@ -65,12 +65,7 @@ export class QpqCoreStorageDriveConstruct extends QpqCoreStorageDriveConstructBa
65
65
  cors: [
66
66
  {
67
67
  allowedOrigins: props.corsAllowedOrigins ?? ['*'],
68
- allowedMethods: [
69
- aws_s3.HttpMethods.GET,
70
- aws_s3.HttpMethods.HEAD,
71
- aws_s3.HttpMethods.PUT,
72
- aws_s3.HttpMethods.POST,
73
- ],
68
+ allowedMethods: [aws_s3.HttpMethods.GET, aws_s3.HttpMethods.HEAD, aws_s3.HttpMethods.PUT, aws_s3.HttpMethods.POST],
74
69
  allowedHeaders: ['*'],
75
70
  exposedHeaders: ['ETag'],
76
71
  },
@@ -1,6 +1,6 @@
1
1
  import { awsNamingUtils } from 'quidproquo-actionprocessor-awslambda';
2
2
  import { qpqWebServerUtils } from 'quidproquo-webserver';
3
- import { aws_cloudfront, aws_cloudfront_origins, aws_lambda, aws_route53, aws_route53_targets, aws_s3, aws_s3_deployment, } from 'aws-cdk-lib';
3
+ import { aws_cloudfront, aws_cloudfront_origins, aws_lambda, aws_route53, aws_route53_targets, aws_s3, aws_s3_deployment } from 'aws-cdk-lib';
4
4
  import * as cdk from 'aws-cdk-lib';
5
5
  import path from 'path';
6
6
  import * as qpqDeployAwsCdkUtils from '../../../../utils';
@@ -48,9 +48,7 @@ export class WebQpqWebserverWebEntryConstruct extends QpqConstructBlock {
48
48
  const hostedZone = aws_route53.HostedZone.fromLookup(this, 'apex-zone', {
49
49
  domainName: apexDomain,
50
50
  });
51
- const domainNames = props.webEntryConfig.domain.subDomainName
52
- ? [`${props.webEntryConfig.domain.subDomainName}.${apexDomain}`]
53
- : [];
51
+ const domainNames = props.webEntryConfig.domain.subDomainName ? [`${props.webEntryConfig.domain.subDomainName}.${apexDomain}`] : [];
54
52
  if (props.webEntryConfig.domain.onRootDomain && domainNames.length === 0) {
55
53
  domainNames.unshift(apexDomain);
56
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-deploy-awscdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -38,11 +38,11 @@
38
38
  "constructs": "^10.4.2",
39
39
  "esbuild": "^0.25.8",
40
40
  "liquidjs": "^10.7.0",
41
- "quidproquo-actionprocessor-awslambda": "0.1.1",
42
- "quidproquo-actionprocessor-node": "0.1.1",
43
- "quidproquo-config-aws": "0.1.1",
44
- "quidproquo-core": "0.1.1",
45
- "quidproquo-webserver": "0.1.1",
41
+ "quidproquo-actionprocessor-awslambda": "0.1.2",
42
+ "quidproquo-actionprocessor-node": "0.1.2",
43
+ "quidproquo-config-aws": "0.1.2",
44
+ "quidproquo-core": "0.1.2",
45
+ "quidproquo-webserver": "0.1.2",
46
46
  "upath": "^2.0.1"
47
47
  },
48
48
  "devDependencies": {
@@ -50,7 +50,7 @@
50
50
  "@types/babel__traverse": "7.18.2",
51
51
  "@types/node": "^22.13.13",
52
52
  "@types/prettier": "2.6.0",
53
- "quidproquo-tsconfig": "0.1.1",
53
+ "quidproquo-tsconfig": "0.1.2",
54
54
  "typescript": "^5.8.2"
55
55
  }
56
56
  }
@@ -65,9 +65,7 @@ export class Function extends QpqConstructBlock {
65
65
  ...(props.environment || {}),
66
66
  },
67
67
 
68
- reservedConcurrentExecutions: qpqConfigAwsUtils.isReservedConcurrencyDisabled(props.qpqConfig)
69
- ? undefined
70
- : props.reservedConcurrentExecutions,
68
+ reservedConcurrentExecutions: qpqConfigAwsUtils.isReservedConcurrencyDisabled(props.qpqConfig) ? undefined : props.reservedConcurrentExecutions,
71
69
 
72
70
  tracing: qpqConfigAwsUtils.isTracingDisabled(props.qpqConfig) ? aws_lambda.Tracing.DISABLED : aws_lambda.Tracing.ACTIVE,
73
71
 
@@ -88,13 +88,13 @@ export class QpqCoreEventBusConstruct extends QpqCoreEventBusConstructBase {
88
88
  qpqConfigAwsUtils
89
89
  .getEventBusQuickSubscriptions(props.qpqConfig, props.eventBusConfig.name, props.eventBusConfig.owner)
90
90
  .forEach((subscription) => {
91
- if (subscription.type === EventBusQuickSubscriptionType.email) {
92
- this.topic.addSubscription(new aws_sns_subscriptions.EmailSubscription(subscription.email));
93
- } else {
94
- // UrlSubscription infers http vs https from the url prefix.
95
- this.topic.addSubscription(new aws_sns_subscriptions.UrlSubscription(subscription.url));
96
- }
97
- });
91
+ if (subscription.type === EventBusQuickSubscriptionType.email) {
92
+ this.topic.addSubscription(new aws_sns_subscriptions.EmailSubscription(subscription.email));
93
+ } else {
94
+ // UrlSubscription infers http vs https from the url prefix.
95
+ this.topic.addSubscription(new aws_sns_subscriptions.UrlSubscription(subscription.url));
96
+ }
97
+ });
98
98
 
99
99
  // TODO: remove this, its deprecated
100
100
  const exportName = awsNamingUtils.getCFExportNameSnsTopicArnFromConfig(props.eventBusConfig.name, props.qpqConfig);
@@ -18,9 +18,7 @@ export class QpqApiCoreStorageDriveConstruct extends QpqConstructBlock {
18
18
 
19
19
  // Event handlers live on the owner's API stack only. Skipping foreign drives
20
20
  // avoids attaching a bucket notification to another service's bucket
21
- const isOwnedHere = qpqCoreUtils
22
- .getOwnedStorageDrives(props.qpqConfig)
23
- .some((d) => d.uniqueKey === props.storageDriveConfig.uniqueKey);
21
+ const isOwnedHere = qpqCoreUtils.getOwnedStorageDrives(props.qpqConfig).some((d) => d.uniqueKey === props.storageDriveConfig.uniqueKey);
24
22
 
25
23
  if (!isOwnedHere) {
26
24
  return;
@@ -101,12 +101,7 @@ export class QpqCoreStorageDriveConstruct extends QpqCoreStorageDriveConstructBa
101
101
  cors: [
102
102
  {
103
103
  allowedOrigins: props.corsAllowedOrigins ?? ['*'],
104
- allowedMethods: [
105
- aws_s3.HttpMethods.GET,
106
- aws_s3.HttpMethods.HEAD,
107
- aws_s3.HttpMethods.PUT,
108
- aws_s3.HttpMethods.POST,
109
- ],
104
+ allowedMethods: [aws_s3.HttpMethods.GET, aws_s3.HttpMethods.HEAD, aws_s3.HttpMethods.PUT, aws_s3.HttpMethods.POST],
110
105
  allowedHeaders: ['*'],
111
106
  exposedHeaders: ['ETag'],
112
107
  },
@@ -43,9 +43,7 @@ export class WebQpqWebserverDomainProxyConstruct extends QpqConstructBlock {
43
43
  domainName: apexDomain,
44
44
  });
45
45
 
46
- const domainNames: string[] = (props.domainProxyConfig.domain.subDomainNames ?? []).map(
47
- (subDomain) => `${subDomain}.${apexDomain}`,
48
- );
46
+ const domainNames: string[] = (props.domainProxyConfig.domain.subDomainNames ?? []).map((subDomain) => `${subDomain}.${apexDomain}`);
49
47
  if (props.domainProxyConfig.domain.onRootDomain && domainNames.length === 0) {
50
48
  domainNames.unshift(apexDomain);
51
49
  }
@@ -1,15 +1,7 @@
1
1
  import { awsNamingUtils } from 'quidproquo-actionprocessor-awslambda';
2
2
  import { qpqWebServerUtils, WebEntryQPQWebServerConfigSetting } from 'quidproquo-webserver';
3
3
 
4
- import {
5
- aws_cloudfront,
6
- aws_cloudfront_origins,
7
- aws_lambda,
8
- aws_route53,
9
- aws_route53_targets,
10
- aws_s3,
11
- aws_s3_deployment,
12
- } from 'aws-cdk-lib';
4
+ import { aws_cloudfront, aws_cloudfront_origins, aws_lambda, aws_route53, aws_route53_targets, aws_s3, aws_s3_deployment } from 'aws-cdk-lib';
13
5
  import * as cdk from 'aws-cdk-lib';
14
6
  import { Construct } from 'constructs';
15
7
  import path from 'path';
@@ -77,9 +69,7 @@ export class WebQpqWebserverWebEntryConstruct extends QpqConstructBlock {
77
69
  domainName: apexDomain,
78
70
  });
79
71
 
80
- const domainNames: string[] = props.webEntryConfig.domain.subDomainName
81
- ? [`${props.webEntryConfig.domain.subDomainName}.${apexDomain}`]
82
- : [];
72
+ const domainNames: string[] = props.webEntryConfig.domain.subDomainName ? [`${props.webEntryConfig.domain.subDomainName}.${apexDomain}`] : [];
83
73
  if (props.webEntryConfig.domain.onRootDomain && domainNames.length === 0) {
84
74
  domainNames.unshift(apexDomain);
85
75
  }
@@ -117,7 +107,10 @@ export class WebQpqWebserverWebEntryConstruct extends QpqConstructBlock {
117
107
  accessControlAllowCredentials: false,
118
108
  accessControlAllowHeaders: ['Origin', 'Access-Control-Request-Headers', 'Access-Control-Request-Method'],
119
109
  accessControlAllowMethods: ['GET', 'HEAD', 'OPTIONS'],
120
- accessControlAllowOrigins: qpqWebServerUtils.resolveServiceScopedCorsAllowedOrigins(props.qpqConfig, props.webEntryConfig.corsAllowedOrigins),
110
+ accessControlAllowOrigins: qpqWebServerUtils.resolveServiceScopedCorsAllowedOrigins(
111
+ props.qpqConfig,
112
+ props.webEntryConfig.corsAllowedOrigins,
113
+ ),
121
114
  accessControlExposeHeaders: ['*'],
122
115
  accessControlMaxAge: cdk.Duration.seconds(600),
123
116
  originOverride: true,
package/src/index.test.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { describe, expect,it } from 'vitest'
1
+ import { describe, expect, it } from 'vitest';
2
2
 
3
3
  describe('quidproquo-deploy-awscdk', () => {
4
4
  it('should pass smoke test', () => {
5
- expect(1 + 1).toBe(2)
6
- })
7
- })
5
+ expect(1 + 1).toBe(2);
6
+ });
7
+ });
@@ -44,11 +44,7 @@ const mergeConfigsByRegionAndDomain = (configs: DomainCertificateQPQConfigSettin
44
44
  * user has to do. Exposed here as an escape hatch for advanced setups that want to manage the
45
45
  * cert stack siblings themselves.
46
46
  */
47
- export const createDomainCertificateStacks = (
48
- scope: Construct,
49
- qpqConfig: QPQConfig,
50
- idPrefix: string,
51
- ): DomainCertificateStack[] => {
47
+ export const createDomainCertificateStacks = (scope: Construct, qpqConfig: QPQConfig, idPrefix: string): DomainCertificateStack[] => {
52
48
  const configs = mergeConfigsByRegionAndDomain(qpqConfigAwsUtils.getDomainCertificateConfigs(qpqConfig));
53
49
 
54
50
  return configs.map((certificateConfig) => {