Module: PuppetX::IntechWIFI::RDS

Defined in:
lib/puppet_x/intechwifi/rds.rb

Class Method Summary collapse

Class Method Details

.find_endpoint(region, name, &aws_command) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/puppet_x/intechwifi/rds.rb', line 21

def RDS.find_endpoint(region, name, &aws_command)
  result = JSON.parse(aws_command.call('rds', 'describe-db-instances', '--region', region, '--db-instance-identifier', name))

  {
      :address => result["DBInstances"][0]["Endpoint"]["Address"],
      :port    => result["DBInstances"][0]["Endpoint"]["Port"]
  }
end