@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/index.mjs CHANGED
@@ -386,6 +386,16 @@ var OpenHiService = class extends Stack {
386
386
  ),
387
387
  6
388
388
  );
389
+ const releaseBranchHash = hashString(
390
+ [
391
+ appName,
392
+ ohEnv.deploymentTargetRole,
393
+ account,
394
+ region,
395
+ defaultReleaseBranch
396
+ ].join("-"),
397
+ 6
398
+ );
389
399
  const stackHash = hashString(
390
400
  [
391
401
  appName,
@@ -416,6 +426,7 @@ var OpenHiService = class extends Stack {
416
426
  this.branchName = branchName;
417
427
  this.environmentHash = environmentHash;
418
428
  this.branchHash = branchHash;
429
+ this.releaseBranchHash = releaseBranchHash;
419
430
  this.stackHash = stackHash;
420
431
  this.node.setContext(
421
432
  `availability-zones:account=${account}:region=${region}`,
@@ -1176,7 +1187,9 @@ var WorkflowDedupConsumerNameInvalidError = class extends Error {
1176
1187
  };
1177
1188
 
1178
1189
  // src/components/event-bridge/data-event-bus.ts
1179
- import { EventBus } from "aws-cdk-lib/aws-events";
1190
+ import { Duration as Duration2, Stack as Stack2 } from "aws-cdk-lib";
1191
+ import { Archive, EventBus } from "aws-cdk-lib/aws-events";
1192
+ var DEFAULT_ARCHIVE_RETENTION = Duration2.days(7);
1180
1193
  var DataEventBus = class _DataEventBus extends EventBus {
1181
1194
  /*****************************************************************************
1182
1195
  *
@@ -1189,11 +1202,19 @@ var DataEventBus = class _DataEventBus extends EventBus {
1189
1202
  const stack = OpenHiService.of(scope);
1190
1203
  return `datav1${stack.branchHash}`;
1191
1204
  }
1192
- constructor(scope, props) {
1205
+ constructor(scope, props = void 0) {
1206
+ const { archiveRetention, ...busProps } = props ?? {};
1193
1207
  super(scope, "data-event-bus-v1", {
1194
- ...props,
1208
+ ...busProps,
1195
1209
  eventBusName: _DataEventBus.getEventBusName(scope)
1196
1210
  });
1211
+ this.replayArchive = new Archive(this, "Archive", {
1212
+ sourceEventBus: this,
1213
+ archiveName: `${_DataEventBus.getEventBusName(scope)}-archive`,
1214
+ description: "Replay archive for the OpenHI data event bus (data-store change notifications).",
1215
+ eventPattern: { account: [Stack2.of(this).account] },
1216
+ retention: archiveRetention ?? DEFAULT_ARCHIVE_RETENTION
1217
+ });
1197
1218
  }
1198
1219
  };
1199
1220
 
@@ -1244,7 +1265,7 @@ var ControlEventBus = class _ControlEventBus extends EventBus3 {
1244
1265
  // src/components/postgres/data-store-postgres-replica.ts
1245
1266
  import fs5 from "fs";
1246
1267
  import path5 from "path";
1247
- import { Duration as Duration2, Stack as Stack2 } from "aws-cdk-lib";
1268
+ import { Duration as Duration3, Stack as Stack3 } from "aws-cdk-lib";
1248
1269
  import * as ec2 from "aws-cdk-lib/aws-ec2";
1249
1270
  import { Runtime as Runtime5, StartingPosition } from "aws-cdk-lib/aws-lambda";
1250
1271
  import { KinesisEventSource } from "aws-cdk-lib/aws-lambda-event-sources";
@@ -1310,7 +1331,7 @@ var DataStorePostgresReplica = class extends Construct6 {
1310
1331
  super(scope, id);
1311
1332
  this.databaseName = props.databaseName ?? DEFAULT_DATABASE_NAME;
1312
1333
  this.schemaName = getPostgresReplicaSchemaName(props.branchHash);
1313
- const region = Stack2.of(this).region;
1334
+ const region = Stack3.of(this).region;
1314
1335
  this.vpc = props.vpc ?? new ec2.Vpc(this, "Vpc", {
1315
1336
  availabilityZones: [`${region}a`, `${region}b`],
1316
1337
  natGateways: 0,
@@ -1346,7 +1367,7 @@ var DataStorePostgresReplica = class extends Construct6 {
1346
1367
  entry: resolveHandlerEntry5(__dirname),
1347
1368
  runtime: Runtime5.NODEJS_LATEST,
1348
1369
  memorySize: 512,
1349
- timeout: Duration2.minutes(1),
1370
+ timeout: Duration3.minutes(1),
1350
1371
  vpc: this.vpc,
1351
1372
  vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_ISOLATED },
1352
1373
  description: "Replicates DynamoDB current-resource changes into the Postgres `resources` JSONB table (ADR 2026-04-17-01).",
@@ -1373,7 +1394,7 @@ var DataStorePostgresReplica = class extends Construct6 {
1373
1394
  new KinesisEventSource(props.kinesisStream, {
1374
1395
  startingPosition: StartingPosition.LATEST,
1375
1396
  batchSize: 100,
1376
- maxBatchingWindow: Duration2.seconds(5),
1397
+ maxBatchingWindow: Duration3.seconds(5),
1377
1398
  retryAttempts: 10,
1378
1399
  bisectBatchOnError: true,
1379
1400
  parallelizationFactor: 2,
@@ -1406,7 +1427,7 @@ var DataStorePostgresReplica = class extends Construct6 {
1406
1427
  };
1407
1428
 
1408
1429
  // src/components/route-53/child-hosted-zone.ts
1409
- import { Duration as Duration3 } from "aws-cdk-lib";
1430
+ import { Duration as Duration4 } from "aws-cdk-lib";
1410
1431
  import {
1411
1432
  HostedZone,
1412
1433
  NsRecord
@@ -1418,7 +1439,7 @@ var ChildHostedZone = class extends HostedZone {
1418
1439
  zone: props.parentHostedZone,
1419
1440
  recordName: this.zoneName,
1420
1441
  values: this.hostedZoneNameServers || [],
1421
- ttl: Duration3.minutes(5)
1442
+ ttl: Duration4.minutes(5)
1422
1443
  });
1423
1444
  }
1424
1445
  };
@@ -1433,15 +1454,36 @@ var RootHostedZone = class extends Construct7 {
1433
1454
  };
1434
1455
 
1435
1456
  // src/components/static-hosting/static-content.ts
1436
- import { Bucket as Bucket3 } from "aws-cdk-lib/aws-s3";
1437
1457
  import { BucketDeployment, Source } from "aws-cdk-lib/aws-s3-deployment";
1438
1458
  import { paramCase as paramCase2 } from "change-case";
1439
- import { Construct as Construct9 } from "constructs";
1459
+ import { Construct as Construct8 } from "constructs";
1460
+ var StaticContent = class extends Construct8 {
1461
+ constructor(scope, id, props) {
1462
+ super(scope, id);
1463
+ const stack = OpenHiService.of(scope);
1464
+ const {
1465
+ bucket,
1466
+ contentSourceDirectory,
1467
+ contentDestinationDirectory = "/",
1468
+ subDomain = stack.branchName,
1469
+ fullDomain
1470
+ } = props;
1471
+ const keyPrefix = [paramCase2(subDomain), fullDomain].join(".");
1472
+ const isTestEnv = process.env.JEST_WORKER_ID !== void 0;
1473
+ const sources = isTestEnv ? [] : [Source.asset(contentSourceDirectory)];
1474
+ new BucketDeployment(this, "deploy", {
1475
+ sources,
1476
+ destinationBucket: bucket,
1477
+ retainOnDelete: false,
1478
+ destinationKeyPrefix: `${keyPrefix}${contentDestinationDirectory}`
1479
+ });
1480
+ }
1481
+ };
1440
1482
 
1441
1483
  // src/components/static-hosting/static-hosting.ts
1442
1484
  import * as fs6 from "fs";
1443
1485
  import * as path6 from "path";
1444
- import { Duration as Duration4 } from "aws-cdk-lib";
1486
+ import { Duration as Duration5 } from "aws-cdk-lib";
1445
1487
  import {
1446
1488
  AccessLevel,
1447
1489
  AllowedMethods,
@@ -1465,9 +1507,9 @@ import {
1465
1507
  } from "aws-cdk-lib/aws-route53";
1466
1508
  import { CloudFrontTarget } from "aws-cdk-lib/aws-route53-targets";
1467
1509
  import { Bucket as Bucket2 } from "aws-cdk-lib/aws-s3";
1468
- import { Construct as Construct8 } from "constructs";
1510
+ import { Construct as Construct9 } from "constructs";
1469
1511
  var STATIC_HOSTING_SERVICE_TYPE = "website";
1470
- var _StaticHosting = class _StaticHosting extends Construct8 {
1512
+ var _StaticHosting = class _StaticHosting extends Construct9 {
1471
1513
  constructor(scope, id, props = {}) {
1472
1514
  super(scope, id);
1473
1515
  const stack = OpenHiService.of(scope);
@@ -1507,9 +1549,9 @@ var _StaticHosting = class _StaticHosting extends Construct8 {
1507
1549
  const cachePolicy = new CachePolicy(this, "cache-policy", {
1508
1550
  cachePolicyName: `static-hosting-${stack.branchHash}`,
1509
1551
  comment: "Static hosting default: 60s default / 300s max, gzip+brotli.",
1510
- defaultTtl: Duration4.seconds(60),
1511
- minTtl: Duration4.seconds(0),
1512
- maxTtl: Duration4.seconds(300),
1552
+ defaultTtl: Duration5.seconds(60),
1553
+ minTtl: Duration5.seconds(0),
1554
+ maxTtl: Duration5.seconds(300),
1513
1555
  headerBehavior: CacheHeaderBehavior.none(),
1514
1556
  queryStringBehavior: CacheQueryStringBehavior.none(),
1515
1557
  cookieBehavior: CacheCookieBehavior.none(),
@@ -1603,35 +1645,6 @@ _StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_DOMAIN = "STATIC_HOSTING_DISTRIBUTION
1603
1645
  _StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_ID = "STATIC_HOSTING_DISTRIBUTION_ID";
1604
1646
  var StaticHosting = _StaticHosting;
1605
1647
 
1606
- // src/components/static-hosting/static-content.ts
1607
- var StaticContent = class extends Construct9 {
1608
- constructor(scope, id, props) {
1609
- super(scope, id);
1610
- const stack = OpenHiService.of(scope);
1611
- const {
1612
- contentSourceDirectory,
1613
- contentDestinationDirectory = "/",
1614
- subDomain = stack.branchName,
1615
- fullDomain,
1616
- serviceType = STATIC_HOSTING_SERVICE_TYPE
1617
- } = props;
1618
- const keyPrefix = [paramCase2(subDomain), fullDomain].join(".");
1619
- const bucketArn = DiscoverableStringParameter.valueForLookupName(this, {
1620
- ssmParamName: StaticHosting.SSM_PARAM_NAME_BUCKET_ARN,
1621
- serviceType
1622
- });
1623
- const bucket = Bucket3.fromBucketArn(this, "bucket", bucketArn);
1624
- const isTestEnv = process.env.JEST_WORKER_ID !== void 0;
1625
- const sources = isTestEnv ? [] : [Source.asset(contentSourceDirectory)];
1626
- new BucketDeployment(this, "deploy", {
1627
- sources,
1628
- destinationBucket: bucket,
1629
- retainOnDelete: false,
1630
- destinationKeyPrefix: `${keyPrefix}${contentDestinationDirectory}`
1631
- });
1632
- }
1633
- };
1634
-
1635
1648
  // src/services/open-hi-auth-service.ts
1636
1649
  import {
1637
1650
  LambdaVersion,
@@ -1642,7 +1655,7 @@ import {
1642
1655
  } from "aws-cdk-lib/aws-cognito";
1643
1656
  import { Effect as Effect6, PolicyStatement as PolicyStatement6 } from "aws-cdk-lib/aws-iam";
1644
1657
  import { Key as Key2 } from "aws-cdk-lib/aws-kms";
1645
- import { Stack as Stack6 } from "aws-cdk-lib/core";
1658
+ import { Stack as Stack7 } from "aws-cdk-lib/core";
1646
1659
 
1647
1660
  // src/services/open-hi-data-service.ts
1648
1661
  var import_config4 = __toESM(require_lib2());
@@ -1666,7 +1679,7 @@ import { Construct as Construct11 } from "constructs";
1666
1679
  // src/workflows/control-plane/platform-deploy-bridge/platform-deploy-bridge-lambda.ts
1667
1680
  import fs7 from "fs";
1668
1681
  import path7 from "path";
1669
- import { Duration as Duration5, Stack as Stack3 } from "aws-cdk-lib";
1682
+ import { Duration as Duration6, Stack as Stack4 } from "aws-cdk-lib";
1670
1683
  import { Rule } from "aws-cdk-lib/aws-events";
1671
1684
  import { LambdaFunction } from "aws-cdk-lib/aws-events-targets";
1672
1685
  import { Effect as Effect2, PolicyStatement as PolicyStatement2 } from "aws-cdk-lib/aws-iam";
@@ -1690,15 +1703,15 @@ var PlatformDeployBridgeLambda = class extends Construct10 {
1690
1703
  OPENHI_TAG_SUFFIX_REPO_NAME
1691
1704
  );
1692
1705
  const tagKeyPrefix = `${service.appName}:`;
1693
- const ownStackName = Stack3.of(this).stackName;
1694
- const ownSuffix = `-${service.serviceId}-${Stack3.of(this).account}-${Stack3.of(this).region}`;
1706
+ const ownStackName = Stack4.of(this).stackName;
1707
+ const ownSuffix = `-${service.serviceId}-${Stack4.of(this).account}-${Stack4.of(this).region}`;
1695
1708
  const sharedPrefix = ownStackName.endsWith(ownSuffix) ? ownStackName.slice(0, -ownSuffix.length) : service.branchHash;
1696
- const stackIdPrefix = `arn:aws:cloudformation:${Stack3.of(this).region}:${Stack3.of(this).account}:stack/${sharedPrefix}-`;
1709
+ const stackIdPrefix = `arn:aws:cloudformation:${Stack4.of(this).region}:${Stack4.of(this).account}:stack/${sharedPrefix}-`;
1697
1710
  this.lambda = new NodejsFunction7(this, "handler", {
1698
1711
  entry: resolveHandlerEntry6(__dirname),
1699
1712
  runtime: Runtime7.NODEJS_LATEST,
1700
1713
  memorySize: 256,
1701
- timeout: Duration5.seconds(30),
1714
+ timeout: Duration6.seconds(30),
1702
1715
  environment: {
1703
1716
  [CONTROL_EVENT_BUS_NAME_ENV_VAR]: props.controlEventBus.eventBusName,
1704
1717
  [OPENHI_REPO_TAG_KEY_ENV_VAR]: repoTagKey,
@@ -1710,7 +1723,7 @@ var PlatformDeployBridgeLambda = class extends Construct10 {
1710
1723
  effect: Effect2.ALLOW,
1711
1724
  actions: ["cloudformation:DescribeStacks"],
1712
1725
  resources: [
1713
- `arn:aws:cloudformation:${Stack3.of(this).region}:${Stack3.of(this).account}:stack/*`
1726
+ `arn:aws:cloudformation:${Stack4.of(this).region}:${Stack4.of(this).account}:stack/*`
1714
1727
  ]
1715
1728
  })
1716
1729
  );
@@ -1729,7 +1742,7 @@ var PlatformDeployBridgeLambda = class extends Construct10 {
1729
1742
  targets: [
1730
1743
  new LambdaFunction(this.lambda, {
1731
1744
  retryAttempts: 2,
1732
- maxEventAge: Duration5.hours(2)
1745
+ maxEventAge: Duration6.hours(2)
1733
1746
  })
1734
1747
  ]
1735
1748
  });
@@ -1932,7 +1945,7 @@ var OpenHiGlobalService = _OpenHiGlobalService;
1932
1945
  // src/workflows/control-plane/seed-demo-data/seed-demo-data-lambda.ts
1933
1946
  import fs8 from "fs";
1934
1947
  import path8 from "path";
1935
- import { Duration as Duration6, Stack as Stack4 } from "aws-cdk-lib";
1948
+ import { Duration as Duration7, Stack as Stack5 } from "aws-cdk-lib";
1936
1949
  import { Rule as Rule2 } from "aws-cdk-lib/aws-events";
1937
1950
  import { LambdaFunction as LambdaFunction2 } from "aws-cdk-lib/aws-events-targets";
1938
1951
  import { Effect as Effect3, PolicyStatement as PolicyStatement3 } from "aws-cdk-lib/aws-iam";
@@ -1954,7 +1967,7 @@ var SeedDemoDataLambda = class extends Construct12 {
1954
1967
  entry: resolveHandlerEntry7(__dirname),
1955
1968
  runtime: Runtime8.NODEJS_LATEST,
1956
1969
  memorySize: 512,
1957
- timeout: Duration6.minutes(2),
1970
+ timeout: Duration7.minutes(2),
1958
1971
  environment: {
1959
1972
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName,
1960
1973
  [SEED_DEMO_DATA_USER_POOL_ID_ENV_VAR]: props.userPool.userPoolId
@@ -1983,7 +1996,7 @@ var SeedDemoDataLambda = class extends Construct12 {
1983
1996
  "cognito-idp:AdminSetUserPassword"
1984
1997
  ],
1985
1998
  resources: [
1986
- Stack4.of(this).formatArn({
1999
+ Stack5.of(this).formatArn({
1987
2000
  service: "cognito-idp",
1988
2001
  resource: "userpool",
1989
2002
  resourceName: props.userPool.userPoolId
@@ -2000,7 +2013,7 @@ var SeedDemoDataLambda = class extends Construct12 {
2000
2013
  targets: [
2001
2014
  new LambdaFunction2(this.lambda, {
2002
2015
  retryAttempts: 2,
2003
- maxEventAge: Duration6.hours(2)
2016
+ maxEventAge: Duration7.hours(2)
2004
2017
  })
2005
2018
  ]
2006
2019
  });
@@ -2029,7 +2042,7 @@ var SeedDemoDataWorkflow = class extends Construct13 {
2029
2042
  import fs9 from "fs";
2030
2043
  import path9 from "path";
2031
2044
  import { PLATFORM_ROLE_IDS } from "@openhi/types";
2032
- import { Duration as Duration7, Stack as Stack5 } from "aws-cdk-lib";
2045
+ import { Duration as Duration8, Stack as Stack6 } from "aws-cdk-lib";
2033
2046
  import { Rule as Rule3 } from "aws-cdk-lib/aws-events";
2034
2047
  import { LambdaFunction as LambdaFunction3 } from "aws-cdk-lib/aws-events-targets";
2035
2048
  import { Effect as Effect4, PolicyStatement as PolicyStatement4 } from "aws-cdk-lib/aws-iam";
@@ -2051,7 +2064,7 @@ var SeedSystemDataLambda = class extends Construct14 {
2051
2064
  entry: resolveHandlerEntry8(__dirname),
2052
2065
  runtime: Runtime9.NODEJS_LATEST,
2053
2066
  memorySize: 512,
2054
- timeout: Duration7.minutes(1),
2067
+ timeout: Duration8.minutes(1),
2055
2068
  environment: {
2056
2069
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName,
2057
2070
  [SEED_SYSTEM_DATA_CONTROL_BUS_ENV_VAR]: props.controlEventBus.eventBusName
@@ -2073,7 +2086,7 @@ var SeedSystemDataLambda = class extends Construct14 {
2073
2086
  })
2074
2087
  );
2075
2088
  props.controlEventBus.grantPutEventsTo(this.lambda);
2076
- const hostStackName = Stack5.of(this).stackName;
2089
+ const hostStackName = Stack6.of(this).stackName;
2077
2090
  this.rule = new Rule3(this, "rule", {
2078
2091
  eventBus: props.controlEventBus,
2079
2092
  eventPattern: {
@@ -2088,7 +2101,7 @@ var SeedSystemDataLambda = class extends Construct14 {
2088
2101
  targets: [
2089
2102
  new LambdaFunction3(this.lambda, {
2090
2103
  retryAttempts: 2,
2091
- maxEventAge: Duration7.hours(2)
2104
+ maxEventAge: Duration8.hours(2)
2092
2105
  })
2093
2106
  ]
2094
2107
  });
@@ -2225,7 +2238,7 @@ var OpenHiDataService = _OpenHiDataService;
2225
2238
  // src/workflows/control-plane/user-onboarding/provision-default-workspace-lambda.ts
2226
2239
  import fs10 from "fs";
2227
2240
  import path10 from "path";
2228
- import { Duration as Duration8 } from "aws-cdk-lib";
2241
+ import { Duration as Duration9 } from "aws-cdk-lib";
2229
2242
  import { Rule as Rule4 } from "aws-cdk-lib/aws-events";
2230
2243
  import { LambdaFunction as LambdaFunction4 } from "aws-cdk-lib/aws-events-targets";
2231
2244
  import { Effect as Effect5, PolicyStatement as PolicyStatement5 } from "aws-cdk-lib/aws-iam";
@@ -2272,7 +2285,7 @@ var ProvisionDefaultWorkspaceLambda = class extends Construct16 {
2272
2285
  targets: [
2273
2286
  new LambdaFunction4(this.lambda, {
2274
2287
  retryAttempts: 2,
2275
- maxEventAge: Duration8.hours(2)
2288
+ maxEventAge: Duration9.hours(2)
2276
2289
  })
2277
2290
  ]
2278
2291
  });
@@ -2499,7 +2512,7 @@ var _OpenHiAuthService = class _OpenHiAuthService extends OpenHiService {
2499
2512
  new PolicyStatement6({
2500
2513
  actions: ["cognito-idp:AdminUserGlobalSignOut"],
2501
2514
  resources: [
2502
- Stack6.of(this).formatArn({
2515
+ Stack7.of(this).formatArn({
2503
2516
  service: "cognito-idp",
2504
2517
  resource: "userpool",
2505
2518
  resourceName: "*"
@@ -2573,7 +2586,7 @@ import {
2573
2586
  RecordTarget as RecordTarget2
2574
2587
  } from "aws-cdk-lib/aws-route53";
2575
2588
  import { ApiGatewayv2DomainProperties } from "aws-cdk-lib/aws-route53-targets";
2576
- import { Duration as Duration9 } from "aws-cdk-lib/core";
2589
+ import { Duration as Duration10 } from "aws-cdk-lib/core";
2577
2590
 
2578
2591
  // src/data/lambda/cors-options-lambda.ts
2579
2592
  import fs11 from "fs";
@@ -2880,7 +2893,7 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
2880
2893
  "Authorization"
2881
2894
  ],
2882
2895
  allowCredentials: cors.allowCredentials ?? true,
2883
- maxAge: cors.maxAge ?? Duration9.days(1),
2896
+ maxAge: cors.maxAge ?? Duration10.days(1),
2884
2897
  ...cors.exposeHeaders !== void 0 && {
2885
2898
  exposeHeaders: cors.exposeHeaders
2886
2899
  }
@@ -2946,6 +2959,7 @@ _OpenHiGraphqlService.SERVICE_TYPE = "graphql-api";
2946
2959
  var OpenHiGraphqlService = _OpenHiGraphqlService;
2947
2960
 
2948
2961
  // src/services/open-hi-website-service.ts
2962
+ import { Bucket as Bucket3 } from "aws-cdk-lib/aws-s3";
2949
2963
  var SSM_PARAM_NAME_FULL_DOMAIN = "WEBSITE_FULL_DOMAIN";
2950
2964
  var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
2951
2965
  /**
@@ -3016,7 +3030,9 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
3016
3030
  });
3017
3031
  this.createFullDomainParameter();
3018
3032
  }
3019
- this.staticContent = this.createStaticContent();
3033
+ if (props.createStaticContent !== false) {
3034
+ this.staticContent = this.createStaticContent();
3035
+ }
3020
3036
  }
3021
3037
  /**
3022
3038
  * Validates that config required for the website stack is present.
@@ -3029,14 +3045,21 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
3029
3045
  if (!config.zoneName) {
3030
3046
  throw new Error("Zone name is required");
3031
3047
  }
3048
+ if (!config.hostedZoneId) {
3049
+ throw new Error("Hosted zone ID is required to import the website zone");
3050
+ }
3032
3051
  }
3033
3052
  /**
3034
- * Looks up the child hosted zone published by the Global service.
3053
+ * Imports the website's hosted zone from config attributes (no SSM lookup).
3054
+ * The website attaches DNS records here on the release-branch deploy and
3055
+ * the same zone is imported on feature-branch deploys for any sub-domain
3056
+ * routing.
3035
3057
  * Override to customize.
3036
3058
  */
3037
3059
  createHostedZone() {
3038
- return OpenHiGlobalService.childHostedZoneFromConstruct(this, {
3039
- zoneName: this.config.zoneName
3060
+ return OpenHiGlobalService.rootHostedZoneFromConstruct(this, {
3061
+ zoneName: this.config.zoneName,
3062
+ hostedZoneId: this.config.hostedZoneId
3040
3063
  });
3041
3064
  }
3042
3065
  /**
@@ -3083,16 +3106,41 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
3083
3106
  * Creates the StaticContent uploader. Always created so feature-branch
3084
3107
  * deploys can publish content to their own sub-domain folder against the
3085
3108
  * release-branch bucket.
3109
+ *
3110
+ * The destination bucket is resolved here so the construct never has to
3111
+ * branch on release-vs-feature: on the release branch we pass the
3112
+ * just-created {@link staticHosting} bucket directly (no SSM round-trip
3113
+ * within a single stack); on every other branch we look up the bucket
3114
+ * ARN published by the release-branch deploy, addressed against
3115
+ * {@link OpenHiService.releaseBranchHash}.
3086
3116
  */
3087
3117
  createStaticContent() {
3088
3118
  const { contentSourceDirectory, contentDestinationDirectory } = this.props;
3089
3119
  return new StaticContent(this, "static-content", {
3120
+ bucket: this.resolveStaticHostingBucket(),
3090
3121
  contentSourceDirectory,
3091
3122
  contentDestinationDirectory,
3092
- fullDomain: this.fullDomain,
3093
- serviceType: _OpenHiWebsiteService.SERVICE_TYPE
3123
+ fullDomain: this.fullDomain
3094
3124
  });
3095
3125
  }
3126
+ /**
3127
+ * Returns an {@link IBucket} pointing at the static-hosting bucket the
3128
+ * uploader writes to. On the release-branch deploy this is the bucket
3129
+ * just provisioned by {@link staticHosting}; on every other deploy it's
3130
+ * imported from the bucket ARN the release-branch deploy publishes to
3131
+ * SSM, addressed against {@link OpenHiService.releaseBranchHash}.
3132
+ */
3133
+ resolveStaticHostingBucket() {
3134
+ if (this.staticHosting) {
3135
+ return this.staticHosting.bucket;
3136
+ }
3137
+ const bucketArn = DiscoverableStringParameter.valueForLookupName(this, {
3138
+ ssmParamName: StaticHosting.SSM_PARAM_NAME_BUCKET_ARN,
3139
+ serviceType: _OpenHiWebsiteService.SERVICE_TYPE,
3140
+ branchHash: this.releaseBranchHash
3141
+ });
3142
+ return Bucket3.fromBucketArn(this, "shared-bucket", bucketArn);
3143
+ }
3096
3144
  };
3097
3145
  _OpenHiWebsiteService.SERVICE_TYPE = "website";
3098
3146
  var OpenHiWebsiteService = _OpenHiWebsiteService;
@@ -3100,7 +3148,7 @@ var OpenHiWebsiteService = _OpenHiWebsiteService;
3100
3148
  // src/workflows/control-plane/owning-delete-cascade/owning-delete-cascade-lambdas.ts
3101
3149
  import fs13 from "fs";
3102
3150
  import path13 from "path";
3103
- import { Duration as Duration10 } from "aws-cdk-lib";
3151
+ import { Duration as Duration11 } from "aws-cdk-lib";
3104
3152
  import { Effect as Effect8, PolicyStatement as PolicyStatement8 } from "aws-cdk-lib/aws-iam";
3105
3153
  import { Runtime as Runtime13 } from "aws-cdk-lib/aws-lambda";
3106
3154
  import { NodejsFunction as NodejsFunction13 } from "aws-cdk-lib/aws-lambda-nodejs";
@@ -3124,7 +3172,7 @@ var OwningDeleteCascadeLambdas = class extends Construct20 {
3124
3172
  entry: listResolved.entry,
3125
3173
  runtime: Runtime13.NODEJS_LATEST,
3126
3174
  memorySize: 512,
3127
- timeout: Duration10.minutes(1),
3175
+ timeout: Duration11.minutes(1),
3128
3176
  environment: {
3129
3177
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
3130
3178
  }
@@ -3138,7 +3186,7 @@ var OwningDeleteCascadeLambdas = class extends Construct20 {
3138
3186
  entry: deleteResolved.entry,
3139
3187
  runtime: Runtime13.NODEJS_LATEST,
3140
3188
  memorySize: 512,
3141
- timeout: Duration10.minutes(1),
3189
+ timeout: Duration11.minutes(1),
3142
3190
  environment: {
3143
3191
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
3144
3192
  }
@@ -3157,7 +3205,7 @@ var OwningDeleteCascadeLambdas = class extends Construct20 {
3157
3205
  entry: finalizeResolved.entry,
3158
3206
  runtime: Runtime13.NODEJS_LATEST,
3159
3207
  memorySize: 512,
3160
- timeout: Duration10.minutes(1),
3208
+ timeout: Duration11.minutes(1),
3161
3209
  environment: {
3162
3210
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName,
3163
3211
  [OWNING_DELETE_OPS_EVENT_BUS_ENV_VAR]: props.opsEventBus.eventBusName
@@ -3175,7 +3223,7 @@ var OwningDeleteCascadeLambdas = class extends Construct20 {
3175
3223
  };
3176
3224
 
3177
3225
  // src/workflows/control-plane/owning-delete-cascade/owning-delete-cascade-workflow.ts
3178
- import { Duration as Duration11 } from "aws-cdk-lib";
3226
+ import { Duration as Duration12 } from "aws-cdk-lib";
3179
3227
  import { Rule as Rule5 } from "aws-cdk-lib/aws-events";
3180
3228
  import { SfnStateMachine } from "aws-cdk-lib/aws-events-targets";
3181
3229
  import {
@@ -3301,7 +3349,7 @@ var OwningDeleteCascadeWorkflow = class extends Construct21 {
3301
3349
  }
3302
3350
  });
3303
3351
  const interPageWait = new Wait(this, "inter-page-wait", {
3304
- time: WaitTime.duration(Duration11.seconds(0))
3352
+ time: WaitTime.duration(Duration12.seconds(0))
3305
3353
  });
3306
3354
  const isExhausted = new Choice(this, "is-exhausted");
3307
3355
  const finalize = new LambdaInvoke(this, "finalize", {
@@ -3332,7 +3380,7 @@ var OwningDeleteCascadeWorkflow = class extends Construct21 {
3332
3380
  // Long timeout because real-world cascades can run minutes when
3333
3381
  // a workspace has thousands of members. The stuck-cascade alarm
3334
3382
  // fires at 15 minutes; the state machine itself does not abort.
3335
- timeout: Duration11.hours(2)
3383
+ timeout: Duration12.hours(2)
3336
3384
  });
3337
3385
  this.rule = new Rule5(this, "rule", {
3338
3386
  eventBus: props.dataEventBus,
@@ -3343,7 +3391,7 @@ var OwningDeleteCascadeWorkflow = class extends Construct21 {
3343
3391
  targets: [
3344
3392
  new SfnStateMachine(this.stateMachine, {
3345
3393
  retryAttempts: 2,
3346
- maxEventAge: Duration11.hours(2)
3394
+ maxEventAge: Duration12.hours(2)
3347
3395
  })
3348
3396
  ]
3349
3397
  });
@@ -3353,7 +3401,7 @@ var OwningDeleteCascadeWorkflow = class extends Construct21 {
3353
3401
  // src/workflows/control-plane/rename-cascade/rename-cascade-lambdas.ts
3354
3402
  import fs14 from "fs";
3355
3403
  import path14 from "path";
3356
- import { Duration as Duration12 } from "aws-cdk-lib";
3404
+ import { Duration as Duration13 } from "aws-cdk-lib";
3357
3405
  import { Effect as Effect9, PolicyStatement as PolicyStatement9 } from "aws-cdk-lib/aws-iam";
3358
3406
  import { Runtime as Runtime14 } from "aws-cdk-lib/aws-lambda";
3359
3407
  import { NodejsFunction as NodejsFunction14 } from "aws-cdk-lib/aws-lambda-nodejs";
@@ -3377,7 +3425,7 @@ var RenameCascadeLambdas = class extends Construct22 {
3377
3425
  entry: listResolved.entry,
3378
3426
  runtime: Runtime14.NODEJS_LATEST,
3379
3427
  memorySize: 512,
3380
- timeout: Duration12.minutes(1),
3428
+ timeout: Duration13.minutes(1),
3381
3429
  environment: {
3382
3430
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
3383
3431
  }
@@ -3391,7 +3439,7 @@ var RenameCascadeLambdas = class extends Construct22 {
3391
3439
  entry: rewriteResolved.entry,
3392
3440
  runtime: Runtime14.NODEJS_LATEST,
3393
3441
  memorySize: 512,
3394
- timeout: Duration12.minutes(1),
3442
+ timeout: Duration13.minutes(1),
3395
3443
  environment: {
3396
3444
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
3397
3445
  }
@@ -3410,7 +3458,7 @@ var RenameCascadeLambdas = class extends Construct22 {
3410
3458
  entry: finalizeResolved.entry,
3411
3459
  runtime: Runtime14.NODEJS_LATEST,
3412
3460
  memorySize: 512,
3413
- timeout: Duration12.minutes(1),
3461
+ timeout: Duration13.minutes(1),
3414
3462
  environment: {
3415
3463
  [RENAME_CASCADE_OPS_EVENT_BUS_ENV_VAR]: props.opsEventBus.eventBusName
3416
3464
  }
@@ -3426,7 +3474,7 @@ var RenameCascadeLambdas = class extends Construct22 {
3426
3474
  };
3427
3475
 
3428
3476
  // src/workflows/control-plane/rename-cascade/rename-cascade-workflow.ts
3429
- import { Duration as Duration13 } from "aws-cdk-lib";
3477
+ import { Duration as Duration14 } from "aws-cdk-lib";
3430
3478
  import { Rule as Rule6 } from "aws-cdk-lib/aws-events";
3431
3479
  import { SfnStateMachine as SfnStateMachine2 } from "aws-cdk-lib/aws-events-targets";
3432
3480
  import {
@@ -3585,7 +3633,7 @@ var RenameCascadeWorkflow = class extends Construct23 {
3585
3633
  // Long timeout — large renames may rewrite thousands of rows;
3586
3634
  // the `CascadeSlow` alarm fires at 300s p99 but the state
3587
3635
  // machine itself does not abort.
3588
- timeout: Duration13.hours(2)
3636
+ timeout: Duration14.hours(2)
3589
3637
  });
3590
3638
  this.rule = new Rule6(this, "rule", {
3591
3639
  eventBus: props.dataEventBus,
@@ -3596,7 +3644,7 @@ var RenameCascadeWorkflow = class extends Construct23 {
3596
3644
  targets: [
3597
3645
  new SfnStateMachine2(this.stateMachine, {
3598
3646
  retryAttempts: 2,
3599
- maxEventAge: Duration13.hours(2)
3647
+ maxEventAge: Duration14.hours(2)
3600
3648
  })
3601
3649
  ]
3602
3650
  });