@fjall/components-infrastructure 2.30.3 → 2.32.0

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.
Files changed (118) hide show
  1. package/dist/lib/app.d.ts +27 -1
  2. package/dist/lib/app.js +35 -4
  3. package/dist/lib/config/aws/identityCenterMembership.d.ts +11 -0
  4. package/dist/lib/config/aws/identityCenterMembership.js +61 -0
  5. package/dist/lib/config/aws/oidcConnector.js +11 -3
  6. package/dist/lib/lambda-assets/cert-generator/asset/index.js +12 -3
  7. package/dist/lib/patterns/aws/compute.d.ts +2 -2
  8. package/dist/lib/patterns/aws/compute.js +18 -9
  9. package/dist/lib/patterns/aws/computeLambda.d.ts +15 -1
  10. package/dist/lib/patterns/aws/computeLambda.js +18 -2
  11. package/dist/lib/patterns/aws/computePropApplicability.d.ts +20 -0
  12. package/dist/lib/patterns/aws/computePropApplicability.js +87 -0
  13. package/dist/lib/patterns/aws/database.d.ts +19 -1
  14. package/dist/lib/patterns/aws/database.js +22 -3
  15. package/dist/lib/patterns/aws/devSubstrate.d.ts +85 -0
  16. package/dist/lib/patterns/aws/devSubstrate.js +390 -0
  17. package/dist/lib/patterns/aws/devSubstrate.waker.source.cjs +13 -0
  18. package/dist/lib/resources/aws/compute/applicationLoadBalancer.d.ts +17 -0
  19. package/dist/lib/resources/aws/compute/applicationLoadBalancer.js +23 -0
  20. package/dist/lib/resources/aws/compute/ecsImages.js +7 -2
  21. package/dist/lib/resources/aws/compute/ecsNetworking.d.ts +4 -10
  22. package/dist/lib/resources/aws/compute/ecsNetworking.js +13 -48
  23. package/dist/lib/resources/aws/compute/ecsRoles.d.ts +25 -0
  24. package/dist/lib/resources/aws/compute/ecsRoles.js +39 -20
  25. package/dist/lib/resources/aws/compute/hostHeaderListenerRule.d.ts +23 -0
  26. package/dist/lib/resources/aws/compute/hostHeaderListenerRule.js +59 -0
  27. package/dist/lib/resources/aws/compute/imageTagParameter.d.ts +18 -1
  28. package/dist/lib/resources/aws/compute/imageTagParameter.js +32 -2
  29. package/dist/lib/resources/aws/compute/lambda.d.ts +1 -1
  30. package/dist/lib/resources/aws/compute/lambda.js +6 -4
  31. package/dist/lib/resources/aws/compute/lambdaAlbTarget.d.ts +17 -0
  32. package/dist/lib/resources/aws/compute/lambdaAlbTarget.js +18 -0
  33. package/dist/lib/resources/aws/compute/listenerRouting.d.ts +21 -0
  34. package/dist/lib/resources/aws/compute/listenerRouting.js +20 -0
  35. package/dist/lib/resources/aws/database/rdsAurora.d.ts +16 -0
  36. package/dist/lib/resources/aws/database/rdsAurora.js +57 -3
  37. package/dist/lib/resources/aws/database/rdsDefaults.d.ts +28 -0
  38. package/dist/lib/resources/aws/database/rdsDefaults.js +28 -0
  39. package/dist/lib/resources/aws/iam/identityCenter/user.js +5 -1
  40. package/dist/lib/resources/aws/logging/index.d.ts +1 -0
  41. package/dist/lib/resources/aws/logging/index.js +1 -0
  42. package/dist/lib/resources/aws/logging/logGroup.d.ts +7 -0
  43. package/dist/lib/resources/aws/logging/logGroup.js +7 -0
  44. package/dist/lib/resources/aws/logging/singletonLogGroup.d.ts +15 -0
  45. package/dist/lib/resources/aws/logging/singletonLogGroup.js +24 -0
  46. package/dist/lib/resources/aws/networking/vpcPeeringConnection.js +2 -1
  47. package/dist/lib/resources/aws/storage/bucketDeployment.d.ts +5 -6
  48. package/dist/lib/resources/aws/storage/bucketDeployment.js +14 -7
  49. package/dist/lib/resources/aws/utilities/awsCustomResource.js +5 -0
  50. package/dist/lib/resources/aws/utilities/customResource.js +5 -1
  51. package/dist/lib/utils/addSuffixToEmail.js +1 -5
  52. package/dist/lib/utils/devSubstrateTags.d.ts +22 -0
  53. package/dist/lib/utils/devSubstrateTags.js +22 -0
  54. package/dist/lib/utils/validationLogger.d.ts +2 -2
  55. package/dist/lib/utils/validationLogger.js +4 -4
  56. package/package.json +5 -5
  57. package/dist/lib/__tests__/setup.d.ts +0 -48
  58. package/dist/lib/__tests__/setup.js +0 -1
  59. package/dist/lib/config/aws/accountId.d.ts +0 -6
  60. package/dist/lib/config/aws/accountId.js +0 -33
  61. package/dist/lib/config/aws/backupGlobalSettings.d.ts +0 -29
  62. package/dist/lib/config/aws/backupGlobalSettings.js +0 -51
  63. package/dist/lib/config/aws/costAllocationTags.d.ts +0 -12
  64. package/dist/lib/config/aws/costAllocationTags.js +0 -48
  65. package/dist/lib/config/aws/eventBus.d.ts +0 -7
  66. package/dist/lib/config/aws/eventBus.js +0 -24
  67. package/dist/lib/config/aws/identityCenterGroupMembership.d.ts +0 -10
  68. package/dist/lib/config/aws/identityCenterGroupMembership.js +0 -115
  69. package/dist/lib/config/aws/ipamDelegateAdmin.d.ts +0 -8
  70. package/dist/lib/config/aws/ipamDelegateAdmin.js +0 -58
  71. package/dist/lib/config/aws/ipamPoolId.d.ts +0 -10
  72. package/dist/lib/config/aws/ipamPoolId.js +0 -39
  73. package/dist/lib/config/aws/organisation.d.ts +0 -30
  74. package/dist/lib/config/aws/organisation.js +0 -95
  75. package/dist/lib/config/aws/organisationId.d.ts +0 -7
  76. package/dist/lib/config/aws/organisationId.js +0 -46
  77. package/dist/lib/config/aws/organisationsAccess.d.ts +0 -10
  78. package/dist/lib/config/aws/organisationsAccess.js +0 -50
  79. package/dist/lib/config/aws/ramSharing.d.ts +0 -4
  80. package/dist/lib/config/aws/ramSharing.js +0 -35
  81. package/dist/lib/config/monitoring.d.ts +0 -18
  82. package/dist/lib/config/monitoring.js +0 -22
  83. package/dist/lib/patterns/aws/cicdRole.d.ts +0 -67
  84. package/dist/lib/patterns/aws/cicdRole.js +0 -68
  85. package/dist/lib/patterns/aws/hostedZone.d.ts +0 -28
  86. package/dist/lib/patterns/aws/hostedZone.js +0 -150
  87. package/dist/lib/patterns/aws/managedAccount.d.ts +0 -9
  88. package/dist/lib/patterns/aws/managedAccount.js +0 -55
  89. package/dist/lib/patterns/aws/managedIdentityCenter.d.ts +0 -4
  90. package/dist/lib/patterns/aws/managedIdentityCenter.js +0 -24
  91. package/dist/lib/patterns/aws/managedOrganisation.d.ts +0 -36
  92. package/dist/lib/patterns/aws/managedOrganisation.js +0 -97
  93. package/dist/lib/patterns/aws/managedPlatform.d.ts +0 -12
  94. package/dist/lib/patterns/aws/managedPlatform.js +0 -29
  95. package/dist/lib/patterns/aws/subdomainHostedZone.d.ts +0 -9
  96. package/dist/lib/patterns/aws/subdomainHostedZone.js +0 -39
  97. package/dist/lib/resources/aws/cicd/cicdRole.d.ts +0 -65
  98. package/dist/lib/resources/aws/cicd/cicdRole.js +0 -191
  99. package/dist/lib/resources/aws/compute/ecsFreeTier.d.ts +0 -75
  100. package/dist/lib/resources/aws/compute/ecsFreeTier.js +0 -1
  101. package/dist/lib/resources/aws/compute/ecsSpot.d.ts +0 -75
  102. package/dist/lib/resources/aws/compute/ecsSpot.js +0 -1
  103. package/dist/lib/resources/aws/compute/utilities/capacityProviderDrainWaiter.d.ts +0 -20
  104. package/dist/lib/resources/aws/compute/utilities/capacityProviderDrainWaiter.js +0 -1
  105. package/dist/lib/resources/aws/database/database.d.ts +0 -14
  106. package/dist/lib/resources/aws/database/database.js +0 -28
  107. package/dist/lib/resources/aws/database/databaseInstance.d.ts +0 -15
  108. package/dist/lib/resources/aws/database/databaseInstance.js +0 -30
  109. package/dist/lib/resources/aws/iam/identityCenter/attachManagedPolicy.d.ts +0 -13
  110. package/dist/lib/resources/aws/iam/identityCenter/attachManagedPolicy.js +0 -52
  111. package/dist/lib/resources/aws/iam/securityGroup.d.ts +0 -5
  112. package/dist/lib/resources/aws/iam/securityGroup.js +0 -14
  113. package/dist/lib/resources/aws/monitoring/monitoringRole.d.ts +0 -28
  114. package/dist/lib/resources/aws/monitoring/monitoringRole.js +0 -125
  115. package/dist/lib/resources/aws/utilities/cfnOutput.d.ts +0 -5
  116. package/dist/lib/resources/aws/utilities/cfnOutput.js +0 -1
  117. package/dist/lib/utils/capitalizeString.d.ts +0 -1
  118. package/dist/lib/utils/capitalizeString.js +0 -7
@@ -11,3 +11,31 @@ export declare const RDS_DEFAULTS: Readonly<{
11
11
  /** Default storage autoscaling ceiling (GiB) — applied to primary and replica */
12
12
  readonly DEFAULT_MAX_ALLOCATED_STORAGE_GIB: 500;
13
13
  }>;
14
+ /**
15
+ * Serverless-v2 defaults for the internal dev substrate's shared Aurora cluster
16
+ * (fast dev-envs Phase 3). `min 0` ACU scales the shared cluster to zero when
17
+ * idle; `enableDataApi` lets slot DDL run over HTTPS with no VPC connection, and
18
+ * is the only mode under which min-0 actually saves (a live pooled connection
19
+ * pins the cluster above 0 ACU). Engine 16.6 satisfies the auto-pause-capable
20
+ * floor (see `MIN_AUTO_PAUSE_POSTGRES_VERSION`).
21
+ */
22
+ export declare const DEV_AURORA_DEFAULTS: Readonly<{
23
+ readonly SERVERLESS_V2_MIN_CAPACITY: 0;
24
+ readonly SERVERLESS_V2_MAX_CAPACITY: 4;
25
+ readonly AUTO_PAUSE_SECONDS: 1200;
26
+ readonly ENABLE_DATA_API: true;
27
+ readonly ENGINE_VERSION: "16.6";
28
+ }>;
29
+ /**
30
+ * Bounds AWS enforces on `ServerlessV2ScalingConfiguration.SecondsUntilAutoPause`
31
+ * (5 minutes – 24 hours). A value outside this range synths but is rejected at
32
+ * deploy, so the resources layer validates it at synth instead.
33
+ */
34
+ export declare const SERVERLESS_V2_AUTO_PAUSE_MIN_SECONDS = 300;
35
+ export declare const SERVERLESS_V2_AUTO_PAUSE_MAX_SECONDS = 86400;
36
+ /**
37
+ * Minimum Aurora PostgreSQL version that supports serverless-v2 auto-pause
38
+ * (`serverlessV2MinCapacity` 0). An explicit override below this synths clean
39
+ * but AccessDenies / rejects at deploy, so the resources layer hard-guards it.
40
+ */
41
+ export declare const MIN_AUTO_PAUSE_POSTGRES_VERSION = "16.3";
@@ -11,3 +11,31 @@ export const RDS_DEFAULTS = Object.freeze({
11
11
  /** Default storage autoscaling ceiling (GiB) — applied to primary and replica */
12
12
  DEFAULT_MAX_ALLOCATED_STORAGE_GIB: 500
13
13
  });
14
+ /**
15
+ * Serverless-v2 defaults for the internal dev substrate's shared Aurora cluster
16
+ * (fast dev-envs Phase 3). `min 0` ACU scales the shared cluster to zero when
17
+ * idle; `enableDataApi` lets slot DDL run over HTTPS with no VPC connection, and
18
+ * is the only mode under which min-0 actually saves (a live pooled connection
19
+ * pins the cluster above 0 ACU). Engine 16.6 satisfies the auto-pause-capable
20
+ * floor (see `MIN_AUTO_PAUSE_POSTGRES_VERSION`).
21
+ */
22
+ export const DEV_AURORA_DEFAULTS = Object.freeze({
23
+ SERVERLESS_V2_MIN_CAPACITY: 0,
24
+ SERVERLESS_V2_MAX_CAPACITY: 4,
25
+ AUTO_PAUSE_SECONDS: 1200,
26
+ ENABLE_DATA_API: true,
27
+ ENGINE_VERSION: "16.6"
28
+ });
29
+ /**
30
+ * Bounds AWS enforces on `ServerlessV2ScalingConfiguration.SecondsUntilAutoPause`
31
+ * (5 minutes – 24 hours). A value outside this range synths but is rejected at
32
+ * deploy, so the resources layer validates it at synth instead.
33
+ */
34
+ export const SERVERLESS_V2_AUTO_PAUSE_MIN_SECONDS = 300;
35
+ export const SERVERLESS_V2_AUTO_PAUSE_MAX_SECONDS = 86400;
36
+ /**
37
+ * Minimum Aurora PostgreSQL version that supports serverless-v2 auto-pause
38
+ * (`serverlessV2MinCapacity` 0). An explicit override below this synths clean
39
+ * but AccessDenies / rejects at deploy, so the resources layer hard-guards it.
40
+ */
41
+ export const MIN_AUTO_PAUSE_POSTGRES_VERSION = "16.3";
@@ -6,6 +6,7 @@ import { Code, Runtime } from "aws-cdk-lib/aws-lambda";
6
6
  import { Provider } from "aws-cdk-lib/custom-resources";
7
7
  import { Construct } from "constructs";
8
8
  import { SingletonFunction } from "../../compute/lambda.js";
9
+ import { DEFAULT_FRAMEWORK_LOG_RETENTION, LogGroup } from "../../logging/logGroup.js";
9
10
  const __dirname = dirname(fileURLToPath(import.meta.url));
10
11
  /**
11
12
  * Resolves relative to the compiled location too — the build step copies the
@@ -51,7 +52,10 @@ export class IdentityStoreUserProvider extends Construct {
51
52
  ]
52
53
  });
53
54
  const provider = new Provider(this, "Provider", {
54
- onEventHandler: handler
55
+ onEventHandler: handler,
56
+ logGroup: new LogGroup(this, "ProviderLogGroup", {
57
+ retention: DEFAULT_FRAMEWORK_LOG_RETENTION
58
+ })
55
59
  });
56
60
  this.serviceToken = provider.serviceToken;
57
61
  }
@@ -1,2 +1,3 @@
1
1
  export * from "./cloudTrail.js";
2
2
  export * from "./logGroup.js";
3
+ export * from "./singletonLogGroup.js";
@@ -1,2 +1,3 @@
1
1
  export * from "./cloudTrail.js";
2
2
  export * from "./logGroup.js";
3
+ export * from "./singletonLogGroup.js";
@@ -1,5 +1,12 @@
1
1
  import * as Logs from "aws-cdk-lib/aws-logs";
2
2
  import { type Construct } from "constructs";
3
+ /**
4
+ * Default retention for framework-owned lambda log groups. Coupled across
5
+ * every framework lambda construct (LambdaFunction, SingletonFunction, the
6
+ * custom-resource Provider groups, and the stack-singleton groups) — drift
7
+ * would silently give sibling framework lambdas different retention.
8
+ */
9
+ export declare const DEFAULT_FRAMEWORK_LOG_RETENTION = Logs.RetentionDays.ONE_WEEK;
3
10
  export declare class LogGroup extends Logs.LogGroup {
4
11
  constructor(scope: Construct, id: string, props?: Logs.LogGroupProps);
5
12
  }
@@ -1,4 +1,11 @@
1
1
  import * as Logs from "aws-cdk-lib/aws-logs";
2
+ /**
3
+ * Default retention for framework-owned lambda log groups. Coupled across
4
+ * every framework lambda construct (LambdaFunction, SingletonFunction, the
5
+ * custom-resource Provider groups, and the stack-singleton groups) — drift
6
+ * would silently give sibling framework lambdas different retention.
7
+ */
8
+ export const DEFAULT_FRAMEWORK_LOG_RETENTION = Logs.RetentionDays.ONE_WEEK;
2
9
  export class LogGroup extends Logs.LogGroup {
3
10
  constructor(scope, id, props) {
4
11
  super(scope, id, props);
@@ -0,0 +1,15 @@
1
+ import { type Construct } from "constructs";
2
+ import { LogGroup } from "./logGroup.js";
3
+ /**
4
+ * Returns the stack-scoped shared LogGroup for a family of framework lambdas
5
+ * that CDK dedupes to one function per stack (AwsCustomResource's AWS679f…
6
+ * singleton, BucketDeployment's custom-resource handler). Every call site in
7
+ * the stack MUST hand the singleton lambda the SAME log group — CDK applies
8
+ * the first instantiation's props and silently ignores later ones, which
9
+ * would leave per-site groups synthesised but unused.
10
+ *
11
+ * The group is nameless (CDK-generated name), so it never collides with the
12
+ * `/aws/lambda/<fn>` group the Lambda service auto-created on existing
13
+ * deployments; the auto-created group simply stops receiving logs.
14
+ */
15
+ export declare function stackSingletonLogGroup(scope: Construct, purpose: "AwsCustomResource" | "BucketDeployment"): LogGroup;
@@ -0,0 +1,24 @@
1
+ import { Stack } from "aws-cdk-lib";
2
+ import { DEFAULT_FRAMEWORK_LOG_RETENTION, LogGroup } from "./logGroup.js";
3
+ /**
4
+ * Returns the stack-scoped shared LogGroup for a family of framework lambdas
5
+ * that CDK dedupes to one function per stack (AwsCustomResource's AWS679f…
6
+ * singleton, BucketDeployment's custom-resource handler). Every call site in
7
+ * the stack MUST hand the singleton lambda the SAME log group — CDK applies
8
+ * the first instantiation's props and silently ignores later ones, which
9
+ * would leave per-site groups synthesised but unused.
10
+ *
11
+ * The group is nameless (CDK-generated name), so it never collides with the
12
+ * `/aws/lambda/<fn>` group the Lambda service auto-created on existing
13
+ * deployments; the auto-created group simply stops receiving logs.
14
+ */
15
+ export function stackSingletonLogGroup(scope, purpose) {
16
+ const stack = Stack.of(scope);
17
+ const id = `Fjall${purpose}LogGroup`;
18
+ const existing = stack.node.tryFindChild(id);
19
+ if (existing !== undefined)
20
+ return existing;
21
+ return new LogGroup(stack, id, {
22
+ retention: DEFAULT_FRAMEWORK_LOG_RETENTION
23
+ });
24
+ }
@@ -2,8 +2,9 @@ import { Construct } from "constructs";
2
2
  import { Stack, Tags } from "aws-cdk-lib";
3
3
  import { CfnRoute, CfnVPCPeeringConnection, SubnetType } from "aws-cdk-lib/aws-ec2";
4
4
  import { PolicyStatement } from "aws-cdk-lib/aws-iam";
5
- import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from "aws-cdk-lib/custom-resources";
5
+ import { AwsCustomResourcePolicy, PhysicalResourceId } from "aws-cdk-lib/custom-resources";
6
6
  import { COST_ALLOCATION_TAGS, DEFAULT_COST_ALLOCATION_ENVIRONMENT } from "../../../utils/costAllocationTags.js";
7
+ import { AwsCustomResource } from "../utilities/awsCustomResource.js";
7
8
  import { CrossAccountReturnRoutes } from "./crossAccountReturnRoutes.js";
8
9
  export class VpcPeeringConnection extends Construct {
9
10
  peeringConnectionId;
@@ -3,12 +3,11 @@ import { type Construct } from "constructs";
3
3
  /**
4
4
  * Routing-point wrapper for `aws-cdk-lib/aws-s3-deployment.BucketDeployment`.
5
5
  *
6
- * Currently a thin pass-through no defaults are applied today. The wrapper
7
- * exists so that future SOC2 / compliance defaults (tags, retention, encryption
8
- * on the underlying Lambda + Custom Resource) reach every consumer in one edit.
9
- * Per `.claude/rules/generator-standards.md § Wrapper Routing Discipline` and
10
- * `patterns/infrastructure-wrapper-routing-pattern.md § A3` ("a wrapper that
11
- * is a thin pass-through today is still the routing point"), `lib/{config,
6
+ * Applies one default: an explicit, stack-shared log group for the deployment
7
+ * handler lambda, so it is CloudFormation-managed and tagged rather than
8
+ * service-auto-created. Per `.claude/rules/generator-standards.md § Wrapper
9
+ * Routing Discipline` and
10
+ * `patterns/infrastructure-wrapper-routing-pattern.md § A3`, `lib/{config,
12
11
  * patterns}/` MUST instantiate this class rather than the raw CDK construct.
13
12
  */
14
13
  export declare class BucketDeployment extends CdkBucketDeployment {
@@ -1,17 +1,24 @@
1
1
  import { BucketDeployment as CdkBucketDeployment } from "aws-cdk-lib/aws-s3-deployment";
2
+ import { stackSingletonLogGroup } from "../logging/singletonLogGroup.js";
2
3
  /**
3
4
  * Routing-point wrapper for `aws-cdk-lib/aws-s3-deployment.BucketDeployment`.
4
5
  *
5
- * Currently a thin pass-through no defaults are applied today. The wrapper
6
- * exists so that future SOC2 / compliance defaults (tags, retention, encryption
7
- * on the underlying Lambda + Custom Resource) reach every consumer in one edit.
8
- * Per `.claude/rules/generator-standards.md § Wrapper Routing Discipline` and
9
- * `patterns/infrastructure-wrapper-routing-pattern.md § A3` ("a wrapper that
10
- * is a thin pass-through today is still the routing point"), `lib/{config,
6
+ * Applies one default: an explicit, stack-shared log group for the deployment
7
+ * handler lambda, so it is CloudFormation-managed and tagged rather than
8
+ * service-auto-created. Per `.claude/rules/generator-standards.md § Wrapper
9
+ * Routing Discipline` and
10
+ * `patterns/infrastructure-wrapper-routing-pattern.md § A3`, `lib/{config,
11
11
  * patterns}/` MUST instantiate this class rather than the raw CDK construct.
12
12
  */
13
13
  export class BucketDeployment extends CdkBucketDeployment {
14
14
  constructor(scope, id, props) {
15
- super(scope, id, props);
15
+ super(scope, id, {
16
+ ...props,
17
+ // CDK dedupes the deployment handler to one lambda per stack (per
18
+ // memory/vpc variant), so the explicit log group must be the
19
+ // stack-shared one — a per-site group would only bind for whichever
20
+ // site instantiates first.
21
+ logGroup: props.logGroup ?? stackSingletonLogGroup(scope, "BucketDeployment")
22
+ });
16
23
  }
17
24
  }
@@ -1,9 +1,14 @@
1
1
  import * as customResource from "aws-cdk-lib/custom-resources";
2
+ import { stackSingletonLogGroup } from "../logging/singletonLogGroup.js";
2
3
  export class AwsCustomResource extends customResource.AwsCustomResource {
3
4
  response;
4
5
  constructor(scope, id, props) {
5
6
  super(scope, id, {
6
7
  ...props,
8
+ // Every AwsCustomResource in a stack shares CDK's one singleton lambda,
9
+ // so the explicit log group must be the stack-shared one — a per-site
10
+ // group would only bind for whichever site instantiates first.
11
+ logGroup: props.logGroup ?? stackSingletonLogGroup(scope, "AwsCustomResource"),
7
12
  policy: props.policy ||
8
13
  customResource.AwsCustomResourcePolicy.fromSdkCalls({
9
14
  resources: customResource.AwsCustomResourcePolicy.ANY_RESOURCE
@@ -4,6 +4,7 @@ import { Code } from "aws-cdk-lib/aws-lambda";
4
4
  import { Construct } from "constructs";
5
5
  import { SingletonFunction, LambdaFunction } from "../compute/lambda.js";
6
6
  import { DEFAULT_CUSTOM_RESOURCE_TIMEOUT_SECONDS } from "../compute/ecsConstants.js";
7
+ import { DEFAULT_FRAMEWORK_LOG_RETENTION, LogGroup } from "../logging/logGroup.js";
7
8
  export class CustomResource extends Construct {
8
9
  response;
9
10
  resource;
@@ -54,7 +55,10 @@ export class CustomResource extends Construct {
54
55
  inlinePolicy: props.inlinePolicy
55
56
  });
56
57
  const provider = new Provider(this, `${id}Provider`, {
57
- onEventHandler: lambdaFunction
58
+ onEventHandler: lambdaFunction,
59
+ logGroup: new LogGroup(this, `${id}ProviderLogGroup`, {
60
+ retention: DEFAULT_FRAMEWORK_LOG_RETENTION
61
+ })
58
62
  });
59
63
  this.resource = new customResource(this, `${id}Resource`, {
60
64
  serviceToken: provider.serviceToken,
@@ -1,7 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = addSuffixToEmail;
4
- function addSuffixToEmail(email, suffix) {
1
+ export default function addSuffixToEmail(email, suffix) {
5
2
  return email.replace("@", `+${suffix}@`);
6
3
  }
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkU3VmZml4VG9FbWFpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi91dGlscy9hZGRTdWZmaXhUb0VtYWlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsbUNBS0M7QUFMRCxTQUF3QixnQkFBZ0IsQ0FDdEMsS0FBYSxFQUNiLE1BQWM7SUFFZCxPQUFPLEtBQUssQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLElBQUksTUFBTSxHQUFHLENBQUMsQ0FBQztBQUMzQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gYWRkU3VmZml4VG9FbWFpbChcbiAgZW1haWw6IHN0cmluZyxcbiAgc3VmZml4OiBzdHJpbmdcbik6IHN0cmluZyB7XG4gIHJldHVybiBlbWFpbC5yZXBsYWNlKFwiQFwiLCBgKyR7c3VmZml4fUBgKTtcbn1cbiJdfQ==
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Tags applied by the internal `DevSubstrate` construct.
3
+ *
4
+ * `fjall:dev = "true"` is IAM-load-bearing, not cosmetic. The shipped dev-tier
5
+ * deploy fence in `@fjall/generator` (`src/schemas/devRolePolicies.ts`) gates its
6
+ * slot-ops grants on `aws:ResourceTag/fjall:dev = "true"` and
7
+ * `aws:RequestTag/fjall:dev = "true"`. The key and value here MUST stay
8
+ * byte-identical to those IAM condition keys — any drift silently unfences the
9
+ * substrate (the runtime-name-must-match-construct coupling class).
10
+ *
11
+ * A util-level single source shared with the policy is a candidate follow-up; it
12
+ * is deliberately NOT folded here, to avoid editing the parity-locked security
13
+ * policy from a construct-scaffold change.
14
+ */
15
+ export declare const DEV_TAG_KEY: "fjall:dev";
16
+ export declare const DEV_TAG_VALUE: "true";
17
+ /**
18
+ * Reaper / organisational-mapping tag carrying the real customer application id
19
+ * (distinct from the `fjall-dev-<app>` CDK App identity that drives the
20
+ * substrate's stack names). NOT part of the IAM fence contract.
21
+ */
22
+ export declare const DEV_APP_TAG_KEY: "fjall:app";
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Tags applied by the internal `DevSubstrate` construct.
3
+ *
4
+ * `fjall:dev = "true"` is IAM-load-bearing, not cosmetic. The shipped dev-tier
5
+ * deploy fence in `@fjall/generator` (`src/schemas/devRolePolicies.ts`) gates its
6
+ * slot-ops grants on `aws:ResourceTag/fjall:dev = "true"` and
7
+ * `aws:RequestTag/fjall:dev = "true"`. The key and value here MUST stay
8
+ * byte-identical to those IAM condition keys — any drift silently unfences the
9
+ * substrate (the runtime-name-must-match-construct coupling class).
10
+ *
11
+ * A util-level single source shared with the policy is a candidate follow-up; it
12
+ * is deliberately NOT folded here, to avoid editing the parity-locked security
13
+ * policy from a construct-scaffold change.
14
+ */
15
+ export const DEV_TAG_KEY = "fjall:dev";
16
+ export const DEV_TAG_VALUE = "true";
17
+ /**
18
+ * Reaper / organisational-mapping tag carrying the real customer application id
19
+ * (distinct from the `fjall-dev-<app>` CDK App identity that drives the
20
+ * substrate's stack names). NOT part of the IAM fence contract.
21
+ */
22
+ export const DEV_APP_TAG_KEY = "fjall:app";
@@ -24,11 +24,11 @@ export declare const FjallLogger: {
24
24
  */
25
25
  export declare function warnIfPropertyIgnored<T extends {
26
26
  type: string;
27
- }>(props: T, property: string, applicableType: string | string[], typeName: string): void;
27
+ }>(props: T, property: string, applicableType: string | string[], typeName: string, discriminatorLabel?: string): void;
28
28
  /**
29
29
  * Warn if any of the specified properties are set but will be ignored.
30
30
  * Convenience wrapper for checking multiple properties at once.
31
31
  */
32
32
  export declare function warnIfPropertiesIgnored<T extends {
33
33
  type: string;
34
- }>(props: T, properties: string[], applicableType: string | string[], typeName: string): void;
34
+ }>(props: T, properties: string[], applicableType: string | string[], typeName: string, discriminatorLabel?: string): void;
@@ -57,7 +57,7 @@ export const FjallLogger = {
57
57
  * @param applicableType - The type(s) where this property is used
58
58
  * @param typeName - Human-readable type name for the message
59
59
  */
60
- export function warnIfPropertyIgnored(props, property, applicableType, typeName) {
60
+ export function warnIfPropertyIgnored(props, property, applicableType, typeName, discriminatorLabel = "type") {
61
61
  const propsRecord = props;
62
62
  const types = Array.isArray(applicableType)
63
63
  ? applicableType
@@ -66,15 +66,15 @@ export function warnIfPropertyIgnored(props, property, applicableType, typeName)
66
66
  property in propsRecord &&
67
67
  propsRecord[property] !== undefined) {
68
68
  FjallLogger.warn(`'${property}' is only used for ${typeName} type. ` +
69
- `It will be ignored for type '${props.type}'.`);
69
+ `It will be ignored for ${discriminatorLabel} '${props.type}'.`);
70
70
  }
71
71
  }
72
72
  /**
73
73
  * Warn if any of the specified properties are set but will be ignored.
74
74
  * Convenience wrapper for checking multiple properties at once.
75
75
  */
76
- export function warnIfPropertiesIgnored(props, properties, applicableType, typeName) {
76
+ export function warnIfPropertiesIgnored(props, properties, applicableType, typeName, discriminatorLabel = "type") {
77
77
  for (const property of properties) {
78
- warnIfPropertyIgnored(props, property, applicableType, typeName);
78
+ warnIfPropertyIgnored(props, property, applicableType, typeName, discriminatorLabel);
79
79
  }
80
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fjall/components-infrastructure",
3
- "version": "2.30.3",
3
+ "version": "2.32.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "bin": {
@@ -34,7 +34,7 @@
34
34
  "clean": "rm -rf ./dist",
35
35
  "clean:node": "rm -rf ./node_modules",
36
36
  "build:cert-gen-lambda": "node lib/lambda-assets/cert-generator/src/build.mjs",
37
- "build": "npm run build:cert-gen-lambda && tsc && cp -r lib/layers dist/lib/layers && mkdir -p dist/lib/lambda-assets/cert-generator/asset && cp lib/lambda-assets/cert-generator/asset/index.js dist/lib/lambda-assets/cert-generator/asset/index.js && cp lib/lambda-assets/cert-generator/asset/package.json dist/lib/lambda-assets/cert-generator/asset/package.json && mkdir -p dist/lib/lambda-assets/identity-store-user/asset && cp lib/lambda-assets/identity-store-user/asset/index.js dist/lib/lambda-assets/identity-store-user/asset/index.js && cp lib/lambda-assets/identity-store-user/asset/package.json dist/lib/lambda-assets/identity-store-user/asset/package.json && mkdir -p dist/lib/lambda-assets/static-site-forms/asset && cp lib/lambda-assets/static-site-forms/asset/index.js dist/lib/lambda-assets/static-site-forms/asset/index.js && cp lib/lambda-assets/static-site-forms/asset/package.json dist/lib/lambda-assets/static-site-forms/asset/package.json && cp lib/resources/aws/compute/lifecycleHookLambda.source.cjs dist/lib/resources/aws/compute/lifecycleHookLambda.source.cjs && cp lib/resources/aws/compute/ec2GracefulTerminationLambda.source.cjs dist/lib/resources/aws/compute/ec2GracefulTerminationLambda.source.cjs && cp lib/resources/aws/compute/persistentDataVolumeLambda.source.cjs dist/lib/resources/aws/compute/persistentDataVolumeLambda.source.cjs",
37
+ "build": "npm run build:cert-gen-lambda && tsc && cp -r lib/layers dist/lib/layers && mkdir -p dist/lib/lambda-assets/cert-generator/asset && cp lib/lambda-assets/cert-generator/asset/index.js dist/lib/lambda-assets/cert-generator/asset/index.js && cp lib/lambda-assets/cert-generator/asset/package.json dist/lib/lambda-assets/cert-generator/asset/package.json && mkdir -p dist/lib/lambda-assets/identity-store-user/asset && cp lib/lambda-assets/identity-store-user/asset/index.js dist/lib/lambda-assets/identity-store-user/asset/index.js && cp lib/lambda-assets/identity-store-user/asset/package.json dist/lib/lambda-assets/identity-store-user/asset/package.json && mkdir -p dist/lib/lambda-assets/static-site-forms/asset && cp lib/lambda-assets/static-site-forms/asset/index.js dist/lib/lambda-assets/static-site-forms/asset/index.js && cp lib/lambda-assets/static-site-forms/asset/package.json dist/lib/lambda-assets/static-site-forms/asset/package.json && cp lib/resources/aws/compute/lifecycleHookLambda.source.cjs dist/lib/resources/aws/compute/lifecycleHookLambda.source.cjs && cp lib/resources/aws/compute/ec2GracefulTerminationLambda.source.cjs dist/lib/resources/aws/compute/ec2GracefulTerminationLambda.source.cjs && cp lib/resources/aws/compute/persistentDataVolumeLambda.source.cjs dist/lib/resources/aws/compute/persistentDataVolumeLambda.source.cjs && cp lib/patterns/aws/devSubstrate.waker.source.cjs dist/lib/patterns/aws/devSubstrate.waker.source.cjs",
38
38
  "prepack": "node ../../scripts/check-dist-freshness.mjs",
39
39
  "watch": "tsc -w",
40
40
  "watch:only": "tsc -w",
@@ -67,8 +67,8 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@aws-sdk/client-organizations": "^3.1038.0",
70
- "@fjall/generator": "^2.30.3",
71
- "@fjall/util": "^2.30.3",
70
+ "@fjall/generator": "^2.32.0",
71
+ "@fjall/util": "^2.32.0",
72
72
  "constructs": "^10.6.0"
73
73
  },
74
74
  "overrides": {
@@ -82,5 +82,5 @@
82
82
  "engines": {
83
83
  "node": ">=18.0.0"
84
84
  },
85
- "gitHead": "d398edc0c0edf661d7ab6e5a47623529f68dfd2a"
85
+ "gitHead": "876a79a9ad0031a5919019c86867c28c1ab9dc92"
86
86
  }
@@ -1,48 +0,0 @@
1
- import { App } from "aws-cdk-lib";
2
- import { Template } from "aws-cdk-lib/assertions";
3
- import { Stack } from "aws-cdk-lib";
4
- /**
5
- * Test utilities for CDK infrastructure testing
6
- */
7
- export declare class TestUtils {
8
- /**
9
- * Create a test app with proper environment settings
10
- */
11
- static createTestApp(): App;
12
- /**
13
- * Create a test stack within a test app
14
- */
15
- static createTestStack(app?: App): Stack;
16
- /**
17
- * Get CloudFormation template from a stack for assertions
18
- */
19
- static getTemplate(stack: Stack): Template;
20
- /**
21
- * Generate consistent snapshot from CDK stack
22
- */
23
- static getSnapshotTemplate(stack: Stack): any;
24
- /**
25
- * Clean up template for consistent snapshots by removing random IDs
26
- */
27
- static sanitiseTemplate(template: any): any;
28
- }
29
- /**
30
- * Common test data for infrastructure patterns
31
- */
32
- export declare const TestData: {
33
- defaultTags: {
34
- "fjall:costAllocation:environment": string;
35
- "fjall:costAllocation:owner": string;
36
- };
37
- defaultAccountId: string;
38
- defaultRegion: string;
39
- vpc: {
40
- vpcId: string;
41
- };
42
- basicApp: {
43
- serviceName: string;
44
- environment: string;
45
- containerPort: number;
46
- owner: string;
47
- };
48
- };