DEV Community

Discussion on: Building a serverless contact form with AWS Lambda and AWS SES

Collapse
 
developing_dev profile image
Cris Acosta

Hi Adnan,

Thanks for this guide. Just recently completed my portfolio and I am creating a serverless form through this guide. That said, I am lost as to where specifically should I paste this code?

{
  "NODE_ENV":"dev",
  "EMAIL":"john.doe@mail.com",
  "DOMAIN":"*"
}
Enter fullscreen mode Exit fullscreen mode

Am I suppose to do it this way?


custom:
  secrets: ${file(secrets.json)} <---- delete content and replace this

//result:
custom:
  secrets: ${
  "NODE_ENV":"dev",
  "EMAIL":"john.doe@mail.com",
  "DOMAIN":"*"}
Enter fullscreen mode Exit fullscreen mode

Is this right?
This is my first time doing this. Never had experience with APIs.

Collapse
 
developing_dev profile image
Cris Acosta

sad. never got an answer on this

Collapse
 
jeremyprioux profile image
Jérémy Prioux

actually you have to use ${self:custom.secrets:NODE_ENV} instead of ${self:custom.secrets.NODE_ENV}

(same for EMAIL, DOMAIN)

Collapse
 
varaprasadhvsh profile image
varaprasadhVSH

you dont need to replace anything,just create a file called secrets.json and paste that snippet