Skip to content

Update all examples to modern runtime and ESM #20

@DavidWells

Description

@DavidWells

We need to update the serverless.yml files in https://github.com/DavidWells/serverless-workshop/tree/master/_instructor (ignore the other directories they are generated by npm run docs

The services are outdated. All the runtime: nodejs12.x need to be nodejs22x that latest runtime from AWS

Also please replace usage of the AWS v2 SDK for the newer AWS v3 sdk for example in https://github.com/DavidWells/serverless-workshop/blob/master/lessons/events/dynamodb-streams/handler.js & https://github.com/DavidWells/serverless-workshop/blob/master/lessons/events/step-functions/handler.js etc.

Also make all the examples use ESM modules (import, export syntax) instead of the cjs they are currently using

Very Important: DO NOT remove any comments in the js code or in the yaml like these:

/* Step 6. In this_file the `startStateMachine` will handle the creation of the new step function.

    Using the aws-sdk, use the StepFunctions `startExecution` method to start the new task

    See docs for more details http://amzn.to/2zP0OPW
*/
provider:
  name: aws
  runtime: nodejs12.x
  stage: ${self:custom.stage}
  # Step 4. In this_file, reference the Output value of the state machine. ${self:resources.Outputs.MyStateMachine.Value} in the `environment` variables #
  # Step 5. In this_file, Attach the need `iamRoleStatements` to Allow access to step functions `states:*` #

They are needed to generate the final workshop code. Keep all comments. Only update the yaml runtime and the javascript syntax and the aws SDK to v3

thanks @claude

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-generatedAutomatically generated contentclaude-codeItems created or modified by Claude Code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions