Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime for Template Resource undefined or unspecified for dotnet8 function #4628

Open
boyersnet opened this issue Apr 3, 2024 · 0 comments
Labels
bug We can reproduce the issue and confirmed it is a bug. sam service:lambda

Comments

@boyersnet
Copy link

Problem

Unable to launch vscode debugging configuration with dotnet8 lambda function. Function uses Lambda Annotations. Function executes properly when using sam local invoke.

Steps to reproduce the issue

Migrating from existing dotnet6 launch configuration with target: template immediately get the following error:

[ERROR]: SamLaunchRequestError: Invalid launch configuration: Runtime for Template Resource [ResourceId] in Template file [Template Path] is either undefined or unsupported. [BadLaunchConfig]

Launch Config:

{
      "type": "aws-sam",
      "request": "direct-invoke",
      "name": "[DebugProfileName]",
      "aws": {
        "region": "us-east-1",
        "credentials": "profile:[SSO Profile]"
      },
      "invokeTarget": {
        "target": "template",
        "templatePath": "${workspaceFolder}/[path]/template.yaml",
        "logicalId": "[ResourceId]"
      },
      "sam": {
        "skipNewImageCheck": false,
        "localArguments": [
          "--invoke-image",
          "[dotnet8 docker image path to internal repository]"
        ]
      },
      "lambda": {
        "runtime": "dotnet8",
        "pathMappings": [
          {
            "localRoot": "${workspaceFolder}[path]",
            "remoteRoot": "/var/task"
          }
        ],
        "payload": {
          "path": "[path]/events/event.json"
        },
        "environmentVariables": {
          [Various Environment Variables]
        }
      }
    }

Lambda Function

  ResourceId:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: ./src/[FunctionName]/
      Handler: [FunctionName]::[FunctionName].Function_FunctionHandler_Generated::FunctionHandler
      Runtime: dotnet8
      Architectures:
        - x86_64

Expected behavior

Lambda function initializes and the function begins execution, stops at selected breakpoint.

System details (run the AWS: About Toolkit command)

  • OS: Windows_NT x64 10.0.19044
  • Visual Studio Code extension host: 1.87.2
  • AWS Toolkit: 2.17.0
  • node: 18.17.1
  • electron: 27.3.2
@boyersnet boyersnet added the bug We can reproduce the issue and confirmed it is a bug. label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We can reproduce the issue and confirmed it is a bug. sam service:lambda
Projects
None yet
Development

No branches or pull requests

2 participants