sst 2.0.0-rc.9 → 2.0.1
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.d.ts +2 -4
- package/bootstrap.js +208 -61
- package/bus.d.ts +3 -3
- package/bus.js +1 -1
- package/cache.js +1 -1
- package/cdk/cloudformation-deployments-wrapper.d.ts +3 -0
- package/cdk/cloudformation-deployments-wrapper.js +117 -0
- package/cdk/cloudformation-deployments.d.ts +19 -4
- package/cdk/deploy-stack.d.ts +17 -2
- package/cdk/deploy-stack.js +6 -1
- package/cli/colors.d.ts +28 -0
- package/cli/colors.js +27 -0
- package/cli/commands/bind.d.ts +4 -0
- package/cli/commands/bind.js +10 -7
- package/cli/commands/bootstrap.d.ts +13 -0
- package/cli/commands/bootstrap.js +11 -0
- package/cli/commands/build.d.ts +6 -2
- package/cli/commands/build.js +13 -8
- package/cli/commands/console.d.ts +5 -1
- package/cli/commands/console.js +8 -6
- package/cli/commands/deploy.d.ts +4 -2
- package/cli/commands/deploy.js +69 -29
- package/cli/commands/dev.d.ts +5 -1
- package/cli/commands/dev.js +157 -79
- package/cli/commands/diff.d.ts +15 -0
- package/cli/commands/diff.js +61 -0
- package/cli/commands/env.d.ts +5 -1
- package/cli/commands/env.js +14 -15
- package/cli/commands/plugins/kysely.js +13 -5
- package/cli/commands/plugins/pothos.js +9 -4
- package/cli/commands/remove.d.ts +4 -0
- package/cli/commands/remove.js +26 -18
- package/cli/commands/secrets/get.d.ts +7 -3
- package/cli/commands/secrets/get.js +11 -24
- package/cli/commands/secrets/list.d.ts +6 -2
- package/cli/commands/secrets/list.js +15 -7
- package/cli/commands/secrets/remove.d.ts +8 -4
- package/cli/commands/secrets/remove.js +18 -16
- package/cli/commands/secrets/secrets.js +3 -3
- package/cli/commands/secrets/set.d.ts +8 -6
- package/cli/commands/secrets/set.js +16 -33
- package/cli/commands/telemetry.d.ts +15 -0
- package/cli/commands/telemetry.js +17 -0
- package/cli/commands/transform.d.ts +15 -0
- package/cli/commands/transform.js +55 -0
- package/cli/commands/update.d.ts +6 -2
- package/cli/commands/update.js +41 -33
- package/cli/commands/version.d.ts +13 -0
- package/cli/commands/version.js +7 -0
- package/cli/local/router.d.ts +6 -6
- package/cli/local/router.js +3 -3
- package/cli/local/server.d.ts +5 -3
- package/cli/local/server.js +21 -14
- package/cli/program.d.ts +5 -1
- package/cli/program.js +29 -5
- package/cli/spinner.js +2 -0
- package/cli/sst.js +35 -23
- package/cli/telemetry/environment.d.ts +1 -1
- package/cli/telemetry/environment.js +1 -1
- package/cli/terminal.d.ts +1 -0
- package/cli/terminal.js +8 -0
- package/cli/ui/deploy.d.ts +3 -2
- package/cli/ui/deploy.js +106 -106
- package/cli/ui/functions.d.ts +2 -0
- package/cli/ui/functions.js +132 -0
- package/cli/ui/header.d.ts +5 -0
- package/cli/ui/header.js +16 -0
- package/cli/ui/stack.d.ts +1 -0
- package/cli/ui/stack.js +6 -0
- package/config.d.ts +1 -1
- package/config.js +8 -8
- package/constructs/Api.d.ts +3 -71
- package/constructs/Api.js +3 -42
- package/constructs/ApiGatewayV1Api.d.ts +3 -3
- package/constructs/ApiGatewayV1Api.js +4 -3
- package/constructs/App.d.ts +2 -22
- package/constructs/App.js +12 -25
- package/constructs/AppSyncApi.d.ts +4 -5
- package/constructs/AppSyncApi.js +8 -5
- package/constructs/AstroSite.d.ts +2 -3
- package/constructs/AstroSite.js +43 -53
- package/constructs/Auth.js +27 -16
- package/constructs/BaseSite.d.ts +10 -10
- package/constructs/BaseSite.js +2 -2
- package/constructs/Cognito.js +28 -28
- package/constructs/EdgeFunction.d.ts +6 -4
- package/constructs/EdgeFunction.js +56 -59
- package/constructs/EventBus.js +1 -1
- package/constructs/Function.d.ts +4 -44
- package/constructs/Function.js +14 -50
- package/constructs/FunctionalStack.d.ts +2 -2
- package/constructs/Job.d.ts +23 -63
- package/constructs/Job.js +11 -32
- package/constructs/Metadata.d.ts +18 -20
- package/constructs/NextjsSite.d.ts +21 -5
- package/constructs/NextjsSite.js +67 -101
- package/constructs/Queue.js +10 -10
- package/constructs/RDS.d.ts +1 -1
- package/constructs/RDS.js +1 -1
- package/constructs/RemixSite.d.ts +0 -2
- package/constructs/RemixSite.js +20 -20
- package/constructs/Script.js +1 -1
- package/constructs/Secret.js +5 -3
- package/constructs/SolidStartSite.d.ts +2 -3
- package/constructs/SolidStartSite.js +42 -52
- package/constructs/SsrFunction.d.ts +22 -0
- package/constructs/SsrFunction.js +113 -0
- package/constructs/SsrSite.d.ts +104 -104
- package/constructs/SsrSite.js +196 -217
- package/constructs/Stack.d.ts +1 -20
- package/constructs/Stack.js +3 -65
- package/constructs/StaticSite.d.ts +33 -53
- package/constructs/StaticSite.js +92 -118
- package/constructs/Table.d.ts +1 -1
- package/constructs/Table.js +4 -4
- package/constructs/Topic.js +1 -1
- package/constructs/cdk/certificate-base.d.ts +18 -0
- package/constructs/cdk/certificate-base.js +26 -0
- package/constructs/cdk/dns-validated-certificate.d.ts +77 -0
- package/constructs/cdk/dns-validated-certificate.js +125 -0
- package/constructs/cdk/website-redirect.d.ts +53 -0
- package/constructs/cdk/website-redirect.js +77 -0
- package/constructs/deferred_task.d.ts +1 -1
- package/constructs/deprecated/NextjsSite.js +8 -6
- package/constructs/index.d.ts +0 -6
- package/constructs/index.js +0 -6
- package/constructs/util/apiGatewayV1AccessLog.d.ts +1 -1
- package/constructs/util/apiGatewayV2AccessLog.js +4 -4
- package/constructs/util/apiGatewayV2Domain.js +9 -2
- package/constructs/util/appSyncApiDomain.d.ts +1 -1
- package/constructs/util/appSyncApiDomain.js +9 -15
- package/constructs/util/duration.d.ts +1 -1
- package/constructs/util/functionBinding.js +1 -1
- package/constructs/util/permission.d.ts +3 -3
- package/constructs/util/permission.js +16 -18
- package/constructs/util/size.d.ts +1 -1
- package/constructs/util/warning.js +2 -2
- package/context/context.d.ts +2 -2
- package/context/context.js +4 -4
- package/context/handler.d.ts +1 -1
- package/credentials.d.ts +1 -1
- package/credentials.js +42 -6
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/iot.js +6 -2
- package/logger.js +3 -1
- package/node/api/index.d.ts +2 -3
- package/node/api/index.js +8 -2
- package/node/auth/adapter/adapter.d.ts +1 -1
- package/node/auth/adapter/facebook.js +1 -1
- package/node/auth/adapter/github.js +4 -4
- package/node/auth/adapter/google.d.ts +1 -1
- package/node/auth/adapter/google.js +2 -2
- package/node/auth/adapter/twitch.js +1 -1
- package/node/auth/session.d.ts +1 -1
- package/node/config/index.d.ts +2 -2
- package/node/config/index.js +3 -8
- package/node/job/index.d.ts +2 -2
- package/node/site/index.js +3 -5
- package/package.json +26 -21
- package/pothos.js +1 -0
- package/project.d.ts +47 -0
- package/{app.js → project.js} +60 -53
- package/runtime/handlers/dotnet.d.ts +1 -1
- package/runtime/handlers/dotnet.js +4 -4
- package/runtime/handlers/go.d.ts +1 -1
- package/runtime/handlers/go.js +3 -3
- package/runtime/handlers/java.d.ts +1 -1
- package/runtime/handlers/java.js +4 -4
- package/runtime/handlers/node.d.ts +1 -1
- package/runtime/handlers/node.js +60 -39
- package/runtime/handlers/python.d.ts +1 -1
- package/runtime/handlers/python.js +3 -3
- package/runtime/handlers.js +15 -12
- package/runtime/iot.js +3 -0
- package/runtime/runtime.d.ts +4 -0
- package/runtime/server.d.ts +3 -3
- package/runtime/server.js +11 -5
- package/runtime/workers.d.ts +4 -2
- package/runtime/workers.js +13 -3
- package/site-env.js +2 -1
- package/sst.mjs +6357 -20848
- package/stacks/app-metadata.d.ts +7 -0
- package/stacks/app-metadata.js +78 -0
- package/stacks/assembly.d.ts +1 -0
- package/stacks/assembly.js +4 -0
- package/stacks/build.d.ts +1 -1
- package/stacks/build.js +41 -48
- package/stacks/deploy.d.ts +1 -0
- package/stacks/deploy.js +128 -7
- package/stacks/diff.d.ts +8 -0
- package/stacks/diff.js +62 -0
- package/stacks/index.d.ts +3 -0
- package/stacks/index.js +3 -0
- package/stacks/metadata.d.ts +2 -0
- package/stacks/metadata.js +14 -12
- package/stacks/monitor.d.ts +8 -3
- package/stacks/monitor.js +38 -4
- package/stacks/remove.js +0 -4
- package/stacks/synth.d.ts +1 -0
- package/stacks/synth.js +27 -13
- package/support/base-site-archiver.mjs +1 -1
- package/support/bootstrap-metadata-function/index.mjs +68740 -0
- package/support/bridge/bridge.mjs +28 -28
- package/support/certificate-requestor/index.js +549 -0
- package/support/custom-resources/index.mjs +3824 -26567
- package/support/dotnet6-bootstrap/release/dotnet-bootstrap.deps.json +1 -1
- package/support/dotnet6-bootstrap/release/dotnet-bootstrap.runtimeconfig.json +1 -1
- package/support/edge-function/edge-lambda.mjs +2 -2
- package/support/job-invoker/index.mjs +26 -0
- package/support/nodejs-runtime/index.mjs +75 -72
- package/support/rds-migrator/index.mjs +22 -23
- package/support/remix-site-function/edge-server.js +1 -1
- package/support/script-function/index.mjs +30485 -0
- package/support/{edge-function-code-replacer → sls-nextjs-site-function-code-replacer}/lambda-code-updater.py +0 -0
- package/support/ssr-site-function-archiver.mjs +96 -0
- package/watcher.js +1 -1
- package/app.d.ts +0 -36
- package/constructs/DebugApp.d.ts +0 -49
- package/constructs/DebugApp.js +0 -63
- package/constructs/DebugStack.d.ts +0 -34
- package/constructs/DebugStack.js +0 -132
- package/constructs/GraphQLApi.d.ts +0 -98
- package/constructs/GraphQLApi.js +0 -80
- package/constructs/ReactStaticSite.d.ts +0 -20
- package/constructs/ReactStaticSite.js +0 -54
- package/constructs/Script/cfn-response.d.ts +0 -19
- package/constructs/Script/cfn-response.js +0 -77
- package/constructs/Script/index.d.ts +0 -1
- package/constructs/Script/index.js +0 -78
- package/constructs/Script/outbound.d.ts +0 -10
- package/constructs/Script/outbound.js +0 -42
- package/constructs/Script/util.d.ts +0 -2
- package/constructs/Script/util.js +0 -11
- package/constructs/ViteStaticSite.d.ts +0 -32
- package/constructs/ViteStaticSite.js +0 -66
- package/support/astro-site-html-stub/index.html +0 -99
- package/support/base-site-archiver.cjs +0 -116
- package/support/nextjs-site-html-stub/index.html +0 -99
- package/support/remix-site-html-stub/index.html +0 -99
- package/support/solid-start-site-html-stub/index.html +0 -99
- package/support/static-site-stub/index.html +0 -90
package/constructs/Stack.d.ts
CHANGED
|
@@ -2,10 +2,9 @@ import { Construct } from "constructs";
|
|
|
2
2
|
import * as cdk from "aws-cdk-lib";
|
|
3
3
|
import * as lambda from "aws-cdk-lib/aws-lambda";
|
|
4
4
|
import { FunctionProps, Function as Fn } from "./Function.js";
|
|
5
|
-
import * as Config from "./Config.js";
|
|
6
5
|
import { SSTConstruct } from "./Construct.js";
|
|
7
6
|
import { Permissions } from "./util/permission.js";
|
|
8
|
-
export
|
|
7
|
+
export type StackProps = cdk.StackProps;
|
|
9
8
|
/**
|
|
10
9
|
* The Stack construct extends cdk.Stack. It automatically prefixes the stack names with the stage and app name to ensure that they can be deployed to multiple regions in the same AWS account. It also ensure that the stack uses the same AWS profile and region as the app. They're defined using functions that return resources that can be imported by other stacks.
|
|
11
10
|
*
|
|
@@ -32,7 +31,6 @@ export declare class Stack extends cdk.Stack {
|
|
|
32
31
|
* @internal
|
|
33
32
|
*/
|
|
34
33
|
readonly customResourceHandler: lambda.Function;
|
|
35
|
-
private readonly metadata;
|
|
36
34
|
constructor(scope: Construct, id: string, props?: StackProps);
|
|
37
35
|
/**
|
|
38
36
|
* The default function props to be applied to all the Lambda functions in the stack.
|
|
@@ -66,21 +64,6 @@ export declare class Stack extends cdk.Stack {
|
|
|
66
64
|
* ```
|
|
67
65
|
*/
|
|
68
66
|
addDefaultFunctionEnv(environment: Record<string, string>): void;
|
|
69
|
-
/**
|
|
70
|
-
* Adds additional default config to be applied to all Lambda functions in the stack.
|
|
71
|
-
*
|
|
72
|
-
* @deprecated The "addDefaultFunctionConfig" method will be removed in SST v2. Pass Parameters and Secrets in through the "addDefaultFunctionBinding" function. Read more about how to upgrade here — https://docs.serverless-stack.com/upgrade-guide#upgrade-to-v116
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```js
|
|
76
|
-
* // Change
|
|
77
|
-
* stack.addDefaultFunctionConfig([STRIPE_KEY]);
|
|
78
|
-
*
|
|
79
|
-
* // To
|
|
80
|
-
* stack.addDefaultFunctionBinding([STRIPE_KEY]);
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
addDefaultFunctionConfig(config: (Config.Secret | Config.Parameter)[]): void;
|
|
84
67
|
/**
|
|
85
68
|
* Binds additional resources to be applied to all Lambda functions in the stack.
|
|
86
69
|
*
|
|
@@ -129,9 +112,7 @@ export declare class Stack extends cdk.Stack {
|
|
|
129
112
|
* ```
|
|
130
113
|
*/
|
|
131
114
|
addOutputs(outputs: Record<string, string | cdk.CfnOutputProps>): void;
|
|
132
|
-
setStackMetadata(metadata: any): void;
|
|
133
115
|
private createCustomResourceHandler;
|
|
134
|
-
private createStackMetadataResource;
|
|
135
116
|
private static checkForPropsIsConstruct;
|
|
136
117
|
private static checkForEnvInProps;
|
|
137
118
|
}
|
package/constructs/Stack.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import url from "url";
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import * as cdk from "aws-cdk-lib";
|
|
4
|
-
import * as iam from "aws-cdk-lib/aws-iam";
|
|
5
4
|
import * as lambda from "aws-cdk-lib/aws-lambda";
|
|
6
5
|
import { Function as Fn } from "./Function.js";
|
|
7
6
|
import { isConstruct } from "./Construct.js";
|
|
8
|
-
import { createRequire } from "module";
|
|
9
|
-
import { useApp } from "./context.js";
|
|
10
|
-
import { useProject } from "../app.js";
|
|
11
|
-
const require = createRequire(import.meta.url);
|
|
12
7
|
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
13
8
|
/**
|
|
14
9
|
* The Stack construct extends cdk.Stack. It automatically prefixes the stack names with the stage and app name to ensure that they can be deployed to multiple regions in the same AWS account. It also ensure that the stack uses the same AWS profile and region as the app. They're defined using functions that return resources that can be imported by other stacks.
|
|
@@ -36,7 +31,6 @@ export class Stack extends cdk.Stack {
|
|
|
36
31
|
* @internal
|
|
37
32
|
*/
|
|
38
33
|
customResourceHandler;
|
|
39
|
-
metadata;
|
|
40
34
|
constructor(scope, id, props) {
|
|
41
35
|
const root = scope.node.root;
|
|
42
36
|
const stackId = root.logicalPrefixedName(id);
|
|
@@ -51,15 +45,9 @@ export class Stack extends cdk.Stack {
|
|
|
51
45
|
});
|
|
52
46
|
this.stage = root.stage;
|
|
53
47
|
this.defaultFunctionProps = root.defaultFunctionProps.map((dfp) => typeof dfp === "function" ? dfp(this) : dfp);
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
// We do this two step process because we call the "Template.fromStack"
|
|
57
|
-
// method in the tests. And the call triggers an app synethsis. And we
|
|
58
|
-
// end up synthesize an app multiple times. If we created the Metadata
|
|
59
|
-
// resource on app synth, the tests would fail because the resource
|
|
60
|
-
// would already exist.
|
|
48
|
+
// Create a custom resource handler per stack. This handler will
|
|
49
|
+
// be used by all the custom resources in the stack.
|
|
61
50
|
this.customResourceHandler = this.createCustomResourceHandler();
|
|
62
|
-
this.metadata = this.createStackMetadataResource();
|
|
63
51
|
}
|
|
64
52
|
/**
|
|
65
53
|
* The default function props to be applied to all the Lambda functions in the stack.
|
|
@@ -106,23 +94,6 @@ export class Stack extends cdk.Stack {
|
|
|
106
94
|
environment,
|
|
107
95
|
});
|
|
108
96
|
}
|
|
109
|
-
/**
|
|
110
|
-
* Adds additional default config to be applied to all Lambda functions in the stack.
|
|
111
|
-
*
|
|
112
|
-
* @deprecated The "addDefaultFunctionConfig" method will be removed in SST v2. Pass Parameters and Secrets in through the "addDefaultFunctionBinding" function. Read more about how to upgrade here — https://docs.serverless-stack.com/upgrade-guide#upgrade-to-v116
|
|
113
|
-
*
|
|
114
|
-
* @example
|
|
115
|
-
* ```js
|
|
116
|
-
* // Change
|
|
117
|
-
* stack.addDefaultFunctionConfig([STRIPE_KEY]);
|
|
118
|
-
*
|
|
119
|
-
* // To
|
|
120
|
-
* stack.addDefaultFunctionBinding([STRIPE_KEY]);
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
addDefaultFunctionConfig(config) {
|
|
124
|
-
this.defaultFunctionProps.push({ config });
|
|
125
|
-
}
|
|
126
97
|
/**
|
|
127
98
|
* Binds additional resources to be applied to all Lambda functions in the stack.
|
|
128
99
|
*
|
|
@@ -200,13 +171,10 @@ export class Stack extends cdk.Stack {
|
|
|
200
171
|
}
|
|
201
172
|
});
|
|
202
173
|
}
|
|
203
|
-
setStackMetadata(metadata) {
|
|
204
|
-
this.metadata.node.defaultChild.addPropertyOverride("Metadata", metadata);
|
|
205
|
-
}
|
|
206
174
|
createCustomResourceHandler() {
|
|
207
175
|
return new lambda.Function(this, "CustomResourceHandler", {
|
|
208
176
|
code: lambda.Code.fromAsset(path.join(__dirname, "../support/custom-resources/"), {
|
|
209
|
-
assetHash: this.stackName + "-custom-resources-
|
|
177
|
+
assetHash: this.stackName + "-custom-resources-20230130",
|
|
210
178
|
}),
|
|
211
179
|
handler: "index.handler",
|
|
212
180
|
runtime: lambda.Runtime.NODEJS_16_X,
|
|
@@ -214,36 +182,6 @@ export class Stack extends cdk.Stack {
|
|
|
214
182
|
memorySize: 1024,
|
|
215
183
|
});
|
|
216
184
|
}
|
|
217
|
-
createStackMetadataResource() {
|
|
218
|
-
const app = useApp();
|
|
219
|
-
// Create execution policy
|
|
220
|
-
this.customResourceHandler.addToRolePolicy(new iam.PolicyStatement({
|
|
221
|
-
actions: ["s3:PutObject", "s3:DeleteObject"],
|
|
222
|
-
resources: [`arn:aws:s3:::${app.bootstrap.bucket}/*`],
|
|
223
|
-
}));
|
|
224
|
-
// Temporary: Add permissions to migrate SSM paths for secrets (piggybacking on the stack metadata custom resource handler)
|
|
225
|
-
this.customResourceHandler.addToRolePolicy(new iam.PolicyStatement({
|
|
226
|
-
actions: ["ssm:GetParametersByPath", "ssm:PutParameter"],
|
|
227
|
-
resources: [
|
|
228
|
-
`arn:aws:ssm:${app.region}:${app.account}:parameter/sst/${app.name}/${app.stage}/*`,
|
|
229
|
-
`arn:aws:ssm:${app.region}:${app.account}:parameter/sst/${app.name}/.fallback/*`,
|
|
230
|
-
],
|
|
231
|
-
}));
|
|
232
|
-
return new cdk.CustomResource(this, "StackMetadata", {
|
|
233
|
-
serviceToken: this.customResourceHandler.functionArn,
|
|
234
|
-
resourceType: "Custom::StackMetadata",
|
|
235
|
-
properties: {
|
|
236
|
-
App: app.name,
|
|
237
|
-
Stage: this.stage,
|
|
238
|
-
Stack: this.stackName,
|
|
239
|
-
SSTVersion: useProject().version,
|
|
240
|
-
BootstrapBucketName: app.bootstrap.bucket,
|
|
241
|
-
ForceUpdate: process.env.SST_FORCE_UPDATE_METADATA
|
|
242
|
-
? Date.now().toString()
|
|
243
|
-
: undefined,
|
|
244
|
-
},
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
185
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
248
186
|
static checkForPropsIsConstruct(id, props) {
|
|
249
187
|
// If a construct is passed in as stack props, let's detect it and throw a
|
|
@@ -14,7 +14,7 @@ export interface StaticSiteFileOptions {
|
|
|
14
14
|
export interface StaticSiteProps {
|
|
15
15
|
/**
|
|
16
16
|
* Path to the directory where the website source is located.
|
|
17
|
-
*
|
|
17
|
+
* @default "."
|
|
18
18
|
* @example
|
|
19
19
|
* ```js
|
|
20
20
|
* new StaticSite(stack, "Site", {
|
|
@@ -22,7 +22,7 @@ export interface StaticSiteProps {
|
|
|
22
22
|
* });
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
path
|
|
25
|
+
path?: string;
|
|
26
26
|
/**
|
|
27
27
|
* The name of the index page (e.g. "index.html") of the website.
|
|
28
28
|
* @default "index.html"
|
|
@@ -179,19 +179,21 @@ export interface StaticSiteProps {
|
|
|
179
179
|
* ```
|
|
180
180
|
*/
|
|
181
181
|
purgeFiles?: boolean;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
182
|
+
dev?: {
|
|
183
|
+
/**
|
|
184
|
+
* When running `sst dev, site is not deployed. This is to ensure `sst dev` can start up quickly.
|
|
185
|
+
* @default false
|
|
186
|
+
* @example
|
|
187
|
+
* ```js
|
|
188
|
+
* new StaticSite(stack, "frontend", {
|
|
189
|
+
* dev: {
|
|
190
|
+
* deploy: true
|
|
191
|
+
* }
|
|
192
|
+
* });
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
deploy?: boolean;
|
|
196
|
+
};
|
|
195
197
|
vite?: {
|
|
196
198
|
/**
|
|
197
199
|
* The path where code-gen should place the type definition for environment variables
|
|
@@ -209,11 +211,11 @@ export interface StaticSiteProps {
|
|
|
209
211
|
};
|
|
210
212
|
/**
|
|
211
213
|
* While deploying, SST waits for the CloudFront cache invalidation process to finish. This ensures that the new content will be served once the deploy command finishes. However, this process can sometimes take more than 5 mins. For non-prod environments it might make sense to pass in `false`. That'll skip waiting for the cache to invalidate and speed up the deploy process.
|
|
212
|
-
* @default
|
|
214
|
+
* @default false
|
|
213
215
|
* @example
|
|
214
216
|
* ```js
|
|
215
217
|
* new StaticSite(stack, "frontend", {
|
|
216
|
-
* waitForInvalidation:
|
|
218
|
+
* waitForInvalidation: true
|
|
217
219
|
* });
|
|
218
220
|
* ```
|
|
219
221
|
*/
|
|
@@ -280,55 +282,33 @@ export interface StaticSiteCdkDistributionProps extends BaseSiteCdkDistributionP
|
|
|
280
282
|
*/
|
|
281
283
|
export declare class StaticSite extends Construct implements SSTConstruct {
|
|
282
284
|
readonly id: string;
|
|
283
|
-
readonly cdk: {
|
|
284
|
-
/**
|
|
285
|
-
* The internally created CDK `Bucket` instance.
|
|
286
|
-
*/
|
|
287
|
-
bucket: s3.Bucket;
|
|
288
|
-
/**
|
|
289
|
-
* The internally created CDK `Distribution` instance.
|
|
290
|
-
*/
|
|
291
|
-
distribution: cloudfront.Distribution;
|
|
292
|
-
/**
|
|
293
|
-
* The Route 53 hosted zone for the custom domain.
|
|
294
|
-
*/
|
|
295
|
-
hostedZone?: route53.IHostedZone;
|
|
296
|
-
certificate?: acm.ICertificate;
|
|
297
|
-
};
|
|
298
285
|
private props;
|
|
299
|
-
private
|
|
300
|
-
private
|
|
301
|
-
private
|
|
302
|
-
private
|
|
303
|
-
|
|
286
|
+
private doNotDeploy;
|
|
287
|
+
private bucket;
|
|
288
|
+
private distribution;
|
|
289
|
+
private hostedZone?;
|
|
290
|
+
private certificate?;
|
|
291
|
+
constructor(scope: Construct, id: string, props?: StaticSiteProps);
|
|
304
292
|
/**
|
|
305
293
|
* The CloudFront URL of the website.
|
|
306
294
|
*/
|
|
307
|
-
get url(): string;
|
|
295
|
+
get url(): string | undefined;
|
|
308
296
|
/**
|
|
309
297
|
* If the custom domain is enabled, this is the URL of the website with the custom domain.
|
|
310
298
|
*/
|
|
311
299
|
get customDomainUrl(): string | undefined;
|
|
312
300
|
/**
|
|
313
|
-
* The
|
|
301
|
+
* The internally created CDK resources.
|
|
314
302
|
*/
|
|
315
|
-
get
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
* The ID of the internally created CloudFront Distribution.
|
|
322
|
-
*/
|
|
323
|
-
get distributionId(): string;
|
|
324
|
-
/**
|
|
325
|
-
* The domain name of the internally created CloudFront Distribution.
|
|
326
|
-
*/
|
|
327
|
-
get distributionDomain(): string;
|
|
303
|
+
get cdk(): {
|
|
304
|
+
bucket: s3.Bucket;
|
|
305
|
+
distribution: cloudfront.Distribution;
|
|
306
|
+
hostedZone: route53.IHostedZone | undefined;
|
|
307
|
+
certificate: acm.ICertificate | undefined;
|
|
308
|
+
};
|
|
328
309
|
getConstructMetadata(): {
|
|
329
310
|
type: "StaticSite";
|
|
330
311
|
data: {
|
|
331
|
-
distributionId: string;
|
|
332
312
|
customDomainUrl: string | undefined;
|
|
333
313
|
};
|
|
334
314
|
};
|