sst 2.41.0 → 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.
package/constructs/Service.d.ts
CHANGED
|
@@ -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
|
-
* @
|
|
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
|
* {
|
package/constructs/Service.js
CHANGED
|
@@ -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
|
|
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", {
|
|
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],
|
|
@@ -19,7 +19,8 @@ function buildRouteTree(routes, level = 0) {
|
|
|
19
19
|
delete routeTree.branches[key];
|
|
20
20
|
}
|
|
21
21
|
else if (branch.nodes.length > 1) {
|
|
22
|
-
|
|
22
|
+
const deduplicatedNodes = branch.nodes.filter((node, index, arr) => arr.findIndex((n) => n.pattern === node.pattern) === index);
|
|
23
|
+
routeTree.branches[key] = buildRouteTree(deduplicatedNodes, level + 1);
|
|
23
24
|
branch.nodes = [];
|
|
24
25
|
}
|
|
25
26
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "sst",
|
|
4
|
-
"version": "2.41.
|
|
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.
|
|
121
|
+
"astro-sst": "2.41.2",
|
|
122
122
|
"async": "^3.2.4",
|
|
123
123
|
"tsx": "^3.12.1",
|
|
124
124
|
"typescript": "^5.2.2",
|