@openhi/constructs 0.0.120 → 0.0.122

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.js CHANGED
@@ -842,6 +842,7 @@ __export(src_exports, {
842
842
  RENAME_CASCADE_OPS_EVENT_BUS_ENV_VAR: () => RENAME_CASCADE_OPS_EVENT_BUS_ENV_VAR,
843
843
  RENAME_CASCADE_SLOW_THRESHOLD_SECONDS: () => RENAME_CASCADE_SLOW_THRESHOLD_SECONDS,
844
844
  REST_API_BASE_URL_SSM_NAME: () => REST_API_BASE_URL_SSM_NAME,
845
+ REST_API_DOMAIN_NAME_SSM_NAME: () => REST_API_DOMAIN_NAME_SSM_NAME,
845
846
  RenameCascadeLambdas: () => RenameCascadeLambdas,
846
847
  RenameCascadeWorkflow: () => RenameCascadeWorkflow,
847
848
  RootGraphqlApi: () => RootGraphqlApi,
@@ -867,6 +868,7 @@ __export(src_exports, {
867
868
  WorkflowDedupTableDuplicateError: () => WorkflowDedupTableDuplicateError,
868
869
  buildFhirCurrentResourceChangeDetail: () => buildFhirCurrentResourceChangeDetail,
869
870
  buildProvisionDefaultWorkspaceRequestedDetail: () => buildProvisionDefaultWorkspaceRequestedDetail,
871
+ computeBranchHash: () => computeBranchHash,
870
872
  demoMembershipId: () => demoMembershipId,
871
873
  demoRoleAssignmentId: () => demoRoleAssignmentId,
872
874
  demoRolesForUserInTenant: () => demoRolesForUserInTenant,
@@ -879,6 +881,16 @@ __export(src_exports, {
879
881
  });
880
882
  module.exports = __toCommonJS(src_exports);
881
883
 
884
+ // src/app/compute-branch-hash.ts
885
+ var import_utils = require("@codedrifters/utils");
886
+ var computeBranchHash = (options) => {
887
+ const { appName, deploymentTargetRole, account, region, branchName } = options;
888
+ return (0, import_utils.hashString)(
889
+ [appName, deploymentTargetRole, account, region, branchName].join("-"),
890
+ 6
891
+ );
892
+ };
893
+
882
894
  // src/app/open-hi-app.ts
883
895
  var import_config2 = __toESM(require_lib());
884
896
  var import_aws_cdk_lib3 = require("aws-cdk-lib");
@@ -1086,7 +1098,7 @@ var OpenHiApp = class _OpenHiApp extends import_aws_cdk_lib3.App {
1086
1098
  };
1087
1099
 
1088
1100
  // src/app/open-hi-service.ts
1089
- var import_utils = require("@codedrifters/utils");
1101
+ var import_utils2 = require("@codedrifters/utils");
1090
1102
  var import_config3 = __toESM(require_lib());
1091
1103
  var import_aws_cdk_lib4 = require("aws-cdk-lib");
1092
1104
  var import_change_case = require("change-case");
@@ -1114,20 +1126,21 @@ var OpenHiService = class extends import_aws_cdk_lib4.Stack {
1114
1126
  );
1115
1127
  }
1116
1128
  const appName = props.appName ?? ohEnv.ohStage.ohApp.appName ?? "openhi";
1117
- const repoName = props.repoName ?? (0, import_utils.findGitRepoName)();
1129
+ const repoName = props.repoName ?? (0, import_utils2.findGitRepoName)();
1118
1130
  const defaultReleaseBranch = props.defaultReleaseBranch ?? "main";
1119
- const branchName = props.branchName ?? (process.env.JEST_WORKER_ID ? "test-branch" : process.env.GIT_BRANCH_NAME?.trim() || (ohEnv.ohStage.stageType === import_config3.OPEN_HI_STAGE.DEV ? (0, import_utils.findGitBranch)() : defaultReleaseBranch));
1120
- const environmentHash = (0, import_utils.hashString)(
1131
+ const branchName = props.branchName ?? (process.env.JEST_WORKER_ID ? "test-branch" : process.env.GIT_BRANCH_NAME?.trim() || (ohEnv.ohStage.stageType === import_config3.OPEN_HI_STAGE.DEV ? (0, import_utils2.findGitBranch)() : defaultReleaseBranch));
1132
+ const environmentHash = (0, import_utils2.hashString)(
1121
1133
  [appName, ohEnv.deploymentTargetRole, account, region].join("-"),
1122
1134
  6
1123
1135
  );
1124
- const branchHash = (0, import_utils.hashString)(
1125
- [appName, ohEnv.deploymentTargetRole, account, region, branchName].join(
1126
- "-"
1127
- ),
1128
- 6
1129
- );
1130
- const releaseBranchHash = (0, import_utils.hashString)(
1136
+ const branchHash = computeBranchHash({
1137
+ appName,
1138
+ deploymentTargetRole: ohEnv.deploymentTargetRole,
1139
+ account,
1140
+ region,
1141
+ branchName
1142
+ });
1143
+ const releaseBranchHash = (0, import_utils2.hashString)(
1131
1144
  [
1132
1145
  appName,
1133
1146
  ohEnv.deploymentTargetRole,
@@ -1137,7 +1150,7 @@ var OpenHiService = class extends import_aws_cdk_lib4.Stack {
1137
1150
  ].join("-"),
1138
1151
  6
1139
1152
  );
1140
- const stackHash = (0, import_utils.hashString)(
1153
+ const stackHash = (0, import_utils2.hashString)(
1141
1154
  [
1142
1155
  appName,
1143
1156
  ohEnv.deploymentTargetRole,
@@ -1411,7 +1424,10 @@ var CognitoUserPoolClient = class extends import_aws_cognito2.UserPoolClient {
1411
1424
  authorizationCodeGrant: true,
1412
1425
  implicitCodeGrant: true
1413
1426
  },
1414
- callbackUrls: [`https://localhost:3000/oauth/callback`]
1427
+ callbackUrls: [
1428
+ `http://localhost:3000/oauth/callback`,
1429
+ `https://localhost:3000/oauth/callback`
1430
+ ]
1415
1431
  },
1416
1432
  /**
1417
1433
  * Overrideable props
@@ -2189,6 +2205,7 @@ var DataStorePostgresReplica = class extends import_constructs6.Construct {
2189
2205
  this.databaseName = props.databaseName ?? DEFAULT_DATABASE_NAME;
2190
2206
  this.schemaName = getPostgresReplicaSchemaName(props.branchHash);
2191
2207
  const region = import_aws_cdk_lib9.Stack.of(this).region;
2208
+ const ownsVpc = props.vpc === void 0;
2192
2209
  this.vpc = props.vpc ?? new ec2.Vpc(this, "Vpc", {
2193
2210
  availabilityZones: [`${region}a`, `${region}b`],
2194
2211
  natGateways: 0,
@@ -2200,6 +2217,14 @@ var DataStorePostgresReplica = class extends import_constructs6.Construct {
2200
2217
  }
2201
2218
  ]
2202
2219
  });
2220
+ if (ownsVpc) {
2221
+ new ec2.InterfaceVpcEndpoint(this, "SecretsManagerEndpoint", {
2222
+ vpc: this.vpc,
2223
+ service: ec2.InterfaceVpcEndpointAwsService.SECRETS_MANAGER,
2224
+ subnets: { subnetType: ec2.SubnetType.PRIVATE_ISOLATED },
2225
+ privateDnsEnabled: true
2226
+ });
2227
+ }
2203
2228
  this.cluster = new rds.DatabaseCluster(this, "Cluster", {
2204
2229
  clusterIdentifier: `openhi-dstore-pg-${props.stackHash}`,
2205
2230
  engine: rds.DatabaseClusterEngine.auroraPostgres({
@@ -2406,6 +2431,10 @@ var _StaticHosting = class _StaticHosting extends import_constructs9.Construct {
2406
2431
  originAccessLevels: [import_aws_cloudfront.AccessLevel.READ]
2407
2432
  });
2408
2433
  const hasCustomDomain = props.certificate !== void 0 && props.hostedZone !== void 0 && props.domainNames !== void 0 && props.domainNames.length > 0;
2434
+ const additionalBehaviors = this.buildRestApiBehaviors(
2435
+ stack.branchHash,
2436
+ props.restApi
2437
+ );
2409
2438
  this.distribution = new import_aws_cloudfront.Distribution(this, "distribution", {
2410
2439
  comment: `Static hosting distribution for ${props.description ?? id}`,
2411
2440
  ...hasCustomDomain ? {
@@ -2426,6 +2455,7 @@ var _StaticHosting = class _StaticHosting extends import_constructs9.Construct {
2426
2455
  }
2427
2456
  ]
2428
2457
  },
2458
+ ...additionalBehaviors !== void 0 && { additionalBehaviors },
2429
2459
  ...props.distributionProps
2430
2460
  });
2431
2461
  if (hasCustomDomain) {
@@ -2464,6 +2494,51 @@ var _StaticHosting = class _StaticHosting extends import_constructs9.Construct {
2464
2494
  description: `Static hosting distribution ID (${props.description ?? id})`
2465
2495
  });
2466
2496
  }
2497
+ /**
2498
+ * Builds the `/api/*` and `/api/control/runtime-config` behaviors backed
2499
+ * by the REST API custom-domain origin. Returns `undefined` when no
2500
+ * `restApi` prop is supplied so the Distribution stays S3-only.
2501
+ */
2502
+ buildRestApiBehaviors(branchHash, restApi) {
2503
+ if (restApi === void 0) {
2504
+ return void 0;
2505
+ }
2506
+ const apiOrigin = new import_aws_cloudfront_origins.HttpOrigin(restApi.domainName, {
2507
+ protocolPolicy: import_aws_cloudfront.OriginProtocolPolicy.HTTPS_ONLY
2508
+ });
2509
+ const runtimeConfigCachePolicy = new import_aws_cloudfront.CachePolicy(
2510
+ this,
2511
+ "runtime-config-cache-policy",
2512
+ {
2513
+ cachePolicyName: `static-hosting-runtime-config-${branchHash}`,
2514
+ comment: "/api/control/runtime-config: cache key includes only `v` so the bundle's deploy-hash bust works automatically.",
2515
+ defaultTtl: restApi.runtimeConfigCacheTtl?.defaultTtl ?? import_aws_cdk_lib11.Duration.minutes(5),
2516
+ minTtl: import_aws_cdk_lib11.Duration.seconds(0),
2517
+ maxTtl: restApi.runtimeConfigCacheTtl?.maxTtl ?? import_aws_cdk_lib11.Duration.hours(1),
2518
+ headerBehavior: import_aws_cloudfront.CacheHeaderBehavior.none(),
2519
+ queryStringBehavior: import_aws_cloudfront.CacheQueryStringBehavior.allowList("v"),
2520
+ cookieBehavior: import_aws_cloudfront.CacheCookieBehavior.none(),
2521
+ enableAcceptEncodingGzip: true,
2522
+ enableAcceptEncodingBrotli: true
2523
+ }
2524
+ );
2525
+ return {
2526
+ "/api/control/runtime-config": {
2527
+ origin: apiOrigin,
2528
+ viewerProtocolPolicy: import_aws_cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
2529
+ allowedMethods: import_aws_cloudfront.AllowedMethods.ALLOW_GET_HEAD_OPTIONS,
2530
+ cachePolicy: runtimeConfigCachePolicy,
2531
+ originRequestPolicy: import_aws_cloudfront.OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER
2532
+ },
2533
+ "/api/*": {
2534
+ origin: apiOrigin,
2535
+ viewerProtocolPolicy: import_aws_cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
2536
+ allowedMethods: import_aws_cloudfront.AllowedMethods.ALLOW_ALL,
2537
+ cachePolicy: import_aws_cloudfront.CachePolicy.CACHING_DISABLED,
2538
+ originRequestPolicy: import_aws_cloudfront.OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER
2539
+ }
2540
+ };
2541
+ }
2467
2542
  };
2468
2543
  /**
2469
2544
  * SSM parameter name for the S3 bucket ARN.
@@ -6825,6 +6900,7 @@ var import_aws_iam7 = require("aws-cdk-lib/aws-iam");
6825
6900
  var import_aws_route534 = require("aws-cdk-lib/aws-route53");
6826
6901
  var import_aws_route53_targets2 = require("aws-cdk-lib/aws-route53-targets");
6827
6902
  var import_core2 = require("aws-cdk-lib/core");
6903
+ var import_constructs20 = require("constructs");
6828
6904
 
6829
6905
  // src/data/lambda/cors-options-lambda.ts
6830
6906
  var import_node_fs10 = __toESM(require("fs"));
@@ -6881,7 +6957,8 @@ var RestApiLambda = class extends import_constructs19.Construct {
6881
6957
  OPENHI_PG_CLUSTER_ARN: props.postgresClusterArn,
6882
6958
  OPENHI_PG_SECRET_ARN: props.postgresSecretArn,
6883
6959
  OPENHI_PG_DATABASE: props.postgresDatabase,
6884
- OPENHI_PG_SCHEMA: props.postgresSchema
6960
+ OPENHI_PG_SCHEMA: props.postgresSchema,
6961
+ ...props.extraEnvironment
6885
6962
  },
6886
6963
  bundling: {
6887
6964
  minify: true,
@@ -6893,6 +6970,7 @@ var RestApiLambda = class extends import_constructs19.Construct {
6893
6970
 
6894
6971
  // src/services/open-hi-rest-api-service.ts
6895
6972
  var REST_API_BASE_URL_SSM_NAME = "REST_API_BASE_URL";
6973
+ var REST_API_DOMAIN_NAME_SSM_NAME = "REST_API_DOMAIN_NAME";
6896
6974
  var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
6897
6975
  /**
6898
6976
  * Returns an IHttpApi by looking up the REST API stack's HTTP API ID from SSM.
@@ -6914,6 +6992,18 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
6914
6992
  serviceType: _OpenHiRestApiService.SERVICE_TYPE
6915
6993
  });
6916
6994
  }
6995
+ /**
6996
+ * Returns the REST API's custom domain name (bare hostname, no scheme — e.g.
6997
+ * `api.example.com`) by looking it up from SSM. Use as the host for a
6998
+ * CloudFront `HttpOrigin` so the website's distribution can proxy `/api/*`
6999
+ * to this stack's API Gateway without per-branch DNS knowledge.
7000
+ */
7001
+ static restApiDomainNameFromConstruct(scope) {
7002
+ return DiscoverableStringParameter.valueForLookupName(scope, {
7003
+ ssmParamName: REST_API_DOMAIN_NAME_SSM_NAME,
7004
+ serviceType: _OpenHiRestApiService.SERVICE_TYPE
7005
+ });
7006
+ }
6917
7007
  get serviceType() {
6918
7008
  return _OpenHiRestApiService.SERVICE_TYPE;
6919
7009
  }
@@ -6925,6 +7015,7 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
6925
7015
  const certificate = this.createCertificate();
6926
7016
  const apiDomainName = this.createApiDomainNameString(hostedZone);
6927
7017
  this.createRestApiBaseUrlParameter(apiDomainName);
7018
+ this.createRestApiDomainNameParameter(apiDomainName);
6928
7019
  const domainName = this.createDomainName(hostedZone, certificate);
6929
7020
  this.rootHttpApi = this.createRootHttpApi(domainName);
6930
7021
  this.createRestApiLambdaAndRoutes(hostedZone, domainName);
@@ -6983,6 +7074,20 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
6983
7074
  description: "REST API base URL for this deployment (E2E, scripts)"
6984
7075
  });
6985
7076
  }
7077
+ /**
7078
+ * Creates the SSM parameter exposing the REST API's custom domain (bare
7079
+ * hostname, no scheme). Consumed by the website service as the CloudFront
7080
+ * `/api/*` origin host.
7081
+ * Look up via {@link OpenHiRestApiService.restApiDomainNameFromConstruct}.
7082
+ * Override to customize.
7083
+ */
7084
+ createRestApiDomainNameParameter(apiDomainName) {
7085
+ new DiscoverableStringParameter(this, "rest-api-domain-name-param", {
7086
+ ssmParamName: REST_API_DOMAIN_NAME_SSM_NAME,
7087
+ stringValue: apiDomainName,
7088
+ description: "REST API custom domain name (bare hostname) for cross-stack CloudFront origin lookup"
7089
+ });
7090
+ }
6986
7091
  /**
6987
7092
  * Creates the API Gateway custom domain name resource.
6988
7093
  * Override to customize.
@@ -7004,6 +7109,7 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
7004
7109
  const postgresSecretArn = DataStorePostgresReplica.secretArnFromConstruct(this);
7005
7110
  const postgresDatabase = DataStorePostgresReplica.databaseNameFromConstruct(this);
7006
7111
  const postgresSchema = getPostgresReplicaSchemaName(this.branchHash);
7112
+ const extraEnvironment = this.resolveRuntimeConfigEnvVars();
7007
7113
  const { lambda } = new RestApiLambda(this, {
7008
7114
  dynamoTableName: dataStoreTable.tableName,
7009
7115
  branchTagValue: this.branchName,
@@ -7011,7 +7117,8 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
7011
7117
  postgresClusterArn,
7012
7118
  postgresSecretArn,
7013
7119
  postgresDatabase,
7014
- postgresSchema
7120
+ postgresSchema,
7121
+ ...extraEnvironment !== void 0 && { extraEnvironment }
7015
7122
  });
7016
7123
  lambda.addToRolePolicy(
7017
7124
  new import_aws_iam7.PolicyStatement({
@@ -7152,6 +7259,32 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
7152
7259
  });
7153
7260
  return rootHttpApi;
7154
7261
  }
7262
+ /**
7263
+ * Builds the `OPENHI_RUNTIME_CONFIG_*` env-var map the REST API Lambda
7264
+ * exposes through `GET /control/runtime-config`. Returns `undefined` when
7265
+ * the `runtimeConfig` prop is omitted so no env vars are set.
7266
+ *
7267
+ * The three Cognito IDs are resolved via SSM lookups against the auth
7268
+ * stack from a dedicated sub-scope (`runtime-config`) so they don't
7269
+ * collide with the user-pool / user-pool-client constructs already
7270
+ * created in {@link createRootHttpApi}.
7271
+ */
7272
+ resolveRuntimeConfigEnvVars() {
7273
+ if (this.props.runtimeConfig === void 0) {
7274
+ return void 0;
7275
+ }
7276
+ const cognitoScope = new import_constructs20.Construct(this, "runtime-config");
7277
+ const userPool = OpenHiAuthService.userPoolFromConstruct(cognitoScope);
7278
+ const userPoolClient = OpenHiAuthService.userPoolClientFromConstruct(cognitoScope);
7279
+ const userPoolDomain = OpenHiAuthService.userPoolDomainFromConstruct(cognitoScope);
7280
+ return {
7281
+ OPENHI_RUNTIME_CONFIG_COGNITO_USER_POOL_ID: userPool.userPoolId,
7282
+ OPENHI_RUNTIME_CONFIG_COGNITO_USER_POOL_CLIENT_ID: userPoolClient.userPoolClientId,
7283
+ OPENHI_RUNTIME_CONFIG_COGNITO_DOMAIN: userPoolDomain.domainName,
7284
+ OPENHI_RUNTIME_CONFIG_COGNITO_REDIRECT_URI: this.props.runtimeConfig.cognitoRedirectUri,
7285
+ OPENHI_RUNTIME_CONFIG_API_BASE_URL: this.props.runtimeConfig.apiBaseUrl
7286
+ };
7287
+ }
7155
7288
  };
7156
7289
  _OpenHiRestApiService.SERVICE_TYPE = "rest-api";
7157
7290
  var OpenHiRestApiService = _OpenHiRestApiService;
@@ -7266,7 +7399,8 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
7266
7399
  this.createFullDomainParameter();
7267
7400
  }
7268
7401
  if (props.createStaticContent !== false) {
7269
- this.staticContent = this.createStaticContent();
7402
+ const bucket = this.resolveStaticHostingBucket();
7403
+ this.staticContent = this.createStaticContent(bucket);
7270
7404
  }
7271
7405
  }
7272
7406
  /**
@@ -7317,14 +7451,26 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
7317
7451
  * Lambda@Edge + 4 SSM params + DNS).
7318
7452
  */
7319
7453
  createStaticHosting(deps) {
7454
+ const restApi = this.props.restApi === true ? this.resolveRestApi() : void 0;
7320
7455
  return new StaticHosting(this, "static-hosting", {
7321
7456
  serviceType: _OpenHiWebsiteService.SERVICE_TYPE,
7322
7457
  certificate: deps.certificate,
7323
7458
  hostedZone: deps.hostedZone,
7324
7459
  domainNames: [this.fullDomain],
7325
- description: `OpenHI website (${this.fullDomain})`
7460
+ description: `OpenHI website (${this.fullDomain})`,
7461
+ ...restApi !== void 0 && { restApi }
7326
7462
  });
7327
7463
  }
7464
+ /**
7465
+ * Resolves the REST API custom-domain hostname from the rest-api stack's
7466
+ * `REST_API_DOMAIN_NAME` SSM parameter. Wrapped in a private method so
7467
+ * it can be overridden / stubbed in subclasses and tests.
7468
+ */
7469
+ resolveRestApi() {
7470
+ return {
7471
+ domainName: OpenHiRestApiService.restApiDomainNameFromConstruct(this)
7472
+ };
7473
+ }
7328
7474
  /**
7329
7475
  * Creates the SSM parameter that publishes the website's full domain.
7330
7476
  * Look up via {@link OpenHiWebsiteService.fullDomainFromConstruct}.
@@ -7338,21 +7484,18 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
7338
7484
  });
7339
7485
  }
7340
7486
  /**
7341
- * Creates the StaticContent uploader. Always created so feature-branch
7342
- * deploys can publish content to their own sub-domain folder against the
7343
- * release-branch bucket.
7344
- *
7345
- * The destination bucket is resolved here so the construct never has to
7346
- * branch on release-vs-feature: on the release branch we pass the
7347
- * just-created {@link staticHosting} bucket directly (no SSM round-trip
7348
- * within a single stack); on every other branch we look up the bucket
7349
- * ARN published by the release-branch deploy, addressed against
7350
- * {@link OpenHiService.releaseBranchHash}.
7487
+ * Creates the StaticContent uploader. Receives the resolved static-hosting
7488
+ * bucket from the constructor on the release-branch deploy this is the
7489
+ * just-created {@link staticHosting} bucket (no SSM round-trip within a
7490
+ * single stack); on every other deploy it is imported from the bucket ARN
7491
+ * the release-branch deploy publishes to SSM, addressed against
7492
+ * {@link OpenHiService.releaseBranchHash}. See
7493
+ * {@link resolveStaticHostingBucket}.
7351
7494
  */
7352
- createStaticContent() {
7495
+ createStaticContent(bucket) {
7353
7496
  const { contentSourceDirectory, contentDestinationDirectory } = this.props;
7354
7497
  return new StaticContent(this, "static-content", {
7355
- bucket: this.resolveStaticHostingBucket(),
7498
+ bucket,
7356
7499
  contentSourceDirectory,
7357
7500
  contentDestinationDirectory,
7358
7501
  fullDomain: this.fullDomain
@@ -7360,7 +7503,7 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
7360
7503
  }
7361
7504
  /**
7362
7505
  * Returns an {@link IBucket} pointing at the static-hosting bucket the
7363
- * uploader writes to. On the release-branch deploy this is the bucket
7506
+ * uploaders write to. On the release-branch deploy this is the bucket
7364
7507
  * just provisioned by {@link staticHosting}; on every other deploy it's
7365
7508
  * imported from the bucket ARN the release-branch deploy publishes to
7366
7509
  * SSM, addressed against {@link OpenHiService.releaseBranchHash}.
@@ -7394,7 +7537,7 @@ var import_aws_cdk_lib16 = require("aws-cdk-lib");
7394
7537
  var import_aws_iam8 = require("aws-cdk-lib/aws-iam");
7395
7538
  var import_aws_lambda13 = require("aws-cdk-lib/aws-lambda");
7396
7539
  var import_aws_lambda_nodejs13 = require("aws-cdk-lib/aws-lambda-nodejs");
7397
- var import_constructs20 = require("constructs");
7540
+ var import_constructs21 = require("constructs");
7398
7541
  function resolveHandlerEntry12(dirname, handlerName) {
7399
7542
  const sameDir = import_node_path12.default.join(dirname, handlerName);
7400
7543
  if (import_node_fs12.default.existsSync(sameDir)) {
@@ -7403,7 +7546,7 @@ function resolveHandlerEntry12(dirname, handlerName) {
7403
7546
  const libDir = import_node_path12.default.join(dirname, "..", "..", "..", "..", "lib", handlerName);
7404
7547
  return { entry: libDir, handler: "handler" };
7405
7548
  }
7406
- var OwningDeleteCascadeLambdas = class extends import_constructs20.Construct {
7549
+ var OwningDeleteCascadeLambdas = class extends import_constructs21.Construct {
7407
7550
  constructor(scope, props) {
7408
7551
  super(scope, "owning-delete-cascade-lambdas");
7409
7552
  const listResolved = resolveHandlerEntry12(
@@ -7470,8 +7613,8 @@ var import_aws_events9 = require("aws-cdk-lib/aws-events");
7470
7613
  var import_aws_events_targets5 = require("aws-cdk-lib/aws-events-targets");
7471
7614
  var import_aws_stepfunctions = require("aws-cdk-lib/aws-stepfunctions");
7472
7615
  var import_aws_stepfunctions_tasks = require("aws-cdk-lib/aws-stepfunctions-tasks");
7473
- var import_constructs21 = require("constructs");
7474
- var OwningDeleteCascadeWorkflow = class extends import_constructs21.Construct {
7616
+ var import_constructs22 = require("constructs");
7617
+ var OwningDeleteCascadeWorkflow = class extends import_constructs22.Construct {
7475
7618
  constructor(scope, props) {
7476
7619
  super(scope, "owning-delete-cascade-workflow");
7477
7620
  this.lambdas = new OwningDeleteCascadeLambdas(this, {
@@ -7644,7 +7787,7 @@ var import_aws_cdk_lib18 = require("aws-cdk-lib");
7644
7787
  var import_aws_iam9 = require("aws-cdk-lib/aws-iam");
7645
7788
  var import_aws_lambda14 = require("aws-cdk-lib/aws-lambda");
7646
7789
  var import_aws_lambda_nodejs14 = require("aws-cdk-lib/aws-lambda-nodejs");
7647
- var import_constructs22 = require("constructs");
7790
+ var import_constructs23 = require("constructs");
7648
7791
  function resolveHandlerEntry13(dirname, handlerName) {
7649
7792
  const sameDir = import_node_path13.default.join(dirname, handlerName);
7650
7793
  if (import_node_fs13.default.existsSync(sameDir)) {
@@ -7653,7 +7796,7 @@ function resolveHandlerEntry13(dirname, handlerName) {
7653
7796
  const libDir = import_node_path13.default.join(dirname, "..", "..", "..", "..", "lib", handlerName);
7654
7797
  return { entry: libDir, handler: "handler" };
7655
7798
  }
7656
- var RenameCascadeLambdas = class extends import_constructs22.Construct {
7799
+ var RenameCascadeLambdas = class extends import_constructs23.Construct {
7657
7800
  constructor(scope, props) {
7658
7801
  super(scope, "rename-cascade-lambdas");
7659
7802
  const listResolved = resolveHandlerEntry13(
@@ -7718,8 +7861,8 @@ var import_aws_events10 = require("aws-cdk-lib/aws-events");
7718
7861
  var import_aws_events_targets6 = require("aws-cdk-lib/aws-events-targets");
7719
7862
  var import_aws_stepfunctions2 = require("aws-cdk-lib/aws-stepfunctions");
7720
7863
  var import_aws_stepfunctions_tasks2 = require("aws-cdk-lib/aws-stepfunctions-tasks");
7721
- var import_constructs23 = require("constructs");
7722
- var RenameCascadeWorkflow = class extends import_constructs23.Construct {
7864
+ var import_constructs24 = require("constructs");
7865
+ var RenameCascadeWorkflow = class extends import_constructs24.Construct {
7723
7866
  constructor(scope, props) {
7724
7867
  super(scope, "rename-cascade-workflow");
7725
7868
  this.lambdas = new RenameCascadeLambdas(this, {
@@ -7958,6 +8101,7 @@ var RenameCascadeWorkflow = class extends import_constructs23.Construct {
7958
8101
  RENAME_CASCADE_OPS_EVENT_BUS_ENV_VAR,
7959
8102
  RENAME_CASCADE_SLOW_THRESHOLD_SECONDS,
7960
8103
  REST_API_BASE_URL_SSM_NAME,
8104
+ REST_API_DOMAIN_NAME_SSM_NAME,
7961
8105
  RenameCascadeLambdas,
7962
8106
  RenameCascadeWorkflow,
7963
8107
  RootGraphqlApi,
@@ -7983,6 +8127,7 @@ var RenameCascadeWorkflow = class extends import_constructs23.Construct {
7983
8127
  WorkflowDedupTableDuplicateError,
7984
8128
  buildFhirCurrentResourceChangeDetail,
7985
8129
  buildProvisionDefaultWorkspaceRequestedDetail,
8130
+ computeBranchHash,
7986
8131
  demoMembershipId,
7987
8132
  demoRoleAssignmentId,
7988
8133
  demoRolesForUserInTenant,