@openhi/constructs 0.0.116 → 0.0.118
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/{chunk-X5MHU7DA.mjs → chunk-I7IIPV5X.mjs} +25 -5
- package/lib/chunk-I7IIPV5X.mjs.map +1 -0
- package/lib/data-store-postgres-replication.handler.js +24 -4
- package/lib/data-store-postgres-replication.handler.js.map +1 -1
- package/lib/data-store-postgres-replication.handler.mjs +1 -1
- package/lib/firehose-archive-transform.handler.js +24 -4
- package/lib/firehose-archive-transform.handler.js.map +1 -1
- package/lib/firehose-archive-transform.handler.mjs +1 -1
- package/lib/index.d.mts +77 -22
- package/lib/index.d.ts +77 -22
- package/lib/index.js +131 -83
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +136 -88
- package/lib/index.mjs.map +1 -1
- package/package.json +3 -3
- package/lib/chunk-X5MHU7DA.mjs.map +0 -1
package/lib/index.js
CHANGED
|
@@ -1127,6 +1127,16 @@ var OpenHiService = class extends import_aws_cdk_lib4.Stack {
|
|
|
1127
1127
|
),
|
|
1128
1128
|
6
|
|
1129
1129
|
);
|
|
1130
|
+
const releaseBranchHash = (0, import_utils.hashString)(
|
|
1131
|
+
[
|
|
1132
|
+
appName,
|
|
1133
|
+
ohEnv.deploymentTargetRole,
|
|
1134
|
+
account,
|
|
1135
|
+
region,
|
|
1136
|
+
defaultReleaseBranch
|
|
1137
|
+
].join("-"),
|
|
1138
|
+
6
|
|
1139
|
+
);
|
|
1130
1140
|
const stackHash = (0, import_utils.hashString)(
|
|
1131
1141
|
[
|
|
1132
1142
|
appName,
|
|
@@ -1157,6 +1167,7 @@ var OpenHiService = class extends import_aws_cdk_lib4.Stack {
|
|
|
1157
1167
|
this.branchName = branchName;
|
|
1158
1168
|
this.environmentHash = environmentHash;
|
|
1159
1169
|
this.branchHash = branchHash;
|
|
1170
|
+
this.releaseBranchHash = releaseBranchHash;
|
|
1160
1171
|
this.stackHash = stackHash;
|
|
1161
1172
|
this.node.setContext(
|
|
1162
1173
|
`availability-zones:account=${account}:region=${region}`,
|
|
@@ -2022,7 +2033,9 @@ var WorkflowDedupConsumerNameInvalidError = class extends Error {
|
|
|
2022
2033
|
};
|
|
2023
2034
|
|
|
2024
2035
|
// src/components/event-bridge/data-event-bus.ts
|
|
2036
|
+
var import_aws_cdk_lib8 = require("aws-cdk-lib");
|
|
2025
2037
|
var import_aws_events = require("aws-cdk-lib/aws-events");
|
|
2038
|
+
var DEFAULT_ARCHIVE_RETENTION = import_aws_cdk_lib8.Duration.days(7);
|
|
2026
2039
|
var DataEventBus = class _DataEventBus extends import_aws_events.EventBus {
|
|
2027
2040
|
/*****************************************************************************
|
|
2028
2041
|
*
|
|
@@ -2035,11 +2048,19 @@ var DataEventBus = class _DataEventBus extends import_aws_events.EventBus {
|
|
|
2035
2048
|
const stack = OpenHiService.of(scope);
|
|
2036
2049
|
return `datav1${stack.branchHash}`;
|
|
2037
2050
|
}
|
|
2038
|
-
constructor(scope, props) {
|
|
2051
|
+
constructor(scope, props = void 0) {
|
|
2052
|
+
const { archiveRetention, ...busProps } = props ?? {};
|
|
2039
2053
|
super(scope, "data-event-bus-v1", {
|
|
2040
|
-
...
|
|
2054
|
+
...busProps,
|
|
2041
2055
|
eventBusName: _DataEventBus.getEventBusName(scope)
|
|
2042
2056
|
});
|
|
2057
|
+
this.replayArchive = new import_aws_events.Archive(this, "Archive", {
|
|
2058
|
+
sourceEventBus: this,
|
|
2059
|
+
archiveName: `${_DataEventBus.getEventBusName(scope)}-archive`,
|
|
2060
|
+
description: "Replay archive for the OpenHI data event bus (data-store change notifications).",
|
|
2061
|
+
eventPattern: { account: [import_aws_cdk_lib8.Stack.of(this).account] },
|
|
2062
|
+
retention: archiveRetention ?? DEFAULT_ARCHIVE_RETENTION
|
|
2063
|
+
});
|
|
2043
2064
|
}
|
|
2044
2065
|
};
|
|
2045
2066
|
|
|
@@ -2090,7 +2111,7 @@ var ControlEventBus = class _ControlEventBus extends import_aws_events3.EventBus
|
|
|
2090
2111
|
// src/components/postgres/data-store-postgres-replica.ts
|
|
2091
2112
|
var import_node_fs5 = __toESM(require("fs"));
|
|
2092
2113
|
var import_node_path5 = __toESM(require("path"));
|
|
2093
|
-
var
|
|
2114
|
+
var import_aws_cdk_lib9 = require("aws-cdk-lib");
|
|
2094
2115
|
var ec2 = __toESM(require("aws-cdk-lib/aws-ec2"));
|
|
2095
2116
|
var import_aws_lambda5 = require("aws-cdk-lib/aws-lambda");
|
|
2096
2117
|
var import_aws_lambda_event_sources = require("aws-cdk-lib/aws-lambda-event-sources");
|
|
@@ -2156,7 +2177,7 @@ var DataStorePostgresReplica = class extends import_constructs6.Construct {
|
|
|
2156
2177
|
super(scope, id);
|
|
2157
2178
|
this.databaseName = props.databaseName ?? DEFAULT_DATABASE_NAME;
|
|
2158
2179
|
this.schemaName = getPostgresReplicaSchemaName(props.branchHash);
|
|
2159
|
-
const region =
|
|
2180
|
+
const region = import_aws_cdk_lib9.Stack.of(this).region;
|
|
2160
2181
|
this.vpc = props.vpc ?? new ec2.Vpc(this, "Vpc", {
|
|
2161
2182
|
availabilityZones: [`${region}a`, `${region}b`],
|
|
2162
2183
|
natGateways: 0,
|
|
@@ -2192,7 +2213,7 @@ var DataStorePostgresReplica = class extends import_constructs6.Construct {
|
|
|
2192
2213
|
entry: resolveHandlerEntry5(__dirname),
|
|
2193
2214
|
runtime: import_aws_lambda5.Runtime.NODEJS_LATEST,
|
|
2194
2215
|
memorySize: 512,
|
|
2195
|
-
timeout:
|
|
2216
|
+
timeout: import_aws_cdk_lib9.Duration.minutes(1),
|
|
2196
2217
|
vpc: this.vpc,
|
|
2197
2218
|
vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_ISOLATED },
|
|
2198
2219
|
description: "Replicates DynamoDB current-resource changes into the Postgres `resources` JSONB table (ADR 2026-04-17-01).",
|
|
@@ -2219,7 +2240,7 @@ var DataStorePostgresReplica = class extends import_constructs6.Construct {
|
|
|
2219
2240
|
new import_aws_lambda_event_sources.KinesisEventSource(props.kinesisStream, {
|
|
2220
2241
|
startingPosition: import_aws_lambda5.StartingPosition.LATEST,
|
|
2221
2242
|
batchSize: 100,
|
|
2222
|
-
maxBatchingWindow:
|
|
2243
|
+
maxBatchingWindow: import_aws_cdk_lib9.Duration.seconds(5),
|
|
2223
2244
|
retryAttempts: 10,
|
|
2224
2245
|
bisectBatchOnError: true,
|
|
2225
2246
|
parallelizationFactor: 2,
|
|
@@ -2252,7 +2273,7 @@ var DataStorePostgresReplica = class extends import_constructs6.Construct {
|
|
|
2252
2273
|
};
|
|
2253
2274
|
|
|
2254
2275
|
// src/components/route-53/child-hosted-zone.ts
|
|
2255
|
-
var
|
|
2276
|
+
var import_aws_cdk_lib10 = require("aws-cdk-lib");
|
|
2256
2277
|
var import_aws_route53 = require("aws-cdk-lib/aws-route53");
|
|
2257
2278
|
var ChildHostedZone = class extends import_aws_route53.HostedZone {
|
|
2258
2279
|
constructor(scope, id, props) {
|
|
@@ -2261,7 +2282,7 @@ var ChildHostedZone = class extends import_aws_route53.HostedZone {
|
|
|
2261
2282
|
zone: props.parentHostedZone,
|
|
2262
2283
|
recordName: this.zoneName,
|
|
2263
2284
|
values: this.hostedZoneNameServers || [],
|
|
2264
|
-
ttl:
|
|
2285
|
+
ttl: import_aws_cdk_lib10.Duration.minutes(5)
|
|
2265
2286
|
});
|
|
2266
2287
|
}
|
|
2267
2288
|
};
|
|
@@ -2276,15 +2297,36 @@ var RootHostedZone = class extends import_constructs7.Construct {
|
|
|
2276
2297
|
};
|
|
2277
2298
|
|
|
2278
2299
|
// src/components/static-hosting/static-content.ts
|
|
2279
|
-
var import_aws_s32 = require("aws-cdk-lib/aws-s3");
|
|
2280
2300
|
var import_aws_s3_deployment = require("aws-cdk-lib/aws-s3-deployment");
|
|
2281
2301
|
var import_change_case2 = require("change-case");
|
|
2282
|
-
var
|
|
2302
|
+
var import_constructs8 = require("constructs");
|
|
2303
|
+
var StaticContent = class extends import_constructs8.Construct {
|
|
2304
|
+
constructor(scope, id, props) {
|
|
2305
|
+
super(scope, id);
|
|
2306
|
+
const stack = OpenHiService.of(scope);
|
|
2307
|
+
const {
|
|
2308
|
+
bucket,
|
|
2309
|
+
contentSourceDirectory,
|
|
2310
|
+
contentDestinationDirectory = "/",
|
|
2311
|
+
subDomain = stack.branchName,
|
|
2312
|
+
fullDomain
|
|
2313
|
+
} = props;
|
|
2314
|
+
const keyPrefix = [(0, import_change_case2.paramCase)(subDomain), fullDomain].join(".");
|
|
2315
|
+
const isTestEnv = process.env.JEST_WORKER_ID !== void 0;
|
|
2316
|
+
const sources = isTestEnv ? [] : [import_aws_s3_deployment.Source.asset(contentSourceDirectory)];
|
|
2317
|
+
new import_aws_s3_deployment.BucketDeployment(this, "deploy", {
|
|
2318
|
+
sources,
|
|
2319
|
+
destinationBucket: bucket,
|
|
2320
|
+
retainOnDelete: false,
|
|
2321
|
+
destinationKeyPrefix: `${keyPrefix}${contentDestinationDirectory}`
|
|
2322
|
+
});
|
|
2323
|
+
}
|
|
2324
|
+
};
|
|
2283
2325
|
|
|
2284
2326
|
// src/components/static-hosting/static-hosting.ts
|
|
2285
2327
|
var fs6 = __toESM(require("fs"));
|
|
2286
2328
|
var path6 = __toESM(require("path"));
|
|
2287
|
-
var
|
|
2329
|
+
var import_aws_cdk_lib11 = require("aws-cdk-lib");
|
|
2288
2330
|
var import_aws_cloudfront = require("aws-cdk-lib/aws-cloudfront");
|
|
2289
2331
|
var import_aws_cloudfront_origins = require("aws-cdk-lib/aws-cloudfront-origins");
|
|
2290
2332
|
var import_aws_lambda6 = require("aws-cdk-lib/aws-lambda");
|
|
@@ -2293,9 +2335,9 @@ var import_aws_logs = require("aws-cdk-lib/aws-logs");
|
|
|
2293
2335
|
var import_aws_route532 = require("aws-cdk-lib/aws-route53");
|
|
2294
2336
|
var import_aws_route53_targets = require("aws-cdk-lib/aws-route53-targets");
|
|
2295
2337
|
var import_aws_s3 = require("aws-cdk-lib/aws-s3");
|
|
2296
|
-
var
|
|
2338
|
+
var import_constructs9 = require("constructs");
|
|
2297
2339
|
var STATIC_HOSTING_SERVICE_TYPE = "website";
|
|
2298
|
-
var _StaticHosting = class _StaticHosting extends
|
|
2340
|
+
var _StaticHosting = class _StaticHosting extends import_constructs9.Construct {
|
|
2299
2341
|
constructor(scope, id, props = {}) {
|
|
2300
2342
|
super(scope, id);
|
|
2301
2343
|
const stack = OpenHiService.of(scope);
|
|
@@ -2335,9 +2377,9 @@ var _StaticHosting = class _StaticHosting extends import_constructs8.Construct {
|
|
|
2335
2377
|
const cachePolicy = new import_aws_cloudfront.CachePolicy(this, "cache-policy", {
|
|
2336
2378
|
cachePolicyName: `static-hosting-${stack.branchHash}`,
|
|
2337
2379
|
comment: "Static hosting default: 60s default / 300s max, gzip+brotli.",
|
|
2338
|
-
defaultTtl:
|
|
2339
|
-
minTtl:
|
|
2340
|
-
maxTtl:
|
|
2380
|
+
defaultTtl: import_aws_cdk_lib11.Duration.seconds(60),
|
|
2381
|
+
minTtl: import_aws_cdk_lib11.Duration.seconds(0),
|
|
2382
|
+
maxTtl: import_aws_cdk_lib11.Duration.seconds(300),
|
|
2341
2383
|
headerBehavior: import_aws_cloudfront.CacheHeaderBehavior.none(),
|
|
2342
2384
|
queryStringBehavior: import_aws_cloudfront.CacheQueryStringBehavior.none(),
|
|
2343
2385
|
cookieBehavior: import_aws_cloudfront.CacheCookieBehavior.none(),
|
|
@@ -2431,35 +2473,6 @@ _StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_DOMAIN = "STATIC_HOSTING_DISTRIBUTION
|
|
|
2431
2473
|
_StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_ID = "STATIC_HOSTING_DISTRIBUTION_ID";
|
|
2432
2474
|
var StaticHosting = _StaticHosting;
|
|
2433
2475
|
|
|
2434
|
-
// src/components/static-hosting/static-content.ts
|
|
2435
|
-
var StaticContent = class extends import_constructs9.Construct {
|
|
2436
|
-
constructor(scope, id, props) {
|
|
2437
|
-
super(scope, id);
|
|
2438
|
-
const stack = OpenHiService.of(scope);
|
|
2439
|
-
const {
|
|
2440
|
-
contentSourceDirectory,
|
|
2441
|
-
contentDestinationDirectory = "/",
|
|
2442
|
-
subDomain = stack.branchName,
|
|
2443
|
-
fullDomain,
|
|
2444
|
-
serviceType = STATIC_HOSTING_SERVICE_TYPE
|
|
2445
|
-
} = props;
|
|
2446
|
-
const keyPrefix = [(0, import_change_case2.paramCase)(subDomain), fullDomain].join(".");
|
|
2447
|
-
const bucketArn = DiscoverableStringParameter.valueForLookupName(this, {
|
|
2448
|
-
ssmParamName: StaticHosting.SSM_PARAM_NAME_BUCKET_ARN,
|
|
2449
|
-
serviceType
|
|
2450
|
-
});
|
|
2451
|
-
const bucket = import_aws_s32.Bucket.fromBucketArn(this, "bucket", bucketArn);
|
|
2452
|
-
const isTestEnv = process.env.JEST_WORKER_ID !== void 0;
|
|
2453
|
-
const sources = isTestEnv ? [] : [import_aws_s3_deployment.Source.asset(contentSourceDirectory)];
|
|
2454
|
-
new import_aws_s3_deployment.BucketDeployment(this, "deploy", {
|
|
2455
|
-
sources,
|
|
2456
|
-
destinationBucket: bucket,
|
|
2457
|
-
retainOnDelete: false,
|
|
2458
|
-
destinationKeyPrefix: `${keyPrefix}${contentDestinationDirectory}`
|
|
2459
|
-
});
|
|
2460
|
-
}
|
|
2461
|
-
};
|
|
2462
|
-
|
|
2463
2476
|
// src/services/open-hi-auth-service.ts
|
|
2464
2477
|
var import_aws_cognito4 = require("aws-cdk-lib/aws-cognito");
|
|
2465
2478
|
var import_aws_iam6 = require("aws-cdk-lib/aws-iam");
|
|
@@ -2492,7 +2505,7 @@ var import_constructs11 = require("constructs");
|
|
|
2492
2505
|
// src/workflows/control-plane/platform-deploy-bridge/platform-deploy-bridge-lambda.ts
|
|
2493
2506
|
var import_node_fs6 = __toESM(require("fs"));
|
|
2494
2507
|
var import_node_path6 = __toESM(require("path"));
|
|
2495
|
-
var
|
|
2508
|
+
var import_aws_cdk_lib12 = require("aws-cdk-lib");
|
|
2496
2509
|
var import_aws_events4 = require("aws-cdk-lib/aws-events");
|
|
2497
2510
|
var import_aws_events_targets = require("aws-cdk-lib/aws-events-targets");
|
|
2498
2511
|
var import_aws_iam2 = require("aws-cdk-lib/aws-iam");
|
|
@@ -2516,15 +2529,15 @@ var PlatformDeployBridgeLambda = class extends import_constructs10.Construct {
|
|
|
2516
2529
|
OPENHI_TAG_SUFFIX_REPO_NAME
|
|
2517
2530
|
);
|
|
2518
2531
|
const tagKeyPrefix = `${service.appName}:`;
|
|
2519
|
-
const ownStackName =
|
|
2520
|
-
const ownSuffix = `-${service.serviceId}-${
|
|
2532
|
+
const ownStackName = import_aws_cdk_lib12.Stack.of(this).stackName;
|
|
2533
|
+
const ownSuffix = `-${service.serviceId}-${import_aws_cdk_lib12.Stack.of(this).account}-${import_aws_cdk_lib12.Stack.of(this).region}`;
|
|
2521
2534
|
const sharedPrefix = ownStackName.endsWith(ownSuffix) ? ownStackName.slice(0, -ownSuffix.length) : service.branchHash;
|
|
2522
|
-
const stackIdPrefix = `arn:aws:cloudformation:${
|
|
2535
|
+
const stackIdPrefix = `arn:aws:cloudformation:${import_aws_cdk_lib12.Stack.of(this).region}:${import_aws_cdk_lib12.Stack.of(this).account}:stack/${sharedPrefix}-`;
|
|
2523
2536
|
this.lambda = new import_aws_lambda_nodejs7.NodejsFunction(this, "handler", {
|
|
2524
2537
|
entry: resolveHandlerEntry6(__dirname),
|
|
2525
2538
|
runtime: import_aws_lambda7.Runtime.NODEJS_LATEST,
|
|
2526
2539
|
memorySize: 256,
|
|
2527
|
-
timeout:
|
|
2540
|
+
timeout: import_aws_cdk_lib12.Duration.seconds(30),
|
|
2528
2541
|
environment: {
|
|
2529
2542
|
[CONTROL_EVENT_BUS_NAME_ENV_VAR]: props.controlEventBus.eventBusName,
|
|
2530
2543
|
[OPENHI_REPO_TAG_KEY_ENV_VAR]: repoTagKey,
|
|
@@ -2536,7 +2549,7 @@ var PlatformDeployBridgeLambda = class extends import_constructs10.Construct {
|
|
|
2536
2549
|
effect: import_aws_iam2.Effect.ALLOW,
|
|
2537
2550
|
actions: ["cloudformation:DescribeStacks"],
|
|
2538
2551
|
resources: [
|
|
2539
|
-
`arn:aws:cloudformation:${
|
|
2552
|
+
`arn:aws:cloudformation:${import_aws_cdk_lib12.Stack.of(this).region}:${import_aws_cdk_lib12.Stack.of(this).account}:stack/*`
|
|
2540
2553
|
]
|
|
2541
2554
|
})
|
|
2542
2555
|
);
|
|
@@ -2555,7 +2568,7 @@ var PlatformDeployBridgeLambda = class extends import_constructs10.Construct {
|
|
|
2555
2568
|
targets: [
|
|
2556
2569
|
new import_aws_events_targets.LambdaFunction(this.lambda, {
|
|
2557
2570
|
retryAttempts: 2,
|
|
2558
|
-
maxEventAge:
|
|
2571
|
+
maxEventAge: import_aws_cdk_lib12.Duration.hours(2)
|
|
2559
2572
|
})
|
|
2560
2573
|
]
|
|
2561
2574
|
});
|
|
@@ -3268,7 +3281,7 @@ _validateFixturesAgainstTenantSpecs();
|
|
|
3268
3281
|
// src/workflows/control-plane/seed-demo-data/seed-demo-data-lambda.ts
|
|
3269
3282
|
var import_node_fs7 = __toESM(require("fs"));
|
|
3270
3283
|
var import_node_path7 = __toESM(require("path"));
|
|
3271
|
-
var
|
|
3284
|
+
var import_aws_cdk_lib13 = require("aws-cdk-lib");
|
|
3272
3285
|
var import_aws_events6 = require("aws-cdk-lib/aws-events");
|
|
3273
3286
|
var import_aws_events_targets2 = require("aws-cdk-lib/aws-events-targets");
|
|
3274
3287
|
var import_aws_iam3 = require("aws-cdk-lib/aws-iam");
|
|
@@ -6162,7 +6175,7 @@ var SeedDemoDataLambda = class extends import_constructs12.Construct {
|
|
|
6162
6175
|
entry: resolveHandlerEntry7(__dirname),
|
|
6163
6176
|
runtime: import_aws_lambda8.Runtime.NODEJS_LATEST,
|
|
6164
6177
|
memorySize: 512,
|
|
6165
|
-
timeout:
|
|
6178
|
+
timeout: import_aws_cdk_lib13.Duration.minutes(2),
|
|
6166
6179
|
environment: {
|
|
6167
6180
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName,
|
|
6168
6181
|
[SEED_DEMO_DATA_USER_POOL_ID_ENV_VAR]: props.userPool.userPoolId
|
|
@@ -6191,7 +6204,7 @@ var SeedDemoDataLambda = class extends import_constructs12.Construct {
|
|
|
6191
6204
|
"cognito-idp:AdminSetUserPassword"
|
|
6192
6205
|
],
|
|
6193
6206
|
resources: [
|
|
6194
|
-
|
|
6207
|
+
import_aws_cdk_lib13.Stack.of(this).formatArn({
|
|
6195
6208
|
service: "cognito-idp",
|
|
6196
6209
|
resource: "userpool",
|
|
6197
6210
|
resourceName: props.userPool.userPoolId
|
|
@@ -6208,7 +6221,7 @@ var SeedDemoDataLambda = class extends import_constructs12.Construct {
|
|
|
6208
6221
|
targets: [
|
|
6209
6222
|
new import_aws_events_targets2.LambdaFunction(this.lambda, {
|
|
6210
6223
|
retryAttempts: 2,
|
|
6211
|
-
maxEventAge:
|
|
6224
|
+
maxEventAge: import_aws_cdk_lib13.Duration.hours(2)
|
|
6212
6225
|
})
|
|
6213
6226
|
]
|
|
6214
6227
|
});
|
|
@@ -6243,7 +6256,7 @@ var SEED_SYSTEM_DATA_CONTROL_BUS_ENV_VAR = "CONTROL_EVENT_BUS_NAME";
|
|
|
6243
6256
|
var import_node_fs8 = __toESM(require("fs"));
|
|
6244
6257
|
var import_node_path8 = __toESM(require("path"));
|
|
6245
6258
|
var import_types13 = require("@openhi/types");
|
|
6246
|
-
var
|
|
6259
|
+
var import_aws_cdk_lib14 = require("aws-cdk-lib");
|
|
6247
6260
|
var import_aws_events7 = require("aws-cdk-lib/aws-events");
|
|
6248
6261
|
var import_aws_events_targets3 = require("aws-cdk-lib/aws-events-targets");
|
|
6249
6262
|
var import_aws_iam4 = require("aws-cdk-lib/aws-iam");
|
|
@@ -6265,7 +6278,7 @@ var SeedSystemDataLambda = class extends import_constructs14.Construct {
|
|
|
6265
6278
|
entry: resolveHandlerEntry8(__dirname),
|
|
6266
6279
|
runtime: import_aws_lambda9.Runtime.NODEJS_LATEST,
|
|
6267
6280
|
memorySize: 512,
|
|
6268
|
-
timeout:
|
|
6281
|
+
timeout: import_aws_cdk_lib14.Duration.minutes(1),
|
|
6269
6282
|
environment: {
|
|
6270
6283
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName,
|
|
6271
6284
|
[SEED_SYSTEM_DATA_CONTROL_BUS_ENV_VAR]: props.controlEventBus.eventBusName
|
|
@@ -6287,7 +6300,7 @@ var SeedSystemDataLambda = class extends import_constructs14.Construct {
|
|
|
6287
6300
|
})
|
|
6288
6301
|
);
|
|
6289
6302
|
props.controlEventBus.grantPutEventsTo(this.lambda);
|
|
6290
|
-
const hostStackName =
|
|
6303
|
+
const hostStackName = import_aws_cdk_lib14.Stack.of(this).stackName;
|
|
6291
6304
|
this.rule = new import_aws_events7.Rule(this, "rule", {
|
|
6292
6305
|
eventBus: props.controlEventBus,
|
|
6293
6306
|
eventPattern: {
|
|
@@ -6302,7 +6315,7 @@ var SeedSystemDataLambda = class extends import_constructs14.Construct {
|
|
|
6302
6315
|
targets: [
|
|
6303
6316
|
new import_aws_events_targets3.LambdaFunction(this.lambda, {
|
|
6304
6317
|
retryAttempts: 2,
|
|
6305
|
-
maxEventAge:
|
|
6318
|
+
maxEventAge: import_aws_cdk_lib14.Duration.hours(2)
|
|
6306
6319
|
})
|
|
6307
6320
|
]
|
|
6308
6321
|
});
|
|
@@ -6464,7 +6477,7 @@ var buildProvisionDefaultWorkspaceRequestedDetail = (event) => {
|
|
|
6464
6477
|
// src/workflows/control-plane/user-onboarding/provision-default-workspace-lambda.ts
|
|
6465
6478
|
var import_node_fs9 = __toESM(require("fs"));
|
|
6466
6479
|
var import_node_path9 = __toESM(require("path"));
|
|
6467
|
-
var
|
|
6480
|
+
var import_aws_cdk_lib15 = require("aws-cdk-lib");
|
|
6468
6481
|
var import_aws_events8 = require("aws-cdk-lib/aws-events");
|
|
6469
6482
|
var import_aws_events_targets4 = require("aws-cdk-lib/aws-events-targets");
|
|
6470
6483
|
var import_aws_iam5 = require("aws-cdk-lib/aws-iam");
|
|
@@ -6511,7 +6524,7 @@ var ProvisionDefaultWorkspaceLambda = class extends import_constructs16.Construc
|
|
|
6511
6524
|
targets: [
|
|
6512
6525
|
new import_aws_events_targets4.LambdaFunction(this.lambda, {
|
|
6513
6526
|
retryAttempts: 2,
|
|
6514
|
-
maxEventAge:
|
|
6527
|
+
maxEventAge: import_aws_cdk_lib15.Duration.hours(2)
|
|
6515
6528
|
})
|
|
6516
6529
|
]
|
|
6517
6530
|
});
|
|
@@ -7170,6 +7183,7 @@ _OpenHiGraphqlService.SERVICE_TYPE = "graphql-api";
|
|
|
7170
7183
|
var OpenHiGraphqlService = _OpenHiGraphqlService;
|
|
7171
7184
|
|
|
7172
7185
|
// src/services/open-hi-website-service.ts
|
|
7186
|
+
var import_aws_s32 = require("aws-cdk-lib/aws-s3");
|
|
7173
7187
|
var SSM_PARAM_NAME_FULL_DOMAIN = "WEBSITE_FULL_DOMAIN";
|
|
7174
7188
|
var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
|
|
7175
7189
|
/**
|
|
@@ -7240,7 +7254,9 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
|
|
|
7240
7254
|
});
|
|
7241
7255
|
this.createFullDomainParameter();
|
|
7242
7256
|
}
|
|
7243
|
-
|
|
7257
|
+
if (props.createStaticContent !== false) {
|
|
7258
|
+
this.staticContent = this.createStaticContent();
|
|
7259
|
+
}
|
|
7244
7260
|
}
|
|
7245
7261
|
/**
|
|
7246
7262
|
* Validates that config required for the website stack is present.
|
|
@@ -7253,14 +7269,21 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
|
|
|
7253
7269
|
if (!config.zoneName) {
|
|
7254
7270
|
throw new Error("Zone name is required");
|
|
7255
7271
|
}
|
|
7272
|
+
if (!config.hostedZoneId) {
|
|
7273
|
+
throw new Error("Hosted zone ID is required to import the website zone");
|
|
7274
|
+
}
|
|
7256
7275
|
}
|
|
7257
7276
|
/**
|
|
7258
|
-
*
|
|
7277
|
+
* Imports the website's hosted zone from config attributes (no SSM lookup).
|
|
7278
|
+
* The website attaches DNS records here on the release-branch deploy and
|
|
7279
|
+
* the same zone is imported on feature-branch deploys for any sub-domain
|
|
7280
|
+
* routing.
|
|
7259
7281
|
* Override to customize.
|
|
7260
7282
|
*/
|
|
7261
7283
|
createHostedZone() {
|
|
7262
|
-
return OpenHiGlobalService.
|
|
7263
|
-
zoneName: this.config.zoneName
|
|
7284
|
+
return OpenHiGlobalService.rootHostedZoneFromConstruct(this, {
|
|
7285
|
+
zoneName: this.config.zoneName,
|
|
7286
|
+
hostedZoneId: this.config.hostedZoneId
|
|
7264
7287
|
});
|
|
7265
7288
|
}
|
|
7266
7289
|
/**
|
|
@@ -7307,16 +7330,41 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
|
|
|
7307
7330
|
* Creates the StaticContent uploader. Always created so feature-branch
|
|
7308
7331
|
* deploys can publish content to their own sub-domain folder against the
|
|
7309
7332
|
* release-branch bucket.
|
|
7333
|
+
*
|
|
7334
|
+
* The destination bucket is resolved here so the construct never has to
|
|
7335
|
+
* branch on release-vs-feature: on the release branch we pass the
|
|
7336
|
+
* just-created {@link staticHosting} bucket directly (no SSM round-trip
|
|
7337
|
+
* within a single stack); on every other branch we look up the bucket
|
|
7338
|
+
* ARN published by the release-branch deploy, addressed against
|
|
7339
|
+
* {@link OpenHiService.releaseBranchHash}.
|
|
7310
7340
|
*/
|
|
7311
7341
|
createStaticContent() {
|
|
7312
7342
|
const { contentSourceDirectory, contentDestinationDirectory } = this.props;
|
|
7313
7343
|
return new StaticContent(this, "static-content", {
|
|
7344
|
+
bucket: this.resolveStaticHostingBucket(),
|
|
7314
7345
|
contentSourceDirectory,
|
|
7315
7346
|
contentDestinationDirectory,
|
|
7316
|
-
fullDomain: this.fullDomain
|
|
7317
|
-
serviceType: _OpenHiWebsiteService.SERVICE_TYPE
|
|
7347
|
+
fullDomain: this.fullDomain
|
|
7318
7348
|
});
|
|
7319
7349
|
}
|
|
7350
|
+
/**
|
|
7351
|
+
* Returns an {@link IBucket} pointing at the static-hosting bucket the
|
|
7352
|
+
* uploader writes to. On the release-branch deploy this is the bucket
|
|
7353
|
+
* just provisioned by {@link staticHosting}; on every other deploy it's
|
|
7354
|
+
* imported from the bucket ARN the release-branch deploy publishes to
|
|
7355
|
+
* SSM, addressed against {@link OpenHiService.releaseBranchHash}.
|
|
7356
|
+
*/
|
|
7357
|
+
resolveStaticHostingBucket() {
|
|
7358
|
+
if (this.staticHosting) {
|
|
7359
|
+
return this.staticHosting.bucket;
|
|
7360
|
+
}
|
|
7361
|
+
const bucketArn = DiscoverableStringParameter.valueForLookupName(this, {
|
|
7362
|
+
ssmParamName: StaticHosting.SSM_PARAM_NAME_BUCKET_ARN,
|
|
7363
|
+
serviceType: _OpenHiWebsiteService.SERVICE_TYPE,
|
|
7364
|
+
branchHash: this.releaseBranchHash
|
|
7365
|
+
});
|
|
7366
|
+
return import_aws_s32.Bucket.fromBucketArn(this, "shared-bucket", bucketArn);
|
|
7367
|
+
}
|
|
7320
7368
|
};
|
|
7321
7369
|
_OpenHiWebsiteService.SERVICE_TYPE = "website";
|
|
7322
7370
|
var OpenHiWebsiteService = _OpenHiWebsiteService;
|
|
@@ -7331,7 +7379,7 @@ var OWNING_DELETE_OPS_EVENT_BUS_ENV_VAR = "OWNING_DELETE_OPS_EVENT_BUS_NAME";
|
|
|
7331
7379
|
// src/workflows/control-plane/owning-delete-cascade/owning-delete-cascade-lambdas.ts
|
|
7332
7380
|
var import_node_fs12 = __toESM(require("fs"));
|
|
7333
7381
|
var import_node_path12 = __toESM(require("path"));
|
|
7334
|
-
var
|
|
7382
|
+
var import_aws_cdk_lib16 = require("aws-cdk-lib");
|
|
7335
7383
|
var import_aws_iam8 = require("aws-cdk-lib/aws-iam");
|
|
7336
7384
|
var import_aws_lambda13 = require("aws-cdk-lib/aws-lambda");
|
|
7337
7385
|
var import_aws_lambda_nodejs13 = require("aws-cdk-lib/aws-lambda-nodejs");
|
|
@@ -7355,7 +7403,7 @@ var OwningDeleteCascadeLambdas = class extends import_constructs20.Construct {
|
|
|
7355
7403
|
entry: listResolved.entry,
|
|
7356
7404
|
runtime: import_aws_lambda13.Runtime.NODEJS_LATEST,
|
|
7357
7405
|
memorySize: 512,
|
|
7358
|
-
timeout:
|
|
7406
|
+
timeout: import_aws_cdk_lib16.Duration.minutes(1),
|
|
7359
7407
|
environment: {
|
|
7360
7408
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
|
|
7361
7409
|
}
|
|
@@ -7369,7 +7417,7 @@ var OwningDeleteCascadeLambdas = class extends import_constructs20.Construct {
|
|
|
7369
7417
|
entry: deleteResolved.entry,
|
|
7370
7418
|
runtime: import_aws_lambda13.Runtime.NODEJS_LATEST,
|
|
7371
7419
|
memorySize: 512,
|
|
7372
|
-
timeout:
|
|
7420
|
+
timeout: import_aws_cdk_lib16.Duration.minutes(1),
|
|
7373
7421
|
environment: {
|
|
7374
7422
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
|
|
7375
7423
|
}
|
|
@@ -7388,7 +7436,7 @@ var OwningDeleteCascadeLambdas = class extends import_constructs20.Construct {
|
|
|
7388
7436
|
entry: finalizeResolved.entry,
|
|
7389
7437
|
runtime: import_aws_lambda13.Runtime.NODEJS_LATEST,
|
|
7390
7438
|
memorySize: 512,
|
|
7391
|
-
timeout:
|
|
7439
|
+
timeout: import_aws_cdk_lib16.Duration.minutes(1),
|
|
7392
7440
|
environment: {
|
|
7393
7441
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName,
|
|
7394
7442
|
[OWNING_DELETE_OPS_EVENT_BUS_ENV_VAR]: props.opsEventBus.eventBusName
|
|
@@ -7406,7 +7454,7 @@ var OwningDeleteCascadeLambdas = class extends import_constructs20.Construct {
|
|
|
7406
7454
|
};
|
|
7407
7455
|
|
|
7408
7456
|
// src/workflows/control-plane/owning-delete-cascade/owning-delete-cascade-workflow.ts
|
|
7409
|
-
var
|
|
7457
|
+
var import_aws_cdk_lib17 = require("aws-cdk-lib");
|
|
7410
7458
|
var import_aws_events9 = require("aws-cdk-lib/aws-events");
|
|
7411
7459
|
var import_aws_events_targets5 = require("aws-cdk-lib/aws-events-targets");
|
|
7412
7460
|
var import_aws_stepfunctions = require("aws-cdk-lib/aws-stepfunctions");
|
|
@@ -7521,7 +7569,7 @@ var OwningDeleteCascadeWorkflow = class extends import_constructs21.Construct {
|
|
|
7521
7569
|
}
|
|
7522
7570
|
});
|
|
7523
7571
|
const interPageWait = new import_aws_stepfunctions.Wait(this, "inter-page-wait", {
|
|
7524
|
-
time: import_aws_stepfunctions.WaitTime.duration(
|
|
7572
|
+
time: import_aws_stepfunctions.WaitTime.duration(import_aws_cdk_lib17.Duration.seconds(0))
|
|
7525
7573
|
});
|
|
7526
7574
|
const isExhausted = new import_aws_stepfunctions.Choice(this, "is-exhausted");
|
|
7527
7575
|
const finalize = new import_aws_stepfunctions_tasks.LambdaInvoke(this, "finalize", {
|
|
@@ -7552,7 +7600,7 @@ var OwningDeleteCascadeWorkflow = class extends import_constructs21.Construct {
|
|
|
7552
7600
|
// Long timeout because real-world cascades can run minutes when
|
|
7553
7601
|
// a workspace has thousands of members. The stuck-cascade alarm
|
|
7554
7602
|
// fires at 15 minutes; the state machine itself does not abort.
|
|
7555
|
-
timeout:
|
|
7603
|
+
timeout: import_aws_cdk_lib17.Duration.hours(2)
|
|
7556
7604
|
});
|
|
7557
7605
|
this.rule = new import_aws_events9.Rule(this, "rule", {
|
|
7558
7606
|
eventBus: props.dataEventBus,
|
|
@@ -7563,7 +7611,7 @@ var OwningDeleteCascadeWorkflow = class extends import_constructs21.Construct {
|
|
|
7563
7611
|
targets: [
|
|
7564
7612
|
new import_aws_events_targets5.SfnStateMachine(this.stateMachine, {
|
|
7565
7613
|
retryAttempts: 2,
|
|
7566
|
-
maxEventAge:
|
|
7614
|
+
maxEventAge: import_aws_cdk_lib17.Duration.hours(2)
|
|
7567
7615
|
})
|
|
7568
7616
|
]
|
|
7569
7617
|
});
|
|
@@ -7581,7 +7629,7 @@ var RENAME_CASCADE_OPS_EVENT_BUS_ENV_VAR = "RENAME_CASCADE_OPS_EVENT_BUS_NAME";
|
|
|
7581
7629
|
// src/workflows/control-plane/rename-cascade/rename-cascade-lambdas.ts
|
|
7582
7630
|
var import_node_fs13 = __toESM(require("fs"));
|
|
7583
7631
|
var import_node_path13 = __toESM(require("path"));
|
|
7584
|
-
var
|
|
7632
|
+
var import_aws_cdk_lib18 = require("aws-cdk-lib");
|
|
7585
7633
|
var import_aws_iam9 = require("aws-cdk-lib/aws-iam");
|
|
7586
7634
|
var import_aws_lambda14 = require("aws-cdk-lib/aws-lambda");
|
|
7587
7635
|
var import_aws_lambda_nodejs14 = require("aws-cdk-lib/aws-lambda-nodejs");
|
|
@@ -7605,7 +7653,7 @@ var RenameCascadeLambdas = class extends import_constructs22.Construct {
|
|
|
7605
7653
|
entry: listResolved.entry,
|
|
7606
7654
|
runtime: import_aws_lambda14.Runtime.NODEJS_LATEST,
|
|
7607
7655
|
memorySize: 512,
|
|
7608
|
-
timeout:
|
|
7656
|
+
timeout: import_aws_cdk_lib18.Duration.minutes(1),
|
|
7609
7657
|
environment: {
|
|
7610
7658
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
|
|
7611
7659
|
}
|
|
@@ -7619,7 +7667,7 @@ var RenameCascadeLambdas = class extends import_constructs22.Construct {
|
|
|
7619
7667
|
entry: rewriteResolved.entry,
|
|
7620
7668
|
runtime: import_aws_lambda14.Runtime.NODEJS_LATEST,
|
|
7621
7669
|
memorySize: 512,
|
|
7622
|
-
timeout:
|
|
7670
|
+
timeout: import_aws_cdk_lib18.Duration.minutes(1),
|
|
7623
7671
|
environment: {
|
|
7624
7672
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
|
|
7625
7673
|
}
|
|
@@ -7638,7 +7686,7 @@ var RenameCascadeLambdas = class extends import_constructs22.Construct {
|
|
|
7638
7686
|
entry: finalizeResolved.entry,
|
|
7639
7687
|
runtime: import_aws_lambda14.Runtime.NODEJS_LATEST,
|
|
7640
7688
|
memorySize: 512,
|
|
7641
|
-
timeout:
|
|
7689
|
+
timeout: import_aws_cdk_lib18.Duration.minutes(1),
|
|
7642
7690
|
environment: {
|
|
7643
7691
|
[RENAME_CASCADE_OPS_EVENT_BUS_ENV_VAR]: props.opsEventBus.eventBusName
|
|
7644
7692
|
}
|
|
@@ -7654,7 +7702,7 @@ var RenameCascadeLambdas = class extends import_constructs22.Construct {
|
|
|
7654
7702
|
};
|
|
7655
7703
|
|
|
7656
7704
|
// src/workflows/control-plane/rename-cascade/rename-cascade-workflow.ts
|
|
7657
|
-
var
|
|
7705
|
+
var import_aws_cdk_lib19 = require("aws-cdk-lib");
|
|
7658
7706
|
var import_aws_events10 = require("aws-cdk-lib/aws-events");
|
|
7659
7707
|
var import_aws_events_targets6 = require("aws-cdk-lib/aws-events-targets");
|
|
7660
7708
|
var import_aws_stepfunctions2 = require("aws-cdk-lib/aws-stepfunctions");
|
|
@@ -7804,7 +7852,7 @@ var RenameCascadeWorkflow = class extends import_constructs23.Construct {
|
|
|
7804
7852
|
// Long timeout — large renames may rewrite thousands of rows;
|
|
7805
7853
|
// the `CascadeSlow` alarm fires at 300s p99 but the state
|
|
7806
7854
|
// machine itself does not abort.
|
|
7807
|
-
timeout:
|
|
7855
|
+
timeout: import_aws_cdk_lib19.Duration.hours(2)
|
|
7808
7856
|
});
|
|
7809
7857
|
this.rule = new import_aws_events10.Rule(this, "rule", {
|
|
7810
7858
|
eventBus: props.dataEventBus,
|
|
@@ -7815,7 +7863,7 @@ var RenameCascadeWorkflow = class extends import_constructs23.Construct {
|
|
|
7815
7863
|
targets: [
|
|
7816
7864
|
new import_aws_events_targets6.SfnStateMachine(this.stateMachine, {
|
|
7817
7865
|
retryAttempts: 2,
|
|
7818
|
-
maxEventAge:
|
|
7866
|
+
maxEventAge: import_aws_cdk_lib19.Duration.hours(2)
|
|
7819
7867
|
})
|
|
7820
7868
|
]
|
|
7821
7869
|
});
|