@fjall/components-infrastructure 23.0.0 → 24.0.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.
@@ -55,6 +55,21 @@ export interface AccountProps extends StackProps {
55
55
  */
56
56
  machineTrustMode?: MachineTrustMode;
57
57
  }
58
+ /**
59
+ * `fjall:description` values for the governance tiers — the same user-facing
60
+ * gold-plating the domain-side constructs carry, so a governance stack's
61
+ * resources explain themselves in the console exactly like a zone or
62
+ * certificate does. Keyed by `organisationType` so each tier self-describes
63
+ * from ONE stamp in this base class.
64
+ *
65
+ * CHARSET CONTRACT: every value must stay inside the AWS tag-value pattern
66
+ * `^[\p{L}\p{Z}\p{N}_.:/=+\-@]*$` — no commas. IAM roles and nested-stack
67
+ * resources (AWS::CloudFormation::Stack) validate tag values against it, so
68
+ * one comma aborts the whole governance deploy at changeset creation ("Tag
69
+ * [fjall:description] contained invalid characters"). Exported so the
70
+ * governanceTagging suite pins the contract for every tier.
71
+ */
72
+ export declare const GOVERNANCE_TIER_DESCRIPTIONS: Record<OrganisationType, string>;
58
73
  export declare class Account extends Stack {
59
74
  readonly organisationType: OrganisationType;
60
75
  protected readonly resolvedRegion: string;
@@ -22,9 +22,16 @@ import { InspectorEnablement } from "../../config/aws/inspectorEnablement.js";
22
22
  * resources explain themselves in the console exactly like a zone or
23
23
  * certificate does. Keyed by `organisationType` so each tier self-describes
24
24
  * from ONE stamp in this base class.
25
+ *
26
+ * CHARSET CONTRACT: every value must stay inside the AWS tag-value pattern
27
+ * `^[\p{L}\p{Z}\p{N}_.:/=+\-@]*$` — no commas. IAM roles and nested-stack
28
+ * resources (AWS::CloudFormation::Stack) validate tag values against it, so
29
+ * one comma aborts the whole governance deploy at changeset creation ("Tag
30
+ * [fjall:description] contained invalid characters"). Exported so the
31
+ * governanceTagging suite pins the contract for every tier.
25
32
  */
26
- const GOVERNANCE_TIER_DESCRIPTIONS = {
27
- organisation: "Fjall-managed organisation governance: org root, member accounts and organisation-wide policy",
33
+ export const GOVERNANCE_TIER_DESCRIPTIONS = {
34
+ organisation: "Fjall-managed organisation governance: org root and member accounts under organisation-wide policy",
28
35
  platform: "Fjall-managed platform governance: shared platform services and CI trust",
29
36
  account: "Fjall-managed account governance: account security and operations baseline"
30
37
  };
@@ -6,17 +6,8 @@
6
6
  import { appendFileSync, existsSync, mkdirSync } from "fs";
7
7
  import { join } from "path";
8
8
  import { fjallLogDir } from "@fjall/util";
9
- import { FileRotator, LOG_ROTATION_DEFAULTS } from "@fjall/util/logRotation";
9
+ import { FileRotator, resolveLogRotationBudget } from "@fjall/util/logRotation";
10
10
  const LOG_FILENAME = "infrastructure.jsonl";
11
- /**
12
- * Shared with the CLI's own logs, so this file cannot outgrow the budget
13
- * the rest of Fjall's logging keeps to. Without it this log had no bound of
14
- * any kind: it is appended to on every CDK synth, and one developer machine
15
- * reached 267MB of it inside a single release cycle.
16
- */
17
- const rotator = new FileRotator({
18
- maxFiles: LOG_ROTATION_DEFAULTS.MAX_FILES
19
- });
20
11
  /**
21
12
  * Write a log entry to the infrastructure JSONL file
22
13
  */
@@ -36,7 +27,14 @@ function writeToLog(level, message) {
36
27
  source: "cdk-subprocess"
37
28
  });
38
29
  const logPath = join(logDir, LOG_FILENAME);
39
- rotator.rotateIfNeeded(logPath, LOG_ROTATION_DEFAULTS.MAX_FILE_SIZE);
30
+ // Budget shared with the CLI's own logs — same defaults, same
31
+ // FJALL_LOG_MAX_SIZE / FJALL_LOG_MAX_FILES overrides — so this file
32
+ // cannot outgrow what the rest of Fjall's logging keeps to. It reached
33
+ // 267MB on one developer machine when it had no bound. Resolved per
34
+ // write for the same reason as the log dir above: CDK imports this
35
+ // module long before a command's environment is readable.
36
+ const { maxFileSize, maxFiles } = resolveLogRotationBudget();
37
+ new FileRotator({ maxFiles }).rotateIfNeeded(logPath, maxFileSize);
40
38
  appendFileSync(logPath, entry + "\n");
41
39
  }
42
40
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fjall/components-infrastructure",
3
- "version": "23.0.0",
3
+ "version": "24.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/fjall-tech/fjall.git",
@@ -80,8 +80,8 @@
80
80
  },
81
81
  "dependencies": {
82
82
  "@aws-sdk/client-organizations": "^3.1098.0",
83
- "@fjall/generator": "^23.0.0",
84
- "@fjall/util": "^23.0.0",
83
+ "@fjall/generator": "^24.0.0",
84
+ "@fjall/util": "^24.0.0",
85
85
  "constructs": "^10.7.2"
86
86
  },
87
87
  "overrides": {