0

I currently have a few lambda functions that interact with an application inside Elastic Beanstalk. These functions use environment variables that are specific to Staging env. Since I am now going to start moving some things to production, I wanted to know good and practical ways of handling these functions, that is:

  • Should I copy this function into another function and set different env variables?
  • Is there a way to have different environments in one unique function?
  • Should I use runtime variables?

Thanks in advance,

1 Answer 1

1

Should I copy this function into another function and set different env variables?

Yes, but you should really be doing this via something like CloudFormation or Terraform instead of copying it manually.

Is there a way to have different environments in one unique function?

No

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you! I am using terraform :)
@VitorCarvalho if using Terraform I suggest using workspaces, so you deploy the function once to your dev workspace, and then a second time to your prod workspace, without having to duplicate any code or configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.