sls-jest
  • Getting Started
  • Core Concepts
  • AWS Credentials
  • Matchers
    • DynamoDB
    • S3
    • AppSync
    • EventBridge
  • Spies
    • Setup
    • EventBridge
  • Utilities
    • DynamoDB
  • Cookbooks
    • Github Actions
    • CDK
Powered by GitBook
On this page
  • Locally on your machine
  • CI/CD

Was this helpful?

Edit on GitHub

AWS Credentials

PreviousCore ConceptsNextDynamoDB

Last updated 2 years ago

Was this helpful?

Under the hood, sls-jest uses the AWS SDK for javascript. Thus, credentials are taken in order of preference as described on .

Locally on your machine

When running jest on your local machine, the simplest way is to use your shared credentials file. By default, the default profile is used. You can use another profile by passing it as the AWS_PROFILE env variable before you invoke jest.

AWS_PROFILE=playground npx jest

You can also use something like to automatically set the right profile for your project.

Side note: We recommend to manage your local credentials.

CI/CD

When running tests in a CI/CD environment, the recommended way is to use OIDC. The assumed role must have sufficient permissions to access all the resources your test suite uses (or )

You should check the documentation of your CI/CD provider. Here are some guides for popular ones:

  • (also see )

this page
direnv
leapp
creates
Github Actions
this article
GitLab
Bitbucket
CircleCi