Class: Kybus::CLI::AWSBotDeployer

Inherits:
BotDeployerBase show all
Defined in:
lib/kybus/cli/bot/deployers/aws_bot_deployer.rb

Overview

rubocop: disable Metrics/ClassLength

Direct Known Subclasses

AWSBotJobRunnerDeployer

Instance Method Summary collapse

Methods inherited from BotDeployerBase

#account_id, #function_name

Constructor Details

#initialize(configs) ⇒ AWSBotDeployer

Returns a new instance of AWSBotDeployer.



6
7
8
9
10
11
12
# File 'lib/kybus/cli/bot/deployers/aws_bot_deployer.rb', line 6

def initialize(configs)
  configs['account_id'] = 
  super
  @region = @config['region'] || 'us-east-1'
  initialize_aws_resources(configs)
  assign_policies_to_role
end

Instance Method Details

#create_or_update!Object



26
27
28
29
30
31
32
33
# File 'lib/kybus/cli/bot/deployers/aws_bot_deployer.rb', line 26

def create_or_update!
  @log_group.create_or_update!
  @dynamo_policy.create_or_update!
  @cloudwatch_policy.create_or_update!
  @queue.create_or_update!
  @role.create_or_update!
  @lambda.create_or_update!
end

#destroy!Object



14
15
16
17
18
19
20
# File 'lib/kybus/cli/bot/deployers/aws_bot_deployer.rb', line 14

def destroy!
  @lambda.destroy!
  @role.destroy!
  @dynamo_policy.destroy!
  @cloudwatch_policy.destroy!
  @log_group.destroy!
end

#urlObject



22
23
24
# File 'lib/kybus/cli/bot/deployers/aws_bot_deployer.rb', line 22

def url
  @lambda.url
end