@fjall/components-infrastructure 2.30.3 → 2.31.1

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 (93) hide show
  1. package/dist/lib/config/aws/identityCenterMembership.d.ts +11 -0
  2. package/dist/lib/config/aws/identityCenterMembership.js +61 -0
  3. package/dist/lib/config/aws/oidcConnector.js +11 -3
  4. package/dist/lib/lambda-assets/cert-generator/asset/index.js +12 -3
  5. package/dist/lib/patterns/aws/compute.d.ts +2 -2
  6. package/dist/lib/patterns/aws/compute.js +18 -9
  7. package/dist/lib/patterns/aws/computeLambda.d.ts +15 -1
  8. package/dist/lib/patterns/aws/computeLambda.js +18 -2
  9. package/dist/lib/patterns/aws/computePropApplicability.d.ts +20 -0
  10. package/dist/lib/patterns/aws/computePropApplicability.js +87 -0
  11. package/dist/lib/resources/aws/compute/ecsImages.js +7 -2
  12. package/dist/lib/resources/aws/compute/imageTagParameter.d.ts +18 -1
  13. package/dist/lib/resources/aws/compute/imageTagParameter.js +32 -2
  14. package/dist/lib/resources/aws/compute/lambda.d.ts +1 -1
  15. package/dist/lib/resources/aws/compute/lambda.js +6 -4
  16. package/dist/lib/resources/aws/iam/identityCenter/user.js +5 -1
  17. package/dist/lib/resources/aws/logging/index.d.ts +1 -0
  18. package/dist/lib/resources/aws/logging/index.js +1 -0
  19. package/dist/lib/resources/aws/logging/logGroup.d.ts +7 -0
  20. package/dist/lib/resources/aws/logging/logGroup.js +7 -0
  21. package/dist/lib/resources/aws/logging/singletonLogGroup.d.ts +15 -0
  22. package/dist/lib/resources/aws/logging/singletonLogGroup.js +24 -0
  23. package/dist/lib/resources/aws/networking/vpcPeeringConnection.js +2 -1
  24. package/dist/lib/resources/aws/storage/bucketDeployment.d.ts +5 -6
  25. package/dist/lib/resources/aws/storage/bucketDeployment.js +14 -7
  26. package/dist/lib/resources/aws/utilities/awsCustomResource.js +5 -0
  27. package/dist/lib/resources/aws/utilities/customResource.js +5 -1
  28. package/dist/lib/utils/addSuffixToEmail.js +1 -5
  29. package/dist/lib/utils/validationLogger.d.ts +2 -2
  30. package/dist/lib/utils/validationLogger.js +4 -4
  31. package/package.json +4 -4
  32. package/dist/lib/__tests__/setup.d.ts +0 -48
  33. package/dist/lib/__tests__/setup.js +0 -1
  34. package/dist/lib/config/aws/accountId.d.ts +0 -6
  35. package/dist/lib/config/aws/accountId.js +0 -33
  36. package/dist/lib/config/aws/backupGlobalSettings.d.ts +0 -29
  37. package/dist/lib/config/aws/backupGlobalSettings.js +0 -51
  38. package/dist/lib/config/aws/costAllocationTags.d.ts +0 -12
  39. package/dist/lib/config/aws/costAllocationTags.js +0 -48
  40. package/dist/lib/config/aws/eventBus.d.ts +0 -7
  41. package/dist/lib/config/aws/eventBus.js +0 -24
  42. package/dist/lib/config/aws/identityCenterGroupMembership.d.ts +0 -10
  43. package/dist/lib/config/aws/identityCenterGroupMembership.js +0 -115
  44. package/dist/lib/config/aws/ipamDelegateAdmin.d.ts +0 -8
  45. package/dist/lib/config/aws/ipamDelegateAdmin.js +0 -58
  46. package/dist/lib/config/aws/ipamPoolId.d.ts +0 -10
  47. package/dist/lib/config/aws/ipamPoolId.js +0 -39
  48. package/dist/lib/config/aws/organisation.d.ts +0 -30
  49. package/dist/lib/config/aws/organisation.js +0 -95
  50. package/dist/lib/config/aws/organisationId.d.ts +0 -7
  51. package/dist/lib/config/aws/organisationId.js +0 -46
  52. package/dist/lib/config/aws/organisationsAccess.d.ts +0 -10
  53. package/dist/lib/config/aws/organisationsAccess.js +0 -50
  54. package/dist/lib/config/aws/ramSharing.d.ts +0 -4
  55. package/dist/lib/config/aws/ramSharing.js +0 -35
  56. package/dist/lib/config/monitoring.d.ts +0 -18
  57. package/dist/lib/config/monitoring.js +0 -22
  58. package/dist/lib/patterns/aws/cicdRole.d.ts +0 -67
  59. package/dist/lib/patterns/aws/cicdRole.js +0 -68
  60. package/dist/lib/patterns/aws/hostedZone.d.ts +0 -28
  61. package/dist/lib/patterns/aws/hostedZone.js +0 -150
  62. package/dist/lib/patterns/aws/managedAccount.d.ts +0 -9
  63. package/dist/lib/patterns/aws/managedAccount.js +0 -55
  64. package/dist/lib/patterns/aws/managedIdentityCenter.d.ts +0 -4
  65. package/dist/lib/patterns/aws/managedIdentityCenter.js +0 -24
  66. package/dist/lib/patterns/aws/managedOrganisation.d.ts +0 -36
  67. package/dist/lib/patterns/aws/managedOrganisation.js +0 -97
  68. package/dist/lib/patterns/aws/managedPlatform.d.ts +0 -12
  69. package/dist/lib/patterns/aws/managedPlatform.js +0 -29
  70. package/dist/lib/patterns/aws/subdomainHostedZone.d.ts +0 -9
  71. package/dist/lib/patterns/aws/subdomainHostedZone.js +0 -39
  72. package/dist/lib/resources/aws/cicd/cicdRole.d.ts +0 -65
  73. package/dist/lib/resources/aws/cicd/cicdRole.js +0 -191
  74. package/dist/lib/resources/aws/compute/ecsFreeTier.d.ts +0 -75
  75. package/dist/lib/resources/aws/compute/ecsFreeTier.js +0 -1
  76. package/dist/lib/resources/aws/compute/ecsSpot.d.ts +0 -75
  77. package/dist/lib/resources/aws/compute/ecsSpot.js +0 -1
  78. package/dist/lib/resources/aws/compute/utilities/capacityProviderDrainWaiter.d.ts +0 -20
  79. package/dist/lib/resources/aws/compute/utilities/capacityProviderDrainWaiter.js +0 -1
  80. package/dist/lib/resources/aws/database/database.d.ts +0 -14
  81. package/dist/lib/resources/aws/database/database.js +0 -28
  82. package/dist/lib/resources/aws/database/databaseInstance.d.ts +0 -15
  83. package/dist/lib/resources/aws/database/databaseInstance.js +0 -30
  84. package/dist/lib/resources/aws/iam/identityCenter/attachManagedPolicy.d.ts +0 -13
  85. package/dist/lib/resources/aws/iam/identityCenter/attachManagedPolicy.js +0 -52
  86. package/dist/lib/resources/aws/iam/securityGroup.d.ts +0 -5
  87. package/dist/lib/resources/aws/iam/securityGroup.js +0 -14
  88. package/dist/lib/resources/aws/monitoring/monitoringRole.d.ts +0 -28
  89. package/dist/lib/resources/aws/monitoring/monitoringRole.js +0 -125
  90. package/dist/lib/resources/aws/utilities/cfnOutput.d.ts +0 -5
  91. package/dist/lib/resources/aws/utilities/cfnOutput.js +0 -1
  92. package/dist/lib/utils/capitalizeString.d.ts +0 -1
  93. package/dist/lib/utils/capitalizeString.js +0 -7
@@ -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==
@@ -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.31.1",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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.31.1",
71
+ "@fjall/util": "^2.31.1",
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": "a48cfaf6e050ce1736837802dfcaf517ba39f199"
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
- };