sst 2.33.2 → 2.33.4

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/cli/sst.js CHANGED
@@ -25,7 +25,6 @@ import { diff } from "./commands/diff.js";
25
25
  import { version } from "./commands/version.js";
26
26
  import { telemetry } from "./commands/telemetry.js";
27
27
  import { types } from "./commands/types.js";
28
- import { connect } from "./commands/connect.js";
29
28
  bootstrap(program);
30
29
  dev(program);
31
30
  deploy(program);
@@ -40,7 +39,6 @@ diff(program);
40
39
  version(program);
41
40
  telemetry(program);
42
41
  types(program);
43
- connect(program);
44
42
  if ("setSourceMapsEnabled" in process) {
45
43
  // @ts-expect-error
46
44
  process.setSourceMapsEnabled(true);
package/cli/ui/header.js CHANGED
@@ -9,7 +9,7 @@ export async function printHeader(input) {
9
9
  Colors.line(`${Colors.primary(` `)} ${Colors.bold("Stage:")} ${project.config.stage}`);
10
10
  if (input.console) {
11
11
  const local = await useLocalServerConfig();
12
- Colors.line(`${Colors.primary(` `)} ${Colors.bold("Console:")} ${Colors.link(local.url)}`);
12
+ Colors.line(`${Colors.primary(` `)} ${Colors.bold("Console:")} ${Colors.link(local.url + `/local/${project.config.name}/${project.config.stage}`)}`);
13
13
  }
14
14
  Colors.gap();
15
15
  }
@@ -326,7 +326,7 @@ export class EdgeFunction extends Construct {
326
326
  FunctionBucket: lambdaBucket.getAttString("BucketName"),
327
327
  FunctionParams: {
328
328
  Description: `${this.node.id} handler`,
329
- Handler: handler,
329
+ Handler: path.posix.join(...handler.split(path.sep)),
330
330
  Code: {
331
331
  S3Bucket: assetBucket,
332
332
  S3Key: assetKey,
@@ -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 { ApplicationLoadBalancerProps, ApplicationTargetGroupProps } from "aws-cdk-lib/aws-elasticloadbalancingv2";
10
+ import { ApplicationLoadBalancer, 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;
@@ -398,6 +398,7 @@ export declare class Service extends Construct implements SSTConstruct {
398
398
  private taskDefinition?;
399
399
  private service?;
400
400
  private distribution?;
401
+ private alb?;
401
402
  constructor(scope: Construct, id: string, props?: ServiceProps);
402
403
  /**
403
404
  * The CloudFront URL of the website.
@@ -417,6 +418,7 @@ export declare class Service extends Construct implements SSTConstruct {
417
418
  fargateService: FargateService | undefined;
418
419
  taskDefinition: FargateTaskDefinition | undefined;
419
420
  distribution: import("aws-cdk-lib/aws-cloudfront").IDistribution | undefined;
421
+ applicationLoadBalancer: ApplicationLoadBalancer | undefined;
420
422
  hostedZone: import("aws-cdk-lib/aws-route53").IHostedZone | undefined;
421
423
  certificate: import("aws-cdk-lib/aws-certificatemanager").ICertificate | undefined;
422
424
  } | undefined;
@@ -147,6 +147,7 @@ export class Service extends Construct {
147
147
  taskDefinition;
148
148
  service;
149
149
  distribution;
150
+ alb;
150
151
  constructor(scope, id, props) {
151
152
  super(scope, id);
152
153
  const app = scope.node.root;
@@ -176,6 +177,7 @@ export class Service extends Construct {
176
177
  const { cluster, container, taskDefinition, service } = this.createService(vpc);
177
178
  const { alb, target } = this.createLoadBalancer(vpc, service);
178
179
  this.createAutoScaling(service, target);
180
+ this.alb = alb;
179
181
  // Create Distribution
180
182
  this.distribution = this.createDistribution(alb);
181
183
  this.vpc = vpc;
@@ -244,6 +246,7 @@ export class Service extends Construct {
244
246
  fargateService: this.service,
245
247
  taskDefinition: this.taskDefinition,
246
248
  distribution: this.distribution?.cdk.distribution,
249
+ applicationLoadBalancer: this.alb,
247
250
  hostedZone: this.distribution?.cdk.hostedZone,
248
251
  certificate: this.distribution?.cdk.certificate,
249
252
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.33.2",
4
+ "version": "2.33.4",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
@@ -124,7 +124,7 @@
124
124
  "tsx": "^3.12.1",
125
125
  "typescript": "^5.2.2",
126
126
  "vitest": "^0.33.0",
127
- "astro-sst": "2.33.2"
127
+ "astro-sst": "2.33.4"
128
128
  },
129
129
  "peerDependencies": {
130
130
  "@sls-next/lambda-at-edge": "^3.7.0"
@@ -1,17 +0,0 @@
1
- /// <reference types="yargs" />
2
- import type { Program } from "../program.js";
3
- export declare const connect: (program: Program) => import("yargs").Argv<{
4
- stage: string | undefined;
5
- } & {
6
- profile: string | undefined;
7
- } & {
8
- region: string | undefined;
9
- } & {
10
- verbose: boolean | undefined;
11
- } & {
12
- role: string | undefined;
13
- } & {
14
- future: boolean | undefined;
15
- } & {
16
- dev: boolean;
17
- }>;
@@ -1,55 +0,0 @@
1
- import { Colors } from "../colors.js";
2
- export const connect = (program) => program.command("connect", "Connect a stage to SST Console", (yargs) => yargs.option("dev", {
3
- type: "boolean",
4
- default: false,
5
- describe: "Connect to SST dev account (probably don't want to do this)",
6
- }), async (args) => {
7
- if (!args.future)
8
- throw new Error("This command is not yet available.");
9
- const { exit, exitWithError } = await import("../program.js");
10
- const { useAWSClient } = await import("../../credentials.js");
11
- const { useProject } = await import("../../project.js");
12
- const { useSTSIdentity } = await import("../../credentials.js");
13
- const { IAMClient, CreateRoleCommand, AttachRolePolicyCommand } = await import("@aws-sdk/client-iam");
14
- try {
15
- const client = useAWSClient(IAMClient);
16
- if (args.dev) {
17
- Colors.line(Colors.warning("⚠"), Colors.bold(" Connecting to dev stage"));
18
- }
19
- await client
20
- .send(new CreateRoleCommand({
21
- RoleName: "sst",
22
- AssumeRolePolicyDocument: JSON.stringify({
23
- Version: "2012-10-17",
24
- Statement: [
25
- {
26
- Effect: "Allow",
27
- Principal: {
28
- AWS: `arn:aws:iam::${args.dev ? "917397401067" : "226609089145"}:root`,
29
- },
30
- Action: "sts:AssumeRole",
31
- },
32
- ],
33
- }),
34
- }))
35
- .catch((e) => {
36
- if (e.Error.Code === "EntityAlreadyExists")
37
- return;
38
- throw e;
39
- });
40
- await client.send(new AttachRolePolicyCommand({
41
- RoleName: "sst",
42
- PolicyArn: "arn:aws:iam::aws:policy/AdministratorAccess",
43
- }));
44
- const project = useProject();
45
- const identity = await useSTSIdentity();
46
- const host = args.dev
47
- ? "http://localhost:3000"
48
- : "https://console.production.sst.dev";
49
- console.log(`${host}/connect?app=${project.config.name}&stage=${project.config.stage}&aws_account_id=${identity.Account}&region=${project.config.region}`);
50
- await exit();
51
- }
52
- catch (e) {
53
- await exitWithError(e);
54
- }
55
- });