Skip to content

Commit 41e150b

Browse files
authored
feat(lambda): remote debugging & lambda new runtime support (#8348)
## Problem new lambda runtime release in Nov (python3.14, nodejs24.x, java25) are currently shown as not supported in AppBuilder & remote debugging ## Solution New lambda runtime can be used in AWS Explorer, AppBuilder, and Remote Debugging. --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 3de7d27 commit 41e150b

File tree

23 files changed

+412
-49
lines changed

23 files changed

+412
-49
lines changed

packages/core/src/eventSchemas/models/schemaCodeLangs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export function supportsEventBridgeTemplates(runtime: Runtime): boolean {
6262
'python3.11',
6363
'python3.12',
6464
'python3.13',
65+
'python3.14',
6566
'go1.x',
6667
].includes(runtime)
6768
}

packages/core/src/lambda/models/samLambdaRuntime.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export type RuntimePackageType = 'Image' | 'Zip'
3030
// TODO: Consolidate all of the runtime constructs into a single <Runtime, Set<Runtime>> map
3131
// We should be able to eliminate a fair amount of redundancy with that.
3232
export const nodeJsRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>([
33+
'nodejs24.x' as Runtime,
3334
'nodejs22.x' as Runtime,
3435
'nodejs20.x',
3536
'nodejs18.x',
@@ -51,6 +52,7 @@ export function getNodeMajorVersion(version?: string): number | undefined {
5152
}
5253

5354
export const pythonRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>([
55+
'python3.14' as Runtime,
5456
'python3.13' as Runtime,
5557
'python3.12',
5658
'python3.11',
@@ -66,6 +68,7 @@ export const javaRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>([
6668
'java8',
6769
'java8.al2',
6870
'java21',
71+
'java25' as Runtime,
6972
])
7073
export const dotNetRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>(['dotnet6', 'dotnet8'])
7174
export const rubyRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>(['ruby3.2', 'ruby3.3', 'ruby3.4' as Runtime])
@@ -94,12 +97,12 @@ export const deprecatedRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>([
9497
'ruby2.7',
9598
])
9699
const defaultRuntimes = ImmutableMap<RuntimeFamily, Runtime>([
97-
[RuntimeFamily.NodeJS, 'nodejs22.x' as Runtime],
98-
[RuntimeFamily.Python, 'python3.13' as Runtime],
100+
[RuntimeFamily.NodeJS, 'nodejs24.x' as Runtime],
101+
[RuntimeFamily.Python, 'python3.14' as Runtime],
99102
[RuntimeFamily.DotNet, 'dotnet8'],
100103
[RuntimeFamily.Go, 'go1.x'],
101-
[RuntimeFamily.Java, 'java21'],
102-
[RuntimeFamily.Ruby, 'ruby3.3'],
104+
[RuntimeFamily.Java, 'java25' as Runtime],
105+
[RuntimeFamily.Ruby, 'ruby3.4' as Runtime],
103106
])
104107

105108
export const mapFamilyToDebugType = ImmutableMap<RuntimeFamily, string>([

packages/core/src/lambda/remoteDebugging/ldkLayers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const regionToAccount: RegionAccountMapping = {
3131
}
3232

3333
// Global layer version
34-
const globalLayerVersion = 2
34+
const globalLayerVersion = 3
3535

3636
export function getRemoteDebugLayerForArch(region: string, arch: string): string | undefined {
3737
const account = regionToAccount[region]

packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
:disabled="
5858
!initialData.runtimeSupportsRemoteDebug ||
5959
!initialData.remoteDebugLayer ||
60-
!initialData.LambdaFunctionNode?.configuration.SnapStart
60+
(!initialData.LambdaFunctionNode?.configuration.SnapStart &&
61+
initialData.LambdaFunctionNode?.configuration.State !== 'Active')
6162
"
6263
class="remote-debug-checkbox"
6364
/>
@@ -94,7 +95,10 @@
9495
Region {{ initialData.FunctionRegion }} doesn't support remote debugging yet
9596
</info>
9697
<info
97-
v-else-if="!initialData.LambdaFunctionNode?.configuration.SnapStart"
98+
v-else-if="
99+
!initialData.LambdaFunctionNode?.configuration.SnapStart &&
100+
initialData.LambdaFunctionNode?.configuration.State !== 'Active'
101+
"
98102
style="color: var(--vscode-errorForeground)"
99103
>
100104
Doesn't support remote debugging yet

packages/core/src/shared/sam/debugger/javaSamDebug.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6+
import { Runtime } from '@aws-sdk/client-lambda'
67
import { getCodeRoot, isImageLambdaConfig } from '../../../lambda/local/debugConfiguration'
78
import { RuntimeFamily } from '../../../lambda/models/samLambdaRuntime'
89
import { ExtContext } from '../../extensions'
@@ -55,9 +56,8 @@ function getJavaOptionsEnvVar(config: SamLaunchRequestArgs): string {
5556
// https://github.com/aws/aws-sam-cli/blob/86f88cbd7df365960f7015c5d086b0db7aedd9d5/samcli/local/docker/lambda_debug_settings.py#L53
5657
return `-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=*:${config.debugPort} -XX:MaxHeapSize=2834432k -XX:MaxMetaspaceSize=163840k -XX:ReservedCodeCacheSize=81920k -XX:+UseSerialGC -XX:-TieredCompilation -Djava.net.preferIPv4Stack=true`
5758
case 'java17':
58-
// https://github.com/aws/aws-sam-cli/blob/90aa5cf11e1c5cbfbe66aea2e2de10d478d48231/samcli/local/docker/lambda_debug_settings.py#L86
59-
return `-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=*:${config.debugPort} -XX:MaxHeapSize=2834432k -XX:+UseSerialGC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.net.preferIPv4Stack=true`
6059
case 'java21':
60+
case 'java25' as Runtime:
6161
// https://github.com/aws/aws-sam-cli/blob/90aa5cf11e1c5cbfbe66aea2e2de10d478d48231/samcli/local/docker/lambda_debug_settings.py#L96
6262
return `-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=*:${config.debugPort} -XX:MaxHeapSize=2834432k -XX:+UseSerialGC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.net.preferIPv4Stack=true`
6363
default:

packages/core/src/shared/sam/debugger/pythonSamDebug.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,13 @@ function getPythonExeAndBootstrap(runtime: Runtime) {
154154
// unfortunately new 'Image'-base images did not standardize the paths
155155
// https://github.com/aws/aws-sam-cli/blob/7d5101a8edeb575b6925f9adecf28f47793c403c/samcli/local/docker/lambda_debug_settings.py
156156
switch (runtime) {
157-
case 'python3.7':
158-
return { python: '/var/lang/bin/python3.7', bootstrap: '/var/runtime/bootstrap' }
159-
case 'python3.8':
160-
return { python: '/var/lang/bin/python3.8', bootstrap: '/var/runtime/bootstrap.py' }
161157
case 'python3.9':
162-
return { python: '/var/lang/bin/python3.9', bootstrap: '/var/runtime/bootstrap.py' }
163158
case 'python3.10':
164-
return { python: '/var/lang/bin/python3.10', bootstrap: '/var/runtime/bootstrap.py' }
165159
case 'python3.11':
166-
return { python: '/var/lang/bin/python3.11', bootstrap: '/var/runtime/bootstrap.py' }
167160
case 'python3.12':
168-
return { python: '/var/lang/bin/python3.12', bootstrap: '/var/runtime/bootstrap.py' }
169161
case 'python3.13' as Runtime:
170-
return { python: '/var/lang/bin/python3.13', bootstrap: '/var/runtime/bootstrap.py' }
162+
case 'python3.14' as Runtime:
163+
return { python: `/var/lang/bin/${runtime}`, bootstrap: '/var/runtime/bootstrap.py' }
171164
default:
172165
throw new Error(`Python SAM debug logic ran for invalid Python runtime: ${runtime}`)
173166
}

packages/core/src/test/eventSchemas/model/schemaCodeLangs.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ describe('getApiValueForSchemasDownload', function () {
3434
case 'python3.11':
3535
case 'python3.12':
3636
case 'python3.13' as Runtime:
37+
case 'python3.14' as Runtime:
3738
case 'python3.10': {
3839
const result = getApiValueForSchemasDownload(runtime)
3940
assert.strictEqual(result, 'Python36', 'Api value used by schemas api')

packages/core/src/test/lambda/models/samLambdaRuntime.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ describe('runtimes', function () {
7474
'nodejs18.x',
7575
'nodejs20.x',
7676
'nodejs22.x',
77+
'nodejs24.x',
7778
'python3.10',
7879
'python3.11',
7980
'python3.12',
8081
'python3.13',
82+
'python3.14',
8183
'python3.7',
8284
'python3.8',
8385
'python3.9',
@@ -88,10 +90,12 @@ describe('runtimes', function () {
8890
'nodejs18.x',
8991
'nodejs20.x',
9092
'nodejs22.x',
93+
'nodejs24.x',
9194
'python3.10',
9295
'python3.11',
9396
'python3.12',
9497
'python3.13',
98+
'python3.14',
9599
'python3.7',
96100
'python3.8',
97101
'python3.9',
@@ -105,17 +109,20 @@ describe('runtimes', function () {
105109
'java11',
106110
'java17',
107111
'java21',
112+
'java25',
108113
'java8',
109114
'java8.al2',
110115
'nodejs14.x',
111116
'nodejs16.x',
112117
'nodejs18.x',
113118
'nodejs20.x',
114119
'nodejs22.x',
120+
'nodejs24.x',
115121
'python3.10',
116122
'python3.11',
117123
'python3.12',
118124
'python3.13',
125+
'python3.14',
119126
'python3.7',
120127
'python3.8',
121128
'python3.9',
@@ -128,17 +135,20 @@ describe('runtimes', function () {
128135
'java11',
129136
'java17',
130137
'java21',
138+
'java25',
131139
'java8',
132140
'java8.al2',
133141
'nodejs14.x',
134142
'nodejs16.x',
135143
'nodejs18.x',
136144
'nodejs20.x',
137145
'nodejs22.x',
146+
'nodejs24.x',
138147
'python3.10',
139148
'python3.11',
140149
'python3.12',
141150
'python3.13',
151+
'python3.14',
142152
'python3.7',
143153
'python3.8',
144154
'python3.9',

packages/core/src/test/lambda/models/samTemplates.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ describe('getSamTemplateWizardOption', function () {
6868
case 'python3.11':
6969
case 'python3.12':
7070
case 'python3.13' as Runtime:
71+
case 'python3.14' as Runtime:
7172
assert.deepStrictEqual(
7273
result,
7374
validPythonTemplateOptions,

0 commit comments

Comments
 (0)