Skip to content

migrate AWS SDK v2 → v3#686

Open
zjawol wants to merge 1 commit intosid88in:masterfrom
zjawol:chore/migrate-from-aws-sdk-v2-to-aws-sdk-v3
Open

migrate AWS SDK v2 → v3#686
zjawol wants to merge 1 commit intosid88in:masterfrom
zjawol:chore/migrate-from-aws-sdk-v2-to-aws-sdk-v3

Conversation

@zjawol
Copy link
Copy Markdown

@zjawol zjawol commented May 1, 2026

Proposed changes

Migrates all AWS SDK usage from the legacy aws-sdk v2 package to the modular AWS SDK v3 (@aws-sdk/* packages). This is a prerequisite for dropping the v2 dependency and aligns the plugin with the current AWS SDK standard.

Key changes:

  • AwsClientFactory — new class (src/aws-client-factory.ts) that lazily initializes and caches SDK v3 clients (AppSync, CloudFormation, CloudWatch Logs, Route53, ACM). ACM client is always pinned to us-east-1 as required by CloudFront.
  • src/index.ts — all AWS API calls migrated from v2 SDK classes/types to v3 *Command pattern. AwsClientFactory is instantiated once in the constructor using fromNodeProviderChain() for credentials.
  • src/get-stack-value.ts — removed (dead code, functionality covered elsewhere).
  • sls appsync evaluate — new CLI command that calls the AppSync EvaluateCode and EvaluateMappingTemplate APIs to test JS resolvers and VTL templates against a context without deploying.
  • sls appsync env get/set — new CLI commands to read and update AppSync runtime environment variables on a deployed API without redeploying.
  • Documentation — updated README.md and doc/commands.md with quick-reference tables; added doc/testing-resolvers.md covering the evaluate workflow, fixture structure, pipeline chaining, and Jest integration examples. Node.js minimum requirement updated from v16 to v20.

Issue(s)

Closes #685

Steps to test or reproduce

  1. Configure AWS credentials in your environment.
  2. Deploy an AppSync API using the plugin.
  3. Run the migrated commands and verify they work as before:
    sls appsync validate-schema
    sls appsync get-introspection
    sls appsync flush-cache
    sls appsync logs
  4. Test the new evaluate command against a JS resolver:
    sls appsync evaluate --type Query --field getUser --function request \
    --context '{"arguments":{"id":"abc-123"}}'
  5. Test the new env commands:
    sls appsync env get
    sls appsync env set --key STAGE --value production
  6. get-stack-value.ts removal has no runtime impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate from AWS SDK v2 to AWS SDK v3

1 participant