Class: InstanceAgent::CodeDeployPlugin::CodeDeployControl

Inherits:
Object
  • Object
show all
Defined in:
lib/instance_agent/codedeploy_plugin/codedeploy_control.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ CodeDeployControl

Returns a new instance of CodeDeployControl.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/instance_agent/codedeploy_plugin/codedeploy_control.rb', line 9

def initialize(options = {})
  @options = options.update({
    :http_read_timeout => InstanceAgent::Config.config[:http_read_timeout]
  })

  if InstanceAgent::Config.config[:log_aws_wire]
    @options = options.update({
      # wire logs might be huge; customers should be careful about turning them on
      # allow 1GB of old wire logs in 64MB chunks
      :logger => Logger.new(
        File.join(InstanceAgent::Config.config[:log_dir], "#{InstanceAgent::Config.config[:program_name]}.aws_wire.log"),
        16,
        64 * 1024 * 1024),
      :http_wire_trace => true})
  end
end

Instance Method Details

#get_clientObject



26
27
28
# File 'lib/instance_agent/codedeploy_plugin/codedeploy_control.rb', line 26

def get_client
  Aws::CodeDeployCommand::Client.new(@options)
end

#ssl_verify_peerObject



30
31
32
# File 'lib/instance_agent/codedeploy_plugin/codedeploy_control.rb', line 30

def ssl_verify_peer
  get_client.config.ssl_verify_peer
end

#verify_cert_fieldsObject



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/instance_agent/codedeploy_plugin/codedeploy_control.rb', line 34

def verify_cert_fields
    deploy_control_endpoint = get_client.config.endpoint
  begin
    cert_verifier = InstanceAgent::CodeDeployPlugin::CodeDeployControlCertVerifier.new(deploy_control_endpoint)
    cert_verifier.verify_subject
  rescue e
    InstanceAgent::Log.error("#{self.class.to_s}: Error during certificate verification on codedeploy endpoint #{deploy_control_endpoint}")
    InstanceAgent::Log.debug("#{self.class.to_s}: #{e.inspect}")
    false
  end
end