sst 2.41.1 → 2.41.2

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.
@@ -8,7 +8,7 @@ import { BindingProps, BindingResource } from "./util/binding.js";
8
8
  import { IVpc } from "aws-cdk-lib/aws-ec2";
9
9
  import { ContainerDefinitionOptions, CpuArchitecture, FargateService, FargateTaskDefinition, FargateServiceProps, ICluster } from "aws-cdk-lib/aws-ecs";
10
10
  import { RetentionDays } from "aws-cdk-lib/aws-logs";
11
- import { ApplicationLoadBalancer, ApplicationLoadBalancerProps, ApplicationTargetGroupProps } from "aws-cdk-lib/aws-elasticloadbalancingv2";
11
+ import { ApplicationLoadBalancer, ApplicationLoadBalancerProps, ApplicationTargetGroupProps, BaseApplicationListenerProps } from "aws-cdk-lib/aws-elasticloadbalancingv2";
12
12
  declare const supportedCpus: {
13
13
  "0.25 vCPU": number;
14
14
  "0.5 vCPU": number;
@@ -351,7 +351,20 @@ export interface ServiceProps {
351
351
  applicationLoadBalancer?: boolean | Omit<ApplicationLoadBalancerProps, "vpc">;
352
352
  /**
353
353
  * Customize the Application Load Balancer's target group.
354
- * @default true
354
+ * @example
355
+ * ```js
356
+ * {
357
+ * cdk: {
358
+ * applicationLoadBalancerListener: {
359
+ * port: 8080
360
+ * }
361
+ * }
362
+ * }
363
+ * ```
364
+ */
365
+ applicationLoadBalancerListener?: BaseApplicationListenerProps;
366
+ /**
367
+ * Customize the Application Load Balancer's target group.
355
368
  * @example
356
369
  * ```js
357
370
  * {
@@ -460,8 +460,10 @@ export class Service extends Construct {
460
460
  const { cdk } = this.props;
461
461
  // Do not create load balancer if disabled
462
462
  if (cdk?.applicationLoadBalancer === false) {
463
+ if (cdk?.applicationLoadBalancerListener)
464
+ throw new VisibleError(`In the "${this.node.id}" Service, the "cdk.applicationLoadBalancerListener" cannot be applied if the Application Load Balancer is disabled.`);
463
465
  if (cdk?.applicationLoadBalancerTargetGroup)
464
- throw new VisibleError(`In the "${this.node.id}" Service, the "cdk.applicationLoadBalancerTargetGroup" cannot be applied if the Application Load Balancer is diabled.`);
466
+ throw new VisibleError(`In the "${this.node.id}" Service, the "cdk.applicationLoadBalancerTargetGroup" cannot be applied if the Application Load Balancer is disabled.`);
465
467
  return {};
466
468
  }
467
469
  const alb = new ApplicationLoadBalancer(this, "LoadBalancer", {
@@ -471,7 +473,10 @@ export class Service extends Construct {
471
473
  ? {}
472
474
  : cdk?.applicationLoadBalancer),
473
475
  });
474
- const listener = alb.addListener("Listener", { port: 80 });
476
+ const listener = alb.addListener("Listener", {
477
+ port: 80,
478
+ ...cdk?.applicationLoadBalancerListener,
479
+ });
475
480
  const target = listener.addTargets("TargetGroup", {
476
481
  port: 80,
477
482
  targets: [service],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.41.1",
4
+ "version": "2.41.2",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
@@ -118,7 +118,7 @@
118
118
  "@types/ws": "^8.5.3",
119
119
  "@types/yargs": "^17.0.13",
120
120
  "archiver": "^5.3.1",
121
- "astro-sst": "2.41.1",
121
+ "astro-sst": "2.41.2",
122
122
  "async": "^3.2.4",
123
123
  "tsx": "^3.12.1",
124
124
  "typescript": "^5.2.2",