@fjall/components-infrastructure 0.86.0 → 0.87.3

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 (112) hide show
  1. package/README.md +3 -3
  2. package/dist/lib/app.d.ts +166 -6
  3. package/dist/lib/app.js +212 -20
  4. package/dist/lib/aspects/resourceInventory.d.ts +4 -4
  5. package/dist/lib/aspects/resourceInventory.js +3 -3
  6. package/dist/lib/config/aws/backupGlobalSettings.js +1 -2
  7. package/dist/lib/config/aws/identityCenter.js +1 -5
  8. package/dist/lib/config/aws/organisation.js +1 -4
  9. package/dist/lib/index.d.ts +1 -0
  10. package/dist/lib/index.js +7 -1
  11. package/dist/lib/patterns/aws/buildkite.js +3 -2
  12. package/dist/lib/patterns/aws/cdn.d.ts +164 -0
  13. package/dist/lib/patterns/aws/cdn.js +264 -0
  14. package/dist/lib/patterns/aws/compute.d.ts +278 -59
  15. package/dist/lib/patterns/aws/compute.js +384 -188
  16. package/dist/lib/patterns/aws/connections.d.ts +46 -0
  17. package/dist/lib/patterns/aws/connections.js +159 -0
  18. package/dist/lib/patterns/aws/database.d.ts +124 -11
  19. package/dist/lib/patterns/aws/database.js +188 -66
  20. package/dist/lib/patterns/aws/hostedZone.js +1 -1
  21. package/dist/lib/patterns/aws/index.d.ts +3 -0
  22. package/dist/lib/patterns/aws/index.js +4 -1
  23. package/dist/lib/patterns/aws/interfaces/compute.d.ts +121 -0
  24. package/dist/lib/patterns/aws/interfaces/compute.js +48 -0
  25. package/dist/lib/patterns/aws/interfaces/connector.d.ts +183 -0
  26. package/dist/lib/patterns/aws/interfaces/connector.js +117 -0
  27. package/dist/lib/patterns/aws/interfaces/database.d.ts +136 -0
  28. package/dist/lib/patterns/aws/interfaces/database.js +65 -0
  29. package/dist/lib/patterns/aws/interfaces/index.d.ts +12 -0
  30. package/dist/lib/patterns/aws/interfaces/index.js +49 -0
  31. package/dist/lib/patterns/aws/interfaces/messaging.d.ts +146 -0
  32. package/dist/lib/patterns/aws/interfaces/messaging.js +56 -0
  33. package/dist/lib/patterns/aws/interfaces/pattern.d.ts +403 -0
  34. package/dist/lib/patterns/aws/interfaces/pattern.js +36 -0
  35. package/dist/lib/patterns/aws/interfaces/storage.d.ts +136 -0
  36. package/dist/lib/patterns/aws/interfaces/storage.js +48 -0
  37. package/dist/lib/patterns/aws/messaging.d.ts +183 -0
  38. package/dist/lib/patterns/aws/messaging.js +239 -0
  39. package/dist/lib/patterns/aws/network.js +4 -4
  40. package/dist/lib/patterns/aws/pattern.d.ts +67 -0
  41. package/dist/lib/patterns/aws/pattern.js +69 -0
  42. package/dist/lib/patterns/aws/payload.d.ts +87 -0
  43. package/dist/lib/patterns/aws/payload.js +526 -0
  44. package/dist/lib/patterns/aws/storage.d.ts +127 -15
  45. package/dist/lib/patterns/aws/storage.js +234 -38
  46. package/dist/lib/resources/aws/backup/backupPlan.js +1 -6
  47. package/dist/lib/resources/aws/backup/backupVault.js +1 -2
  48. package/dist/lib/resources/aws/base/awsStack.d.ts +0 -2
  49. package/dist/lib/resources/aws/base/awsStack.js +1 -7
  50. package/dist/lib/resources/aws/cdn/cloudFront.d.ts +71 -0
  51. package/dist/lib/resources/aws/cdn/cloudFront.js +176 -0
  52. package/dist/lib/resources/aws/cdn/index.d.ts +1 -0
  53. package/dist/lib/resources/aws/cdn/index.js +18 -0
  54. package/dist/lib/resources/aws/compute/ec2.d.ts +5 -0
  55. package/dist/lib/resources/aws/compute/ec2.js +33 -6
  56. package/dist/lib/resources/aws/compute/ecs.d.ts +32 -25
  57. package/dist/lib/resources/aws/compute/ecs.js +31 -115
  58. package/dist/lib/resources/aws/compute/lambda.d.ts +94 -5
  59. package/dist/lib/resources/aws/compute/lambda.js +209 -32
  60. package/dist/lib/resources/aws/database/database.js +1 -1
  61. package/dist/lib/resources/aws/database/dynamodb.d.ts +70 -0
  62. package/dist/lib/resources/aws/database/dynamodb.js +181 -0
  63. package/dist/lib/resources/aws/database/index.d.ts +1 -0
  64. package/dist/lib/resources/aws/database/index.js +2 -1
  65. package/dist/lib/resources/aws/database/migrationLambda.d.ts +80 -0
  66. package/dist/lib/resources/aws/database/migrationLambda.js +119 -0
  67. package/dist/lib/resources/aws/database/rdsAurora.d.ts +15 -0
  68. package/dist/lib/resources/aws/database/rdsAurora.js +41 -18
  69. package/dist/lib/resources/aws/database/rdsAuroraGlobal.js +12 -8
  70. package/dist/lib/resources/aws/database/rdsInstance.js +2 -2
  71. package/dist/lib/resources/aws/index.d.ts +2 -0
  72. package/dist/lib/resources/aws/index.js +3 -1
  73. package/dist/lib/resources/aws/messaging/eventbridge.d.ts +28 -0
  74. package/dist/lib/resources/aws/messaging/eventbridge.js +53 -0
  75. package/dist/lib/resources/aws/messaging/index.d.ts +3 -0
  76. package/dist/lib/resources/aws/messaging/index.js +20 -0
  77. package/dist/lib/resources/aws/messaging/sns.d.ts +35 -0
  78. package/dist/lib/resources/aws/messaging/sns.js +70 -0
  79. package/dist/lib/resources/aws/messaging/sqs.d.ts +105 -0
  80. package/dist/lib/resources/aws/messaging/sqs.js +231 -0
  81. package/dist/lib/resources/aws/messaging/utils.d.ts +3 -0
  82. package/dist/lib/resources/aws/messaging/utils.js +7 -0
  83. package/dist/lib/resources/aws/networking/ipam.js +1 -2
  84. package/dist/lib/resources/aws/networking/ipamPool.js +3 -2
  85. package/dist/lib/resources/aws/networking/vpc.js +1 -2
  86. package/dist/lib/resources/aws/storage/ecr.js +8 -5
  87. package/dist/lib/resources/aws/storage/s3.js +1 -2
  88. package/dist/lib/resources/aws/utilities/awsCustomResource.js +1 -1
  89. package/dist/lib/resources/aws/utilities/customResource.js +1 -1
  90. package/dist/lib/utils/getConfig.js +3 -2
  91. package/dist/lib/utils/index.d.ts +1 -0
  92. package/dist/lib/utils/index.js +2 -1
  93. package/dist/lib/utils/manifestWriter.d.ts +174 -0
  94. package/dist/lib/utils/manifestWriter.js +233 -0
  95. package/dist/lib/utils/standardTagsAspect.js +1 -8
  96. package/dist/lib/utils/validationLogger.d.ts +34 -0
  97. package/dist/lib/utils/validationLogger.js +83 -0
  98. package/package.json +3 -3
  99. package/dist/lib/__tests__/setup.d.ts +0 -48
  100. package/dist/lib/__tests__/setup.js +0 -1
  101. package/dist/lib/patterns/aws/cicdRole.d.ts +0 -67
  102. package/dist/lib/patterns/aws/cicdRole.js +0 -68
  103. package/dist/lib/resources/aws/cicd/cicdRole.d.ts +0 -65
  104. package/dist/lib/resources/aws/cicd/cicdRole.js +0 -191
  105. package/dist/lib/resources/aws/compute/ecsFreeTier.d.ts +0 -75
  106. package/dist/lib/resources/aws/compute/ecsFreeTier.js +0 -1
  107. package/dist/lib/resources/aws/compute/ecsSpot.d.ts +0 -75
  108. package/dist/lib/resources/aws/compute/ecsSpot.js +0 -1
  109. package/dist/lib/resources/aws/compute/utilities/capacityProviderDrainWaiter.d.ts +0 -20
  110. package/dist/lib/resources/aws/compute/utilities/capacityProviderDrainWaiter.js +0 -1
  111. package/dist/lib/resources/aws/utilities/cfnOutput.d.ts +0 -5
  112. package/dist/lib/resources/aws/utilities/cfnOutput.js +0 -1
@@ -8,6 +8,7 @@ import { Certificate } from "aws-cdk-lib/aws-certificatemanager";
8
8
  import { type GeoLocation } from "aws-cdk-lib/aws-route53";
9
9
  import { Repository } from "aws-cdk-lib/aws-ecr";
10
10
  import { HostedZone as FjallHostedZone } from "../../../patterns/aws/hostedZone";
11
+ import { type ConnectionSpec } from "../../../patterns/aws/interfaces/connector.js";
11
12
  import { type SecretImport } from "../secrets";
12
13
  export declare enum Protocol {
13
14
  HTTP = 0,
@@ -89,18 +90,18 @@ export interface EcsClusterContainerConfig {
89
90
  port?: number;
90
91
  /** Environment variables */
91
92
  environment?: Record<string, string>;
92
- /** Secrets imported from other resources (AWS Secrets Manager) */
93
- secretsImport?: {
94
- [key: string]: SecretImport;
95
- };
96
93
  /**
97
94
  * Secrets from AWS SSM Parameter Store.
98
95
  * Array of secret names that will be fetched from the service's SSM namespace.
99
96
  *
100
97
  * @example
101
- * ssmSecrets: ["API_KEY", "DB_PASSWORD"]
98
+ * secrets: ["API_KEY", "DB_PASSWORD"]
102
99
  */
103
- ssmSecrets?: string[];
100
+ secrets?: string[];
101
+ /** Secrets imported from other CDK resources (AWS Secrets Manager) */
102
+ secretsImport?: {
103
+ [key: string]: SecretImport;
104
+ };
104
105
  /** Command to run in the container */
105
106
  command?: string[];
106
107
  /** Entry point for the container */
@@ -216,10 +217,25 @@ export interface EcsServiceProps {
216
217
  */
217
218
  taskRoleManagedPolicies?: IManagedPolicy[];
218
219
  /**
219
- * Resources this service needs to connect to (e.g., databases).
220
- * Creates security group rules to allow traffic from this specific service only.
220
+ * Resources this service needs to connect to (e.g., databases, S3 buckets, SQS queues).
221
+ * Creates security group rules for IConnectable resources and IAM grants for IAM resources.
222
+ *
223
+ * Supports:
224
+ * - IConnectable: Security group resources (RDS, ECS, etc.)
225
+ * - IStorageConnector: S3 buckets (IAM grants)
226
+ * - IDynamoDBConnector: DynamoDB tables (IAM grants)
227
+ * - IQueueConnector: SQS queues (IAM grants)
228
+ * - ConnectionConfig: Explicit access level configuration
229
+ *
230
+ * @example
231
+ * connections: [
232
+ * database, // Security group (RDS)
233
+ * { resource: cache, access: "read" }, // Read-only DynamoDB
234
+ * { resource: bucket, access: "write" }, // Write-only S3
235
+ * { resource: queue, access: "consume" } // Consume-only SQS
236
+ * ]
221
237
  */
222
- connections?: IConnectable[];
238
+ connections?: ConnectionSpec[];
223
239
  /**
224
240
  * Capacity provider for this service. REQUIRED.
225
241
  * Each service specifies its own capacity provider.
@@ -233,21 +249,20 @@ export interface EcsServiceProps {
233
249
  ec2Config?: Ec2CapacityConfig;
234
250
  /**
235
251
  * SSM Parameter Store path for secrets.
236
- * If containers have ssmSecrets defined, this path is used as the base path.
252
+ * If containers have secrets defined, this path is used as the base path.
237
253
  * Format: /<app>/<cluster>/<service>
238
254
  *
239
255
  * @example
240
256
  * ssmSecretsPath: "/myapp/api-cluster/users"
241
257
  */
242
258
  ssmSecretsPath?: string;
243
- /**
244
- * Path to Dockerfile for building this service's image.
245
- * Metadata for CLI build process, not used during CDK synthesis.
246
- */
247
- dockerfilePath?: string;
248
259
  /**
249
260
  * Docker build target stage for multi-stage Dockerfiles.
250
- * Metadata for CLI build process, not used during CDK synthesis.
261
+ * When specified, appends `-<target>` to the image tag.
262
+ *
263
+ * @example
264
+ * // With dockerTarget: "api", image tag becomes: myservice-api-latest
265
+ * dockerTarget: "api"
251
266
  */
252
267
  dockerTarget?: string;
253
268
  }
@@ -259,7 +274,7 @@ export type EcsClusterProps = {
259
274
  clusterName: string;
260
275
  /**
261
276
  * Application name for SSM secrets namespace.
262
- * Required when any container uses ssmSecrets without explicit ssmSecretsPath.
277
+ * Required when any container uses secrets without explicit ssmSecretsPath.
263
278
  * Used to build the path: /<appName>/<clusterName>/<serviceName>
264
279
  */
265
280
  appName?: string;
@@ -375,14 +390,6 @@ export default class EcsCluster extends Construct implements IConnectable {
375
390
  private registerServiceWithALB;
376
391
  private buildRoutingConditions;
377
392
  private addServiceScaling;
378
- /**
379
- * Checks if any service in the cluster uses EC2 capacity provider.
380
- */
381
- private hasAnyEc2Service;
382
- /**
383
- * Checks if any service in the cluster uses Fargate capacity provider.
384
- */
385
- private hasAnyFargateService;
386
393
  /**
387
394
  * Check if the VPC has NAT gateways.
388
395
  * - For Fjall Vpc: uses hasNatGateways property