Last active
August 29, 2015 14:25
-
-
Save nascimento/5a0608a8f69c6eef35e0 to your computer and use it in GitHub Desktop.
AWS-SDK Route53 creating entries on hosted_zone_id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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