Class: LambdaWrap::AwsSetup

Inherits:
Object
  • Object
show all
Defined in:
lib/lambda_wrap/aws_setup.rb

Overview

Helper class to ensure valid configuration of AWS. This class is intended for internal use only, but clients can call it before calling any other functionality to ensure early failure.

Instance Method Summary collapse

Instance Method Details

#validateObject

Validates that the setup is correct and that the bundled AWS certificate is used for subsequent calls to the AWS SDK

*Required environment variables*

AWS_ACCESS_KEY_ID

The AWS access key to be used when calling AWS SDK functions

AWS_SECRET_ACCESS_KEY

The AWS secret to be used when calling AWS SDK functions

AWS_REGION

A valid AWS region to use during configuration.



19
20
21
22
23
24
25
26
27
28
# File 'lib/lambda_wrap/aws_setup.rb', line 19

def validate()
    
    # validate settings
    raise 'AWS_ACCESS_KEY_ID not set' if !ENV['AWS_ACCESS_KEY_ID']
    raise 'AWS_SECRET_ACCESS_KEY not set' if !ENV['AWS_SECRET_ACCESS_KEY']
    raise 'AWS_REGION not set' if !ENV['AWS_REGION']

    Aws::use_bundled_cert!
    
end