0

I am using SAM to test my Lambda locally.

The Lambda has two spring profiles, one for local testing and one for production.

Currently, my Lambda is unable to pick up the test yml file.

sam-beta-cdk local start-lambda --env-vars env.json  --debug

The env.json file contains:

{
  "UniqueFunctionName": { "SPRING_PROFILES_ACTIVE": "test" }
}

The Spring profile is labelled accordingly: profile-test.yml

Is the --env-vars the correct way to pass in JVM args?

Zoe
  • 27,060
  • 21
  • 118
  • 148
Ben
  • 239
  • 1
  • 11

1 Answers1

1

I believe your yml file should be named as application-test.yml instead of profile-test.yml.

Also, the UniqueFunctionName must be the logical id of your function in your sam template.

ksaraiya
  • 157
  • 2
  • 6