Class: LambdaDeployment::Configuration
- Inherits:
-
Object
- Object
- LambdaDeployment::Configuration
- Defined in:
- lib/lambda_deployment/configuration.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#s3_bucket ⇒ Object
readonly
Returns the value of attribute s3_bucket.
-
#s3_key ⇒ Object
readonly
Returns the value of attribute s3_key.
-
#s3_sse ⇒ Object
readonly
Returns the value of attribute s3_sse.
Instance Method Summary collapse
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
3 4 5 |
# File 'lib/lambda_deployment/configuration.rb', line 3 def file_path @file_path end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
3 4 5 |
# File 'lib/lambda_deployment/configuration.rb', line 3 def project @project end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
3 4 5 |
# File 'lib/lambda_deployment/configuration.rb', line 3 def region @region end |
#s3_bucket ⇒ Object (readonly)
Returns the value of attribute s3_bucket.
3 4 5 |
# File 'lib/lambda_deployment/configuration.rb', line 3 def s3_bucket @s3_bucket end |
#s3_key ⇒ Object (readonly)
Returns the value of attribute s3_key.
3 4 5 |
# File 'lib/lambda_deployment/configuration.rb', line 3 def s3_key @s3_key end |
#s3_sse ⇒ Object (readonly)
Returns the value of attribute s3_sse.
3 4 5 |
# File 'lib/lambda_deployment/configuration.rb', line 3 def s3_sse @s3_sse end |
Instance Method Details
#alias_name ⇒ Object
17 18 19 |
# File 'lib/lambda_deployment/configuration.rb', line 17 def alias_name ENV.fetch('TAG', nil) end |
#load_config(config_file) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/lambda_deployment/configuration.rb', line 5 def load_config(config_file) config = YAML.load_file(config_file) @project = config.fetch('project') @region = config.fetch('region', ENV.fetch('AWS_REGION', nil)) @file_path = File.(config.fetch('file_name'), File.dirname(config_file)) raise "File not found: #{@file_path}" unless File.exist?(@file_path) @s3_bucket = config.fetch('s3_bucket', ENV.fetch('LAMBDA_S3_BUCKET', nil)) @s3_key = s3_key_name(config.fetch('file_name')) @s3_sse = config.fetch('s3_sse', ENV.fetch('LAMBDA_S3_SSE', nil)) end |