Module: Jets::Resource::Lambda::Function::Environment
- Defined in:
- lib/jets/resource/lambda/function/environment.rb
Instance Method Summary collapse
- #env_properties ⇒ Object
- #environment ⇒ Object
-
#jets_env ⇒ Object
These jets env variables are special variables that get included to keeps some state.
Instance Method Details
#env_properties ⇒ Object
3 4 5 6 7 8 |
# File 'lib/jets/resource/lambda/function/environment.rb', line 3 def env_properties env_vars = Jets::Dotenv.load!(true) variables = environment.merge(env_vars) check_reserved_variables!(variables) {environment: { variables: variables }} end |
#environment ⇒ Object
10 11 12 13 |
# File 'lib/jets/resource/lambda/function/environment.rb', line 10 def environment env = Jets.config.environment ? Jets.config.environment.to_h : {} env.deep_merge(jets_env) end |
#jets_env ⇒ Object
These jets env variables are special variables that get included to keeps some state
16 17 18 19 20 21 22 23 24 |
# File 'lib/jets/resource/lambda/function/environment.rb', line 16 def jets_env env = {} env[:JETS_ENV] = Jets.env.to_s env[:JETS_ENV_EXTRA] = Jets.config.env_extra if Jets.config.env_extra env[:JETS_PROJECT_NAME] = ENV['JETS_PROJECT_NAME'] if ENV['JETS_PROJECT_NAME'] env[:JETS_STAGE] = Jets::Resource::ApiGateway::Deployment.stage_name env[:JETS_AWS_ACCOUNT] = Jets.aws.account env end |