@mettlecast/domain-cdk-packer 0.2.44 → 0.2.46
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/dist/DomainStack.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export interface DomainStackProps extends cdk.StackProps {
|
|
|
29
29
|
lambdaSg?: ec2.ISecurityGroup;
|
|
30
30
|
/** Shared HTTP API Gateway — when provided, domain routes are added here instead of creating a separate API. */
|
|
31
31
|
httpApi?: apigwv2.IHttpApi;
|
|
32
|
+
/** Path to domain source root � defaults to ../../domains/{domainId}. */
|
|
33
|
+
domainRoot?: string;
|
|
32
34
|
/** Enable CMK encryption for DynamoDB, S3, SQS. */
|
|
33
35
|
enableCmk?: boolean;
|
|
34
36
|
/** Enable WAF WebACL on the domain API Gateway. */
|
package/dist/DomainStack.js
CHANGED
|
@@ -57,6 +57,7 @@ export class DomainStack extends cdk.Stack {
|
|
|
57
57
|
super(scope, id, props);
|
|
58
58
|
const { registry, eventBusArn, eventBusName, databaseUrl, dbSecretArn, userPoolArn, userPoolId, userPoolClientId, vpc, lambdaSg, httpApi, enableCmk, enableWaf, enableAlarms, alarmSnsTopicArn, enableCanaryDeploy, reservedConcurrency, logRetentionDays, corsAllowedOrigins, allowCredentials } = props;
|
|
59
59
|
const domainId = registry.domain.id;
|
|
60
|
+
const domainRoot = props.domainRoot ?? "../../domains/" + domainId;
|
|
60
61
|
const vpcProps = vpc ? { vpc, securityGroups: lambdaSg ? [lambdaSg] : undefined } : {};
|
|
61
62
|
const allowedOrigins = corsAllowedOrigins ?? ['*'];
|
|
62
63
|
this.httpApi = httpApi ?? new apigwv2.HttpApi(this, 'HttpApi', {
|
|
@@ -161,6 +162,7 @@ export class DomainStack extends cdk.Stack {
|
|
|
161
162
|
environment,
|
|
162
163
|
eventBusArn,
|
|
163
164
|
dedicated: true,
|
|
165
|
+
domainRoot,
|
|
164
166
|
reservedConcurrency,
|
|
165
167
|
logRetentionDays: logRetentionDays ?? 30,
|
|
166
168
|
...vpcProps,
|
|
@@ -4,7 +4,6 @@ import * as logs from 'aws-cdk-lib/aws-logs';
|
|
|
4
4
|
import * as cdk from 'aws-cdk-lib';
|
|
5
5
|
import { writeFileSync, mkdirSync } from 'fs';
|
|
6
6
|
import { join } from 'path';
|
|
7
|
-
import { tmpdir } from 'os';
|
|
8
7
|
function camelCase(str) {
|
|
9
8
|
return str.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
10
9
|
}
|
|
@@ -43,7 +42,7 @@ function generateDedicatedEntry(domainRoot, entry, primitiveType) {
|
|
|
43
42
|
].join('\n');
|
|
44
43
|
}
|
|
45
44
|
function writeTempEntry(content) {
|
|
46
|
-
const dir = join(
|
|
45
|
+
const dir = join('.tib', 'entries', `${Date.now()}-${Math.random().toString(36).slice(2)}`);
|
|
47
46
|
mkdirSync(dir, { recursive: true });
|
|
48
47
|
const filePath = join(dir, 'entry.ts');
|
|
49
48
|
writeFileSync(filePath, content, 'utf8');
|