Skip to content

Instantly share code, notes, and snippets.

@nascimento
Last active August 29, 2015 14:25
Show Gist options
  • Save nascimento/5a0608a8f69c6eef35e0 to your computer and use it in GitHub Desktop.
Save nascimento/5a0608a8f69c6eef35e0 to your computer and use it in GitHub Desktop.
AWS-SDK Route53 creating entries on hosted_zone_id
require 'aws-sdk'
route53 = Aws::Route53::Client.new(
region: 'sa-east-1',
access_key_id: 'xxxxx',
secret_access_key: 'xxxxx'
)
changes = []
changes << {
:action => 'CREATE',
:resource_record_set => {
:name => host,
:type => "A",
:ttl => 300,
:resource_records => [{:value => ip}]
}}
route53.change_resource_record_sets({
:hosted_zone_id => 'xxxxxxx',
:change_batch => {
:changes => changes
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment