sst 2.41.5 → 2.42.0
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/cdk/deployments.d.ts +3 -1
- package/cdk/deployments.js +22 -19
- package/constructs/Function.js +2 -2
- package/constructs/RDS.d.ts +2 -2
- package/constructs/RDS.js +6 -1
- package/constructs/Service.js +3 -2
- package/node/future/auth/adapter/apple.d.ts +2 -1
- package/node/future/auth/adapter/apple.js +9 -1
- package/node/future/auth/adapter/google.d.ts +3 -2
- package/node/future/auth/adapter/google.js +11 -3
- package/package.json +9 -9
- package/runtime/handlers/container.js +6 -4
package/cdk/deployments.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { ISDK } from "sst-aws-cdk/lib/api/aws-auth/sdk.js";
|
|
|
7
7
|
import { SdkProvider } from "sst-aws-cdk/lib/api/aws-auth/sdk-provider.js";
|
|
8
8
|
import { DeployStackResult, DeploymentMethod } from "./deploy-stack.js";
|
|
9
9
|
import { EnvironmentResources } from "sst-aws-cdk/lib/api/environment-resources.js";
|
|
10
|
+
import { RootTemplateWithNestedStacks } from "sst-aws-cdk/lib/api/nested-stack-helpers.js";
|
|
10
11
|
import { Template, ResourcesToImport, ResourceIdentifierSummaries } from "sst-aws-cdk/lib/api/util/cloudformation.js";
|
|
11
12
|
import { StackActivityProgress } from "sst-aws-cdk/lib/api/util/cloudformation/stack-activity-monitor.js";
|
|
12
13
|
import { HotswapMode } from "sst-aws-cdk/lib/api/hotswap/common.js";
|
|
@@ -219,6 +220,7 @@ export interface DestroyStackOptions {
|
|
|
219
220
|
export interface StackExistsOptions {
|
|
220
221
|
stack: cxapi.CloudFormationStackArtifact;
|
|
221
222
|
deployName?: string;
|
|
223
|
+
tryLookupRole?: boolean;
|
|
222
224
|
}
|
|
223
225
|
export interface DeploymentsProps {
|
|
224
226
|
sdkProvider: SdkProvider;
|
|
@@ -266,7 +268,7 @@ export declare class Deployments {
|
|
|
266
268
|
* Resolves the environment for a stack.
|
|
267
269
|
*/
|
|
268
270
|
resolveEnvironment(stack: cxapi.CloudFormationStackArtifact): Promise<cxapi.Environment>;
|
|
269
|
-
readCurrentTemplateWithNestedStacks(rootStackArtifact: cxapi.CloudFormationStackArtifact, retrieveProcessedTemplate?: boolean): Promise<
|
|
271
|
+
readCurrentTemplateWithNestedStacks(rootStackArtifact: cxapi.CloudFormationStackArtifact, retrieveProcessedTemplate?: boolean): Promise<RootTemplateWithNestedStacks>;
|
|
270
272
|
readCurrentTemplate(stackArtifact: cxapi.CloudFormationStackArtifact): Promise<Template>;
|
|
271
273
|
resourceIdentifierSummaries(stackArtifact: cxapi.CloudFormationStackArtifact): Promise<ResourceIdentifierSummaries>;
|
|
272
274
|
deployStack(options: DeployStackOptions): Promise<DeployStackResult | undefined>;
|
package/cdk/deployments.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import * as cxapi from "@aws-cdk/cx-api";
|
|
3
3
|
import * as cdk_assets from "cdk-assets";
|
|
4
4
|
import { AssetManifest } from "cdk-assets";
|
|
5
|
-
import { debug, warning } from "sst-aws-cdk/lib/logging.js";
|
|
5
|
+
import { debug, warning, error } from "sst-aws-cdk/lib/logging.js";
|
|
6
6
|
import { buildAssets, publishAssets, PublishingAws, EVENT_TO_LOGGER, } from "sst-aws-cdk/lib/util/asset-publishing.js";
|
|
7
7
|
import { Mode } from "sst-aws-cdk/lib/api/aws-auth/credentials.js";
|
|
8
8
|
import { deployStack, destroyStack, } from "./deploy-stack.js";
|
|
9
9
|
import { EnvironmentResourcesRegistry, } from "sst-aws-cdk/lib/api/environment-resources.js";
|
|
10
|
-
import { loadCurrentTemplateWithNestedStacks, loadCurrentTemplate,
|
|
10
|
+
import { loadCurrentTemplateWithNestedStacks, loadCurrentTemplate, } from "sst-aws-cdk/lib/api/nested-stack-helpers.js";
|
|
11
11
|
import { CloudFormationStack, } from "sst-aws-cdk/lib/api/util/cloudformation.js";
|
|
12
12
|
import { replaceEnvPlaceholders } from "sst-aws-cdk/lib/api/util/placeholders.js";
|
|
13
13
|
import { makeBodyParameterAndUpload } from "sst-aws-cdk/lib/api/util/template-body-parameter.js";
|
|
@@ -36,11 +36,7 @@ export class Deployments {
|
|
|
36
36
|
async readCurrentTemplateWithNestedStacks(rootStackArtifact, retrieveProcessedTemplate = false) {
|
|
37
37
|
const sdk = (await this.prepareSdkWithLookupOrDeployRole(rootStackArtifact))
|
|
38
38
|
.stackSdk;
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
deployedTemplate: templateWithNestedStacks.deployedTemplate,
|
|
42
|
-
nestedStackCount: flattenNestedStackNames(templateWithNestedStacks.nestedStackNames).length,
|
|
43
|
-
};
|
|
39
|
+
return loadCurrentTemplateWithNestedStacks(rootStackArtifact, sdk, retrieveProcessedTemplate);
|
|
44
40
|
}
|
|
45
41
|
async readCurrentTemplate(stackArtifact) {
|
|
46
42
|
debug(`Reading existing template for stack ${stackArtifact.displayName}.`);
|
|
@@ -126,7 +122,14 @@ export class Deployments {
|
|
|
126
122
|
});
|
|
127
123
|
}
|
|
128
124
|
async stackExists(options) {
|
|
129
|
-
|
|
125
|
+
let stackSdk;
|
|
126
|
+
if (options.tryLookupRole) {
|
|
127
|
+
stackSdk = (await this.prepareSdkWithLookupOrDeployRole(options.stack))
|
|
128
|
+
.stackSdk;
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
stackSdk = (await this.prepareSdkFor(options.stack, undefined, Mode.ForReading)).stackSdk;
|
|
132
|
+
}
|
|
130
133
|
const stack = await CloudFormationStack.lookup(stackSdk.cloudFormation(), options.deployName ?? options.stack.stackName);
|
|
131
134
|
return stack.exists;
|
|
132
135
|
}
|
|
@@ -206,8 +209,8 @@ export class Deployments {
|
|
|
206
209
|
}, resolvedEnvironment, this.sdkProvider);
|
|
207
210
|
// try to assume the lookup role
|
|
208
211
|
const warningMessage = `Could not assume ${arns.lookupRoleArn}, proceeding anyway.`;
|
|
209
|
-
const upgradeMessage = `(To get rid of this warning, please upgrade to bootstrap version >= ${stack.lookupRole?.requiresBootstrapStackVersion})`;
|
|
210
212
|
try {
|
|
213
|
+
// Trying to assume lookup role and cache the sdk for the environment
|
|
211
214
|
const stackSdk = await this.cachedSdkForEnvironment(resolvedEnvironment, Mode.ForReading, {
|
|
212
215
|
assumeRoleArn: arns.lookupRoleArn,
|
|
213
216
|
assumeRoleExternalId: stack.lookupRole?.assumeRoleExternalId,
|
|
@@ -219,24 +222,24 @@ export class Deployments {
|
|
|
219
222
|
stack.lookupRole.requiresBootstrapStackVersion) {
|
|
220
223
|
const version = await envResources.versionFromSsmParameter(stack.lookupRole.bootstrapStackVersionSsmParameter);
|
|
221
224
|
if (version < stack.lookupRole.requiresBootstrapStackVersion) {
|
|
222
|
-
throw new Error(`Bootstrap stack version '${stack.lookupRole.requiresBootstrapStackVersion}' is required, found version '${version}'
|
|
225
|
+
throw new Error(`Bootstrap stack version '${stack.lookupRole.requiresBootstrapStackVersion}' is required, found version '${version}'. To get rid of this error, please upgrade to bootstrap version >= ${stack.lookupRole.requiresBootstrapStackVersion}`);
|
|
223
226
|
}
|
|
224
|
-
// we may not have assumed the lookup role because one was not provided
|
|
225
|
-
// if that is the case then don't print the upgrade warning
|
|
226
227
|
}
|
|
227
|
-
else if (!stackSdk.didAssumeRole
|
|
228
|
-
stack.lookupRole
|
|
229
|
-
warning(
|
|
228
|
+
else if (!stackSdk.didAssumeRole) {
|
|
229
|
+
const lookUpRoleExists = stack.lookupRole ? true : false;
|
|
230
|
+
warning(`Lookup role ${lookUpRoleExists ? "exists but" : "does not exist, hence"} was not assumed. Proceeding with default credentials.`);
|
|
230
231
|
}
|
|
231
232
|
return { ...stackSdk, resolvedEnvironment, envResources };
|
|
232
233
|
}
|
|
233
234
|
catch (e) {
|
|
234
235
|
debug(e);
|
|
235
|
-
// only print out the warnings if the lookupRole exists
|
|
236
|
-
|
|
237
|
-
if (stack.lookupRole && stack.lookupRole.requiresBootstrapStackVersion) {
|
|
236
|
+
// only print out the warnings if the lookupRole exists
|
|
237
|
+
if (stack.lookupRole) {
|
|
238
238
|
warning(warningMessage);
|
|
239
|
-
|
|
239
|
+
}
|
|
240
|
+
// This error should be shown even if debug mode is off
|
|
241
|
+
if (e instanceof Error && e.message.includes("Bootstrap stack version")) {
|
|
242
|
+
error(e.message);
|
|
240
243
|
}
|
|
241
244
|
throw e;
|
|
242
245
|
}
|
package/constructs/Function.js
CHANGED
|
@@ -49,8 +49,8 @@ const supportedRuntimes = {
|
|
|
49
49
|
java11: CDKRuntime.JAVA_11,
|
|
50
50
|
java17: CDKRuntime.JAVA_17,
|
|
51
51
|
java21: CDKRuntime.JAVA_21,
|
|
52
|
-
"go1.x": CDKRuntime.
|
|
53
|
-
go: CDKRuntime.
|
|
52
|
+
"go1.x": CDKRuntime.PROVIDED_AL2023,
|
|
53
|
+
go: CDKRuntime.PROVIDED_AL2023,
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
56
|
* The `Function` construct is a higher level CDK construct that makes it easy to create a Lambda Function with support for Live Lambda Development.
|
package/constructs/RDS.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface RDSProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* Database engine of the cluster. Cannot be changed once set.
|
|
15
15
|
*/
|
|
16
|
-
engine: "mysql5.6" | "mysql5.7" | "mysql8.0" | "postgresql11.13" | "postgresql11.16" | "postgresql13.9" | "postgresql14.10" | "postgresql15.5" | "postgresql16.1";
|
|
16
|
+
engine: "mysql5.6" | "mysql5.7" | "mysql8.0" | "postgresql11.13" | "postgresql11.16" | "postgresql13.12" | "postgresql13.9" | "postgresql14.10" | "postgresql15.5" | "postgresql16.1";
|
|
17
17
|
/**
|
|
18
18
|
* Name of a database which is automatically created inside the cluster.
|
|
19
19
|
*/
|
|
@@ -191,7 +191,7 @@ export declare class RDS extends Construct implements SSTConstruct {
|
|
|
191
191
|
getConstructMetadata(): {
|
|
192
192
|
type: "RDS";
|
|
193
193
|
data: {
|
|
194
|
-
engine: "mysql5.6" | "mysql5.7" | "mysql8.0" | "postgresql11.13" | "postgresql11.16" | "postgresql13.9" | "postgresql14.10" | "postgresql15.5" | "postgresql16.1";
|
|
194
|
+
engine: "mysql5.6" | "mysql5.7" | "mysql8.0" | "postgresql11.13" | "postgresql11.16" | "postgresql13.12" | "postgresql13.9" | "postgresql14.10" | "postgresql15.5" | "postgresql16.1";
|
|
195
195
|
secretArn: string;
|
|
196
196
|
types: RDSTypes | undefined;
|
|
197
197
|
clusterArn: string;
|
package/constructs/RDS.js
CHANGED
|
@@ -219,6 +219,11 @@ export class RDS extends Construct {
|
|
|
219
219
|
version: AuroraPostgresEngineVersion.VER_11_16,
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
|
+
else if (engine === "postgresql13.12") {
|
|
223
|
+
return DatabaseClusterEngine.auroraPostgres({
|
|
224
|
+
version: AuroraPostgresEngineVersion.VER_13_12,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
222
227
|
else if (engine === "postgresql13.9") {
|
|
223
228
|
return DatabaseClusterEngine.auroraPostgres({
|
|
224
229
|
version: AuroraPostgresEngineVersion.VER_13_9,
|
|
@@ -239,7 +244,7 @@ export class RDS extends Construct {
|
|
|
239
244
|
version: AuroraPostgresEngineVersion.VER_16_1,
|
|
240
245
|
});
|
|
241
246
|
}
|
|
242
|
-
throw new Error(`The specified "engine" is not supported for sst.RDS. Only mysql5.6, mysql5.7, postgresql11.13, postgresql11.16, and
|
|
247
|
+
throw new Error(`The specified "engine" is not supported for sst.RDS. Only mysql5.6, mysql5.7, postgresql11.13, postgresql11.16, postgresql13.12, and postgresql13.9 engines are currently supported.`);
|
|
243
248
|
}
|
|
244
249
|
getScaling(scaling) {
|
|
245
250
|
return {
|
package/constructs/Service.js
CHANGED
|
@@ -659,8 +659,9 @@ export class Service extends Construct {
|
|
|
659
659
|
`type=${build?.cacheTo.type}`,
|
|
660
660
|
...(build?.cacheTo?.params
|
|
661
661
|
? Object.entries(build?.cacheTo?.params).map(([pk, pv]) => `${pk}=${pv}`)
|
|
662
|
-
: [])
|
|
663
|
-
],
|
|
662
|
+
: []),
|
|
663
|
+
].join(","),
|
|
664
|
+
,
|
|
664
665
|
]
|
|
665
666
|
: []),
|
|
666
667
|
this.props.path,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { BaseClient } from "openid-client";
|
|
1
2
|
import { OauthConfig } from "./oauth.js";
|
|
2
3
|
export declare const AppleAdapter: (config: OauthConfig) => () => Promise<{
|
|
3
4
|
type: "success";
|
|
4
5
|
properties: {
|
|
5
6
|
tokenset: import("openid-client").TokenSet;
|
|
6
|
-
client:
|
|
7
|
+
client: BaseClient;
|
|
7
8
|
};
|
|
8
9
|
} | {
|
|
9
10
|
type: "step";
|
|
@@ -8,7 +8,15 @@ import { useBody, useCookie, useDomainName, usePathParam, useResponse, } from ".
|
|
|
8
8
|
// Also note that Apple's discover uri does not work for the OAuth flow, as the
|
|
9
9
|
// userinfo_endpoint are not included in the response.
|
|
10
10
|
// await Issuer.discover("https://appleid.apple.com/.well-known/openid-configuration/");
|
|
11
|
-
|
|
11
|
+
let realIssuer;
|
|
12
|
+
const issuer = new Proxy({}, {
|
|
13
|
+
get: async function (target, prop) {
|
|
14
|
+
if (!realIssuer) {
|
|
15
|
+
realIssuer = await Issuer.discover("https://appleid.apple.com/.well-known/openid-configuration");
|
|
16
|
+
}
|
|
17
|
+
return realIssuer[prop];
|
|
18
|
+
},
|
|
19
|
+
});
|
|
12
20
|
export const AppleAdapter =
|
|
13
21
|
/* @__PURE__ */
|
|
14
22
|
(config) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BaseClient } from "openid-client";
|
|
1
2
|
import { OidcBasicConfig } from "./oidc.js";
|
|
2
3
|
import { OauthBasicConfig } from "./oauth.js";
|
|
3
4
|
type GooglePrompt = "none" | "consent" | "select_account";
|
|
@@ -14,7 +15,7 @@ export declare function GoogleAdapter(config: GoogleConfig): (() => Promise<{
|
|
|
14
15
|
type: "success";
|
|
15
16
|
properties: {
|
|
16
17
|
tokenset: import("openid-client").TokenSet;
|
|
17
|
-
client:
|
|
18
|
+
client: BaseClient;
|
|
18
19
|
};
|
|
19
20
|
} | {
|
|
20
21
|
type: "step";
|
|
@@ -28,7 +29,7 @@ export declare function GoogleAdapter(config: GoogleConfig): (() => Promise<{
|
|
|
28
29
|
type: "success";
|
|
29
30
|
properties: {
|
|
30
31
|
tokenset: import("openid-client").TokenSet;
|
|
31
|
-
client:
|
|
32
|
+
client: BaseClient;
|
|
32
33
|
};
|
|
33
34
|
} | {
|
|
34
35
|
type: "step";
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { Issuer } from "openid-client";
|
|
2
2
|
import { OidcAdapter } from "./oidc.js";
|
|
3
3
|
import { OauthAdapter } from "./oauth.js";
|
|
4
|
-
|
|
4
|
+
let realIssuer;
|
|
5
|
+
const issuer = new Proxy({}, {
|
|
6
|
+
get: async function (target, prop) {
|
|
7
|
+
if (!realIssuer) {
|
|
8
|
+
realIssuer = await Issuer.discover("https://accounts.google.com");
|
|
9
|
+
}
|
|
10
|
+
return realIssuer[prop];
|
|
11
|
+
},
|
|
12
|
+
});
|
|
5
13
|
export function GoogleAdapter(config) {
|
|
6
14
|
/* @__PURE__ */
|
|
7
15
|
if (config.mode === "oauth") {
|
|
8
16
|
return OauthAdapter({
|
|
9
|
-
issuer,
|
|
17
|
+
issuer: issuer,
|
|
10
18
|
...config,
|
|
11
19
|
params: {
|
|
12
20
|
...(config.accessType && { access_type: config.accessType }),
|
|
@@ -15,7 +23,7 @@ export function GoogleAdapter(config) {
|
|
|
15
23
|
});
|
|
16
24
|
}
|
|
17
25
|
return OidcAdapter({
|
|
18
|
-
issuer,
|
|
26
|
+
issuer: issuer,
|
|
19
27
|
scope: "openid email profile",
|
|
20
28
|
...config,
|
|
21
29
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "sst",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.42.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sst": "cli/sst.js"
|
|
7
7
|
},
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://sst.dev",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aws-cdk/aws-lambda-python-alpha": "2.
|
|
29
|
-
"@aws-cdk/cloud-assembly-schema": "2.
|
|
30
|
-
"@aws-cdk/cloudformation-diff": "2.
|
|
31
|
-
"@aws-cdk/cx-api": "2.
|
|
28
|
+
"@aws-cdk/aws-lambda-python-alpha": "2.142.1-alpha.0",
|
|
29
|
+
"@aws-cdk/cloud-assembly-schema": "2.142.1",
|
|
30
|
+
"@aws-cdk/cloudformation-diff": "2.142.1",
|
|
31
|
+
"@aws-cdk/cx-api": "2.142.1",
|
|
32
32
|
"@aws-crypto/sha256-js": "^5.2.0",
|
|
33
33
|
"@aws-sdk/client-cloudformation": "^3.454.0",
|
|
34
34
|
"@aws-sdk/client-ecs": "^3.454.0",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"@smithy/signature-v4": "^2.0.16",
|
|
54
54
|
"@trpc/server": "9.16.0",
|
|
55
55
|
"adm-zip": "^0.5.10",
|
|
56
|
-
"aws-cdk-lib": "2.
|
|
56
|
+
"aws-cdk-lib": "2.142.1",
|
|
57
57
|
"aws-iot-device-sdk": "^2.2.13",
|
|
58
58
|
"aws-sdk": "^2.1501.0",
|
|
59
59
|
"builtin-modules": "3.2.0",
|
|
60
|
-
"cdk-assets": "2.
|
|
60
|
+
"cdk-assets": "2.142.1",
|
|
61
61
|
"chalk": "^5.2.0",
|
|
62
62
|
"chokidar": "^3.5.3",
|
|
63
63
|
"ci-info": "^3.7.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"ora": "^6.1.2",
|
|
86
86
|
"react": "^18.0.0",
|
|
87
87
|
"remeda": "^1.3.0",
|
|
88
|
-
"sst-aws-cdk": "2.
|
|
88
|
+
"sst-aws-cdk": "2.142.1",
|
|
89
89
|
"tree-kill": "^1.2.2",
|
|
90
90
|
"undici": "^5.12.0",
|
|
91
91
|
"uuid": "^9.0.0",
|
|
@@ -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.
|
|
121
|
+
"astro-sst": "2.42.0",
|
|
122
122
|
"async": "^3.2.4",
|
|
123
123
|
"tsx": "^3.12.1",
|
|
124
124
|
"typescript": "^5.2.2",
|
|
@@ -231,8 +231,9 @@ export const useContainerHandler = () => {
|
|
|
231
231
|
`type=${input.props.container?.cacheTo.type}`,
|
|
232
232
|
...(input.props.container?.cacheTo?.params
|
|
233
233
|
? Object.entries(input.props.container?.cacheTo?.params).map(([pk, pv]) => `${pk}=${pv}`)
|
|
234
|
-
: [])
|
|
235
|
-
],
|
|
234
|
+
: []),
|
|
235
|
+
].join(","),
|
|
236
|
+
,
|
|
236
237
|
]
|
|
237
238
|
: []),
|
|
238
239
|
`.`,
|
|
@@ -279,8 +280,9 @@ export const useContainerHandler = () => {
|
|
|
279
280
|
`type=${input.props.container?.cacheTo.type}`,
|
|
280
281
|
...(input.props.container?.cacheTo?.params
|
|
281
282
|
? Object.entries(input.props.container?.cacheTo?.params).map(([pk, pv]) => `${pk}=${pv}`)
|
|
282
|
-
: [])
|
|
283
|
-
],
|
|
283
|
+
: []),
|
|
284
|
+
].join(","),
|
|
285
|
+
,
|
|
284
286
|
]
|
|
285
287
|
: []),
|
|
286
288
|
`--platform ${platform}`,
|