@fjall/components-infrastructure 38.0.0 → 39.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.
Files changed (46) hide show
  1. package/dist/lib/app.d.ts +24 -12
  2. package/dist/lib/app.js +30 -26
  3. package/dist/lib/config/aws/configRecorder.js +3 -0
  4. package/dist/lib/config/aws/disasterRecovery.js +115 -13
  5. package/dist/lib/patterns/aws/buildkite/buildkite.js +7 -2
  6. package/dist/lib/patterns/aws/clickhouseDatabase.js +8 -4
  7. package/dist/lib/patterns/aws/computeEcs.js +17 -1
  8. package/dist/lib/patterns/aws/computeEcsTypes.d.ts +30 -4
  9. package/dist/lib/patterns/aws/computePropApplicability.js +1 -0
  10. package/dist/lib/patterns/aws/messaging.d.ts +10 -0
  11. package/dist/lib/patterns/aws/messaging.js +10 -6
  12. package/dist/lib/patterns/aws/storage.d.ts +41 -0
  13. package/dist/lib/patterns/aws/storage.js +23 -8
  14. package/dist/lib/resources/aws/backup/backupVault.d.ts +10 -0
  15. package/dist/lib/resources/aws/backup/backupVault.js +12 -0
  16. package/dist/lib/resources/aws/compute/ecs.d.ts +7 -4
  17. package/dist/lib/resources/aws/compute/ecs.js +27 -21
  18. package/dist/lib/resources/aws/compute/ecsServiceFactory.js +3 -0
  19. package/dist/lib/resources/aws/compute/ecsTypes.d.ts +11 -0
  20. package/dist/lib/resources/aws/compute/ecsValidation.d.ts +8 -0
  21. package/dist/lib/resources/aws/compute/ecsValidation.js +8 -0
  22. package/dist/lib/resources/aws/compute/persistentDataVolume.d.ts +8 -0
  23. package/dist/lib/resources/aws/compute/persistentDataVolume.js +2 -0
  24. package/dist/lib/resources/aws/database/dynamodb.js +2 -1
  25. package/dist/lib/resources/aws/database/rdsAurora.js +6 -1
  26. package/dist/lib/resources/aws/database/rdsInstance.js +6 -1
  27. package/dist/lib/resources/aws/logging/accessLogBucket.d.ts +1 -1
  28. package/dist/lib/resources/aws/logging/accessLogBucket.js +1 -1
  29. package/dist/lib/resources/aws/logging/cloudTrail.js +3 -0
  30. package/dist/lib/resources/aws/messaging/eventBridgeQueueGrants.d.ts +2 -0
  31. package/dist/lib/resources/aws/messaging/eventBridgeQueueGrants.js +2 -1
  32. package/dist/lib/resources/aws/messaging/eventBridgeRule.js +36 -5
  33. package/dist/lib/resources/aws/messaging/sqs.d.ts +36 -1
  34. package/dist/lib/resources/aws/messaging/sqs.js +36 -2
  35. package/dist/lib/resources/aws/networking/vpc.js +12 -6
  36. package/dist/lib/resources/aws/secrets/stackEncryptionKey.d.ts +26 -1
  37. package/dist/lib/resources/aws/secrets/stackEncryptionKey.js +56 -1
  38. package/dist/lib/resources/aws/storage/s3.d.ts +21 -1
  39. package/dist/lib/resources/aws/storage/s3.js +89 -3
  40. package/dist/lib/utils/backupTierMapping.d.ts +23 -2
  41. package/dist/lib/utils/backupTierMapping.js +25 -0
  42. package/dist/lib/utils/exportNaming.d.ts +30 -27
  43. package/dist/lib/utils/exportNaming.js +32 -28
  44. package/dist/lib/utils/standardTagsAspect.d.ts +8 -18
  45. package/dist/lib/utils/standardTagsAspect.js +8 -34
  46. package/package.json +4 -4
@@ -5,12 +5,19 @@ import { type IConstruct } from "constructs";
5
5
  *
6
6
  * This aspect handles tags that depend on resource-specific properties:
7
7
  * - fjall:operations:pool on VPCs with IPAM configuration
8
- * - fjall:disasterRecovery:tier on S3 buckets with backup configuration
9
8
  *
10
9
  * Standard Fjall tags (costAllocation:environment, costAllocation:service, etc.)
11
10
  * are applied via Tags.of(app).add() in the App class, which properly merges
12
11
  * with existing tags from L2 constructs.
13
12
  *
13
+ * The disaster-recovery tier tag is NOT applied here. It is stamped at
14
+ * construction by the five constructs that own a backup-eligible resource
15
+ * (`tagBackupTier`), because an aspect can only reach the resource by walking
16
+ * up the scope chain — which cannot tell an Aurora cluster from its member
17
+ * instances, or a primary from its read replica — and because `Tags.of(...)`
18
+ * called inside `visit()` is an aspect adding an aspect, dropped silently when
19
+ * `aspectStabilization` is off.
20
+ *
14
21
  * This aspect uses Tags.of(node).add() to properly merge with existing tags
15
22
  */
16
23
  export declare class StandardTagsAspect implements IAspect {
@@ -21,21 +28,4 @@ export declare class StandardTagsAspect implements IAspect {
21
28
  * Tag format: fjall:operations:pool = "{accountId}-{region}"
22
29
  */
23
30
  private addIpamPoolTag;
24
- /**
25
- * Add the disaster recovery tier tag to S3 buckets from the bucket's
26
- * effective tier — the per-bucket `backupVaultTier` override, else the
27
- * app-level tier the factory threaded in. CDK child tags override parent
28
- * tags, so an override wins over the app-level tag set via
29
- * `App.getApp({ backup })`; an inherited app tier writes the value that tag
30
- * already carries. The same resolution decides the bucket's versioning
31
- * default (`S3Bucket`).
32
- *
33
- * Tag format: fjall:disasterRecovery:tier = "{tier}"
34
- *
35
- * Tier mapping:
36
- * - standard -> "default" (matches existing backup plans)
37
- * - resilient -> "resilient"
38
- * - enterprise -> "enterprise"
39
- */
40
- private addBackupTierTag;
41
31
  }
@@ -1,17 +1,23 @@
1
1
  import { CfnResource, Stack, Tags } from "aws-cdk-lib";
2
- import { BACKUP_TIER_TAG_KEY, BACKUP_TIER_TAG_MAP } from "./backupTierMapping.js";
3
2
  import { formatIpamPairTagValue, IPAM_OPERATIONS_POOL_TAG_KEY } from "@fjall/util/aws";
4
3
  /**
5
4
  * Aspect to apply special Fjall tags to specific resource types.
6
5
  *
7
6
  * This aspect handles tags that depend on resource-specific properties:
8
7
  * - fjall:operations:pool on VPCs with IPAM configuration
9
- * - fjall:disasterRecovery:tier on S3 buckets with backup configuration
10
8
  *
11
9
  * Standard Fjall tags (costAllocation:environment, costAllocation:service, etc.)
12
10
  * are applied via Tags.of(app).add() in the App class, which properly merges
13
11
  * with existing tags from L2 constructs.
14
12
  *
13
+ * The disaster-recovery tier tag is NOT applied here. It is stamped at
14
+ * construction by the five constructs that own a backup-eligible resource
15
+ * (`tagBackupTier`), because an aspect can only reach the resource by walking
16
+ * up the scope chain — which cannot tell an Aurora cluster from its member
17
+ * instances, or a primary from its read replica — and because `Tags.of(...)`
18
+ * called inside `visit()` is an aspect adding an aspect, dropped silently when
19
+ * `aspectStabilization` is off.
20
+ *
15
21
  * This aspect uses Tags.of(node).add() to properly merge with existing tags
16
22
  */
17
23
  export class StandardTagsAspect {
@@ -31,9 +37,6 @@ export class StandardTagsAspect {
31
37
  if (resource.cfnResourceType === "AWS::EC2::VPC") {
32
38
  this.addIpamPoolTag(resource);
33
39
  }
34
- if (resource.cfnResourceType === "AWS::S3::Bucket") {
35
- this.addBackupTierTag(resource);
36
- }
37
40
  }
38
41
  /**
39
42
  * Add IPAM pool tag to VPCs that use IPAM for IP address allocation.
@@ -53,33 +56,4 @@ export class StandardTagsAspect {
53
56
  Tags.of(vpc).add(IPAM_OPERATIONS_POOL_TAG_KEY, formatIpamPairTagValue(accountId, region));
54
57
  }
55
58
  }
56
- /**
57
- * Add the disaster recovery tier tag to S3 buckets from the bucket's
58
- * effective tier — the per-bucket `backupVaultTier` override, else the
59
- * app-level tier the factory threaded in. CDK child tags override parent
60
- * tags, so an override wins over the app-level tag set via
61
- * `App.getApp({ backup })`; an inherited app tier writes the value that tag
62
- * already carries. The same resolution decides the bucket's versioning
63
- * default (`S3Bucket`).
64
- *
65
- * Tag format: fjall:disasterRecovery:tier = "{tier}"
66
- *
67
- * Tier mapping:
68
- * - standard -> "default" (matches existing backup plans)
69
- * - resilient -> "resilient"
70
- * - enterprise -> "enterprise"
71
- */
72
- addBackupTierTag(resource) {
73
- let construct = resource;
74
- while (construct) {
75
- const backupConstruct = construct;
76
- if (backupConstruct.effectiveBackupTier) {
77
- const tier = backupConstruct.effectiveBackupTier;
78
- const tagValue = BACKUP_TIER_TAG_MAP[tier];
79
- Tags.of(resource).add(BACKUP_TIER_TAG_KEY, tagValue);
80
- break;
81
- }
82
- construct = construct.node.scope;
83
- }
84
- }
85
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fjall/components-infrastructure",
3
- "version": "38.0.0",
3
+ "version": "39.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/fjall-tech/fjall.git",
@@ -76,12 +76,12 @@
76
76
  "reflect-metadata": "^0.2.2",
77
77
  "tsx": "^4.23.1",
78
78
  "typescript": "^6.0.3",
79
- "vitest": "^4.1.10"
79
+ "vitest": "^4.1.11"
80
80
  },
81
81
  "dependencies": {
82
82
  "@aws-sdk/client-organizations": "^3.1098.0",
83
- "@fjall/generator": "^38.0.0",
84
- "@fjall/util": "^38.0.0",
83
+ "@fjall/generator": "^39.0.0",
84
+ "@fjall/util": "^39.0.0",
85
85
  "constructs": "^10.7.2",
86
86
  "zod": "^4.4.3"
87
87
  },