Class: Qurd::Action::Route53

Inherits:
Qurd::Action show all
Defined in:
lib/qurd/action/route53.rb

Overview

Clean up route53 records

Examples:

Route53 configuration

auto_scaling_queues:
  staging:
    credentials: foo
    region: us-east-1
    queues:
      - "/QueueName/i"
route53:
  staging:
    hosted_zone: "staging.example.com."

Defined Under Namespace

Classes: Errors

Instance Attribute Summary

Attributes inherited from Qurd::Action

#context, #message

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Qurd::Action

#aws_credentials, #initialize, #inspect, #launch, #region, #run_after, #run_before

Methods included from Mixins::Configuration

#qurd_config, #qurd_configuration, #qurd_logger, #qurd_logger!

Methods included from Mixins::AwsClients

#aws_client, #aws_retryable

Constructor Details

This class inherits a constructor from Qurd::Action

Class Method Details

.configure(_action) ⇒ Object

Verify each auto_scaling_queue has a corresponding route53 key and that each of those keys defines a hosted_zone

Parameters:

  • _action (String)

    the action being configured

Raises:

  • (RuntimeError)

    if any auto_scaling_queues do not have correctly configured route53 keys



32
33
34
35
36
# File 'lib/qurd/action/route53.rb', line 32

def self.configure(_action)
  return if @configure_done
  check_configuration
  @configure_done = true
end

Instance Method Details

#terminateObject

Delete the record, if the message did not fail other processing steps and dry_run is not true

See Also:

  • Qurd::Action::Route53.{{#Qurd{#Qurd::Message}


41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/qurd/action/route53.rb', line 41

def terminate
  if message.failed?
    qurd_logger.warn('Not deleting, message failed to process')
  elsif qurd_configuration.dry_run
    if !hosted_zone
      qurd_logger.debug('Dry run; missing hosted_zone')
    elsif !hostname
      qurd_logger.debug('Dry run; missing hostname')
    elsif !resource_record
      qurd_logger.debug('Dry run; missing resource_record')
    else
      qurd_logger.debug('Dry run; would delete')
    end
  else
    route53_delete
  end
end

#testObject

Respond to test actions



60
61
62
# File 'lib/qurd/action/route53.rb', line 60

def test
  qurd_logger.info('Test')
end