sst 2.43.2 → 2.43.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/constructs/Function.js +1 -1
- package/constructs/NextjsSite.js +2 -2
- package/constructs/Service.d.ts +16 -1
- package/constructs/Service.js +12 -11
- package/package.json +2 -2
package/constructs/Function.js
CHANGED
|
@@ -32,7 +32,7 @@ import { Config } from "../config.js";
|
|
|
32
32
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
33
33
|
const supportedRuntimes = {
|
|
34
34
|
container: CDKRuntime.FROM_IMAGE,
|
|
35
|
-
rust: CDKRuntime.
|
|
35
|
+
rust: CDKRuntime.PROVIDED_AL2023,
|
|
36
36
|
"nodejs16.x": CDKRuntime.NODEJS_16_X,
|
|
37
37
|
"nodejs18.x": CDKRuntime.NODEJS_18_X,
|
|
38
38
|
"nodejs20.x": CDKRuntime.NODEJS_20_X,
|
package/constructs/NextjsSite.js
CHANGED
|
@@ -74,9 +74,9 @@ export class NextjsSite extends SsrSite {
|
|
|
74
74
|
...baseServerConfig,
|
|
75
75
|
handler: fn.handler,
|
|
76
76
|
bundle: path.join(sitePath, fn.bundle),
|
|
77
|
-
runtime: "nodejs18.x",
|
|
77
|
+
runtime: this.props.runtime ?? "nodejs18.x",
|
|
78
78
|
architecture: Architecture.ARM_64,
|
|
79
|
-
memorySize: 1536,
|
|
79
|
+
memorySize: this.props.memorySize ?? 1536,
|
|
80
80
|
environment: {
|
|
81
81
|
...environment,
|
|
82
82
|
...baseServerConfig.environment,
|
package/constructs/Service.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Construct } from "constructs";
|
|
2
2
|
import { DockerCacheOption } from "aws-cdk-lib/core";
|
|
3
|
-
import { DistributionProps } from "aws-cdk-lib/aws-cloudfront";
|
|
3
|
+
import { DistributionProps, ICachePolicy } from "aws-cdk-lib/aws-cloudfront";
|
|
4
4
|
import { DistributionDomainProps } from "./Distribution.js";
|
|
5
5
|
import { SSTConstruct } from "./Construct.js";
|
|
6
6
|
import { Permissions } from "./util/permission.js";
|
|
@@ -443,6 +443,21 @@ export interface ServiceProps {
|
|
|
443
443
|
* ```
|
|
444
444
|
*/
|
|
445
445
|
vpc?: IVpc;
|
|
446
|
+
/**
|
|
447
|
+
* By default, SST creates a CloudFront cache policy. Pass in a value to override the default policy.
|
|
448
|
+
*
|
|
449
|
+
* @example
|
|
450
|
+
* ```js
|
|
451
|
+
* import { CachePolicy } from "aws-cdk-lib/aws-cloudfront";
|
|
452
|
+
*
|
|
453
|
+
* {
|
|
454
|
+
* cdk: {
|
|
455
|
+
* cachePolicy: CachePolicy.fromCachePolicyId(stack, "CachePolicy", "83da9c7e-98b4-4e11-a168-04f0df8e2c65"),
|
|
456
|
+
* }
|
|
457
|
+
* }
|
|
458
|
+
* ```
|
|
459
|
+
*/
|
|
460
|
+
cachePolicy?: ICachePolicy;
|
|
446
461
|
};
|
|
447
462
|
}
|
|
448
463
|
type ServiceNormalizedProps = ServiceProps & {
|
package/constructs/Service.js
CHANGED
|
@@ -510,17 +510,18 @@ export class Service extends Construct {
|
|
|
510
510
|
// Do not create distribution if disabled or if ALB was not created (ie. disabled)
|
|
511
511
|
if (!alb || cdk?.cloudfrontDistribution === false)
|
|
512
512
|
return;
|
|
513
|
-
const cachePolicy =
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
513
|
+
const cachePolicy = cdk?.cachePolicy ??
|
|
514
|
+
new CachePolicy(this, "CachePolicy", {
|
|
515
|
+
queryStringBehavior: CacheQueryStringBehavior.all(),
|
|
516
|
+
headerBehavior: CacheHeaderBehavior.none(),
|
|
517
|
+
cookieBehavior: CacheCookieBehavior.none(),
|
|
518
|
+
defaultTtl: CdkDuration.days(0),
|
|
519
|
+
maxTtl: CdkDuration.days(365),
|
|
520
|
+
minTtl: CdkDuration.days(0),
|
|
521
|
+
enableAcceptEncodingBrotli: true,
|
|
522
|
+
enableAcceptEncodingGzip: true,
|
|
523
|
+
comment: "SST server response cache policy",
|
|
524
|
+
});
|
|
524
525
|
return new Distribution(this, "CDN", {
|
|
525
526
|
customDomain,
|
|
526
527
|
cdk: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "sst",
|
|
4
|
-
"version": "2.43.
|
|
4
|
+
"version": "2.43.4",
|
|
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.43.
|
|
121
|
+
"astro-sst": "2.43.4",
|
|
122
122
|
"async": "^3.2.4",
|
|
123
123
|
"tsx": "^3.12.1",
|
|
124
124
|
"typescript": "^5.2.2",
|