Class: LambdaDeployment::Lambda::Deploy

Inherits:
Object
  • Object
show all
Defined in:
lib/lambda_deployment/lambda/deploy.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Deploy

Returns a new instance of Deploy.



4
5
6
7
# File 'lib/lambda_deployment/lambda/deploy.rb', line 4

def initialize(config)
  @config = config
  @client = LambdaDeployment::Client.new(config.region)
end

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/lambda_deployment/lambda/deploy.rb', line 9

def run
  upload_to_s3
  update_function_code
  update_environment
  update_concurrency
  return unless @config.alias_name
  version = publish_version
  begin
    create_alias(version)
  rescue Aws::Lambda::Errors::ResourceConflictException
    update_alias(version)
  end
end