sst 2.33.0 → 2.33.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/bootstrap.js +1 -0
- package/constructs/Script.d.ts +5 -5
- package/constructs/Service.d.ts +13 -13
- package/constructs/Service.js +6 -7
- package/package.json +3 -3
- package/project.d.ts +1 -0
package/bootstrap.js
CHANGED
|
@@ -182,6 +182,7 @@ export async function bootstrapSST(cdkBucket) {
|
|
|
182
182
|
bucketArn: `arn:${stack.partition}:s3:::${cdkBucket}`,
|
|
183
183
|
}
|
|
184
184
|
: new Bucket(stack, region, {
|
|
185
|
+
bucketName: bootstrap?.bucketName,
|
|
185
186
|
encryption: BucketEncryption.S3_MANAGED,
|
|
186
187
|
removalPolicy: RemovalPolicy.DESTROY,
|
|
187
188
|
autoDeleteObjects: true,
|
package/constructs/Script.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ScriptProps {
|
|
|
11
11
|
* import { Script } from "sst/constructs";
|
|
12
12
|
*
|
|
13
13
|
* new Script(stack, "Script", {
|
|
14
|
-
* onCreate: "src/
|
|
14
|
+
* onCreate: "src/function.create",
|
|
15
15
|
* params: {
|
|
16
16
|
* hello: "world",
|
|
17
17
|
* },
|
|
@@ -27,7 +27,7 @@ export interface ScriptProps {
|
|
|
27
27
|
* import { Script } from "sst/constructs";
|
|
28
28
|
*
|
|
29
29
|
* new Script(stack, "Script", {
|
|
30
|
-
* onUpdate: "src/function.
|
|
30
|
+
* onUpdate: "src/function.update",
|
|
31
31
|
* version: "v17",
|
|
32
32
|
* });
|
|
33
33
|
* ```
|
|
@@ -55,7 +55,7 @@ export interface ScriptProps {
|
|
|
55
55
|
* @example
|
|
56
56
|
* ```js
|
|
57
57
|
* new Script(stack, "Api", {
|
|
58
|
-
* onCreate: "src/function.
|
|
58
|
+
* onCreate: "src/function.create",
|
|
59
59
|
* })
|
|
60
60
|
* ```
|
|
61
61
|
*/
|
|
@@ -68,7 +68,7 @@ export interface ScriptProps {
|
|
|
68
68
|
* @example
|
|
69
69
|
* ```js
|
|
70
70
|
* new Script(stack, "Api", {
|
|
71
|
-
* onUpdate: "src/function.
|
|
71
|
+
* onUpdate: "src/function.update",
|
|
72
72
|
* })
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
@@ -78,7 +78,7 @@ export interface ScriptProps {
|
|
|
78
78
|
* @example
|
|
79
79
|
* ```js
|
|
80
80
|
* new Script(stack, "Api", {
|
|
81
|
-
* onDelete: "src/function.
|
|
81
|
+
* onDelete: "src/function.delete",
|
|
82
82
|
* })
|
|
83
83
|
* ```
|
|
84
84
|
*/
|
package/constructs/Service.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { FunctionBindingProps } from "./util/functionBinding.js";
|
|
|
7
7
|
import { IVpc } from "aws-cdk-lib/aws-ec2";
|
|
8
8
|
import { Cluster, ContainerDefinitionOptions, CpuArchitecture, FargateService, FargateTaskDefinition, FargateServiceProps } from "aws-cdk-lib/aws-ecs";
|
|
9
9
|
import { RetentionDays } from "aws-cdk-lib/aws-logs";
|
|
10
|
-
import { ApplicationTargetGroupProps } from "aws-cdk-lib/aws-elasticloadbalancingv2";
|
|
10
|
+
import { ApplicationLoadBalancerProps, ApplicationTargetGroupProps } from "aws-cdk-lib/aws-elasticloadbalancingv2";
|
|
11
11
|
declare const supportedCpus: {
|
|
12
12
|
"0.25 vCPU": number;
|
|
13
13
|
"0.5 vCPU": number;
|
|
@@ -299,7 +299,7 @@ export interface ServiceProps {
|
|
|
299
299
|
* }
|
|
300
300
|
* ```
|
|
301
301
|
*/
|
|
302
|
-
applicationLoadBalancer?: boolean
|
|
302
|
+
applicationLoadBalancer?: boolean | Omit<ApplicationLoadBalancerProps, "vpc">;
|
|
303
303
|
/**
|
|
304
304
|
* Customize the Application Load Balancer's target group.
|
|
305
305
|
* @default true
|
|
@@ -392,11 +392,11 @@ export declare class Service extends Construct implements SSTConstruct {
|
|
|
392
392
|
private props;
|
|
393
393
|
private doNotDeploy;
|
|
394
394
|
private devFunction?;
|
|
395
|
-
private vpc
|
|
396
|
-
private cluster
|
|
397
|
-
private container
|
|
398
|
-
private taskDefinition
|
|
399
|
-
private service
|
|
395
|
+
private vpc?;
|
|
396
|
+
private cluster?;
|
|
397
|
+
private container?;
|
|
398
|
+
private taskDefinition?;
|
|
399
|
+
private service?;
|
|
400
400
|
private distribution?;
|
|
401
401
|
constructor(scope: Construct, id: string, props?: ServiceProps);
|
|
402
402
|
/**
|
|
@@ -412,10 +412,10 @@ export declare class Service extends Construct implements SSTConstruct {
|
|
|
412
412
|
* The internally created CDK resources.
|
|
413
413
|
*/
|
|
414
414
|
get cdk(): {
|
|
415
|
-
vpc: IVpc;
|
|
416
|
-
cluster: Cluster;
|
|
417
|
-
fargateService: FargateService;
|
|
418
|
-
taskDefinition: FargateTaskDefinition;
|
|
415
|
+
vpc: IVpc | undefined;
|
|
416
|
+
cluster: Cluster | undefined;
|
|
417
|
+
fargateService: FargateService | undefined;
|
|
418
|
+
taskDefinition: FargateTaskDefinition | undefined;
|
|
419
419
|
distribution: import("aws-cdk-lib/aws-cloudfront").IDistribution | undefined;
|
|
420
420
|
hostedZone: import("aws-cdk-lib/aws-route53").IHostedZone | undefined;
|
|
421
421
|
certificate: import("aws-cdk-lib/aws-certificatemanager").ICertificate | undefined;
|
|
@@ -428,8 +428,8 @@ export declare class Service extends Construct implements SSTConstruct {
|
|
|
428
428
|
customDomainUrl: string | undefined;
|
|
429
429
|
url: string | undefined;
|
|
430
430
|
devFunction: string | undefined;
|
|
431
|
-
task: string;
|
|
432
|
-
container: string;
|
|
431
|
+
task: string | undefined;
|
|
432
|
+
container: string | undefined;
|
|
433
433
|
secrets: string[];
|
|
434
434
|
};
|
|
435
435
|
};
|
package/constructs/Service.js
CHANGED
|
@@ -167,12 +167,6 @@ export class Service extends Construct {
|
|
|
167
167
|
this.validateMemoryAndCpu();
|
|
168
168
|
useServices().add(stack.stackName, id, this.props);
|
|
169
169
|
if (this.doNotDeploy) {
|
|
170
|
-
// @ts-expect-error
|
|
171
|
-
this.vpc = this.cluster = null;
|
|
172
|
-
// @ts-expect-error
|
|
173
|
-
this.service = this.container = this.taskDefinition = null;
|
|
174
|
-
// @ts-expect-error
|
|
175
|
-
this.distribution = null;
|
|
176
170
|
this.devFunction = this.createDevFunction();
|
|
177
171
|
app.registerTypes(this);
|
|
178
172
|
return;
|
|
@@ -453,6 +447,9 @@ export class Service extends Construct {
|
|
|
453
447
|
const alb = new ApplicationLoadBalancer(this, "LoadBalancer", {
|
|
454
448
|
vpc,
|
|
455
449
|
internetFacing: true,
|
|
450
|
+
...(cdk?.applicationLoadBalancer === true
|
|
451
|
+
? {}
|
|
452
|
+
: cdk?.applicationLoadBalancer),
|
|
456
453
|
});
|
|
457
454
|
const listener = alb.addListener("Listener", { port: 80 });
|
|
458
455
|
const target = listener.addTargets("TargetGroup", {
|
|
@@ -563,9 +560,11 @@ export class Service extends Construct {
|
|
|
563
560
|
});
|
|
564
561
|
}
|
|
565
562
|
addEnvironmentForService(name, value) {
|
|
566
|
-
this.container
|
|
563
|
+
this.container?.addEnvironment(name, value);
|
|
567
564
|
}
|
|
568
565
|
attachPermissionsForService(permissions) {
|
|
566
|
+
if (!this.taskDefinition)
|
|
567
|
+
return;
|
|
569
568
|
attachPermissionsToRole(this.taskDefinition.taskRole, permissions);
|
|
570
569
|
}
|
|
571
570
|
/////////////////////
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "sst",
|
|
4
|
-
"version": "2.33.
|
|
4
|
+
"version": "2.33.2",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sst": "cli/sst.js"
|
|
7
7
|
},
|
|
@@ -120,11 +120,11 @@
|
|
|
120
120
|
"@types/ws": "^8.5.3",
|
|
121
121
|
"@types/yargs": "^17.0.13",
|
|
122
122
|
"archiver": "^5.3.1",
|
|
123
|
-
"astro-sst": "2.33.0",
|
|
124
123
|
"async": "^3.2.4",
|
|
125
124
|
"tsx": "^3.12.1",
|
|
126
125
|
"typescript": "^5.2.2",
|
|
127
|
-
"vitest": "^0.33.0"
|
|
126
|
+
"vitest": "^0.33.0",
|
|
127
|
+
"astro-sst": "2.33.2"
|
|
128
128
|
},
|
|
129
129
|
"peerDependencies": {
|
|
130
130
|
"@sls-next/lambda-at-edge": "^3.7.0"
|