@ts-cloud/core 0.16.36 → 0.16.38

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.
@@ -148,6 +148,25 @@ export interface ScalingPolicyOptions {
148
148
  scaleInCooldown?: number;
149
149
  scaleOutCooldown?: number;
150
150
  }
151
+ /**
152
+ * Whether an EC2 instance type runs on Graviton (arm64): `a1`, and every
153
+ * family whose generation number is followed by `g` - t4g, m7g, c7gn, r8g,
154
+ * x2gd, im4gn, is4gen, g5g.
155
+ */
156
+ export declare function isArmInstanceType(instanceType: string): boolean;
157
+ /**
158
+ * AWS's public SSM parameter for the current Amazon Linux 2023 AMI of the
159
+ * instance type's architecture. AWS keeps one in every region.
160
+ */
161
+ export declare function amazonLinuxImageParameter(instanceType?: string): string;
162
+ /**
163
+ * An `ImageId` that CloudFormation resolves to that AMI in the stack's own
164
+ * region, as a `{{resolve:ssm:...}}` dynamic reference. A template parameter
165
+ * of type `AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>` would do the same,
166
+ * but the module helpers return resources, not whole templates, so they have
167
+ * nowhere to declare one.
168
+ */
169
+ export declare function amazonLinuxImageId(instanceType?: string): string;
151
170
  /**
152
171
  * Compute Module - EC2, ECS, Lambda Management
153
172
  * Provides clean API for both server (Forge-style) and serverless (Vapor-style) deployments
@@ -468,21 +487,36 @@ export declare class Compute {
468
487
  }>;
469
488
  };
470
489
  /**
471
- * Create a JumpBox (Bastion Host) for SSH access to private resources
490
+ * Create a JumpBox (Bastion Host) for access to private resources.
491
+ *
492
+ * Shell access is SSM Session Manager (`aws ssm start-session`): the role
493
+ * carries AmazonSSMManagedInstanceCore and Amazon Linux 2023 ships the
494
+ * agent, so no key pair and no open port are needed. `keyName` adds SSH on
495
+ * top, and only then - or when `allowedCidrs` is given - is port 22 opened.
496
+ *
497
+ * The image is the region's current Amazon Linux 2023, resolved from AWS's
498
+ * public SSM parameter for the instance type's architecture. It used to be
499
+ * a us-east-1 AMI literal, which no other region has, and `keyName` was
500
+ * required, naming a key pair that had to exist before the deploy.
472
501
  */
473
502
  static createJumpBox(options: {
474
503
  slug: string;
475
504
  environment: EnvironmentType;
476
505
  vpcId: string;
477
506
  subnetId: string;
478
- keyName: string;
507
+ keyName?: string;
479
508
  instanceType?: string;
480
509
  imageId?: string;
481
510
  allowedCidrs?: string[];
482
511
  mountEfs?: {
483
- fileSystemId: string;
512
+ /** An EFS id, or a `{ Ref }` to a file system in the same template. */
513
+ fileSystemId: string | {
514
+ Ref: string;
515
+ };
484
516
  mountPath?: string;
485
517
  };
518
+ /** Install the PostgreSQL, MariaDB and Redis clients. */
519
+ databaseTools?: boolean;
486
520
  }): {
487
521
  instance: EC2Instance;
488
522
  securityGroup: EC2SecurityGroup;
@@ -506,42 +540,25 @@ export declare class Compute {
506
540
  environment: EnvironmentType;
507
541
  vpcId: string;
508
542
  subnetId: string;
509
- keyName: string;
510
- fileSystemId: string;
543
+ keyName?: string;
544
+ instanceType?: string;
545
+ fileSystemId: string | {
546
+ Ref: string;
547
+ };
511
548
  mountPath?: string;
512
549
  allowedCidrs?: string[];
513
- }) => {
514
- instance: EC2Instance;
515
- securityGroup: EC2SecurityGroup;
516
- instanceProfile: any;
517
- instanceRole: IAMRole;
518
- instanceLogicalId: string;
519
- securityGroupLogicalId: string;
520
- instanceProfileLogicalId: string;
521
- instanceRoleLogicalId: string;
522
- resources: Record<string, any>;
523
- };
550
+ }) => ReturnType<typeof Compute.createJumpBox>;
524
551
  /**
525
- * Create minimal JumpBox (SSH only)
552
+ * Create minimal JumpBox
526
553
  */
527
554
  minimal: (params: {
528
555
  slug: string;
529
556
  environment: EnvironmentType;
530
557
  vpcId: string;
531
558
  subnetId: string;
532
- keyName: string;
559
+ keyName?: string;
533
560
  allowedCidrs?: string[];
534
- }) => {
535
- instance: EC2Instance;
536
- securityGroup: EC2SecurityGroup;
537
- instanceProfile: any;
538
- instanceRole: IAMRole;
539
- instanceLogicalId: string;
540
- securityGroupLogicalId: string;
541
- instanceProfileLogicalId: string;
542
- instanceRoleLogicalId: string;
543
- resources: Record<string, any>;
544
- };
561
+ }) => ReturnType<typeof Compute.createJumpBox>;
545
562
  /**
546
563
  * Create JumpBox with database tools
547
564
  */
@@ -550,19 +567,10 @@ export declare class Compute {
550
567
  environment: EnvironmentType;
551
568
  vpcId: string;
552
569
  subnetId: string;
553
- keyName: string;
570
+ keyName?: string;
571
+ instanceType?: string;
554
572
  allowedCidrs?: string[];
555
- }) => {
556
- instance: EC2Instance;
557
- securityGroup: EC2SecurityGroup;
558
- instanceProfile: any;
559
- instanceRole: IAMRole;
560
- instanceLogicalId: string;
561
- securityGroupLogicalId: string;
562
- instanceProfileLogicalId: string;
563
- instanceRoleLogicalId: string;
564
- resources: Record<string, any>;
565
- };
573
+ }) => ReturnType<typeof Compute.createJumpBox>;
566
574
  /**
567
575
  * Allowed CIDRs for corporate VPNs (common patterns)
568
576
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ts-cloud/core",
3
3
  "type": "module",
4
- "version": "0.16.36",
4
+ "version": "0.16.38",
5
5
  "description": "Core CloudFormation generation library for ts-cloud",
6
6
  "author": "Chris Breuer <chris@stacksjs.com>",
7
7
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "typecheck": "tsc --noEmit"
32
32
  },
33
33
  "dependencies": {
34
- "@ts-cloud/aws-types": "0.16.36"
34
+ "@ts-cloud/aws-types": "0.16.38"
35
35
  },
36
36
  "devDependencies": {
37
37
  "typescript": "^7.0.2"