Skip to content

Instantly share code, notes, and snippets.

@cjjavellana
Last active December 20, 2015 08:34
Show Gist options
  • Save cjjavellana/5de7c660e9e9681d792c to your computer and use it in GitHub Desktop.
Save cjjavellana/5de7c660e9e9681d792c to your computer and use it in GitHub Desktop.
Create Route 53 Subdomain
def create_r53subdomain
begin
r53client = Aws::Route53::Client.new
resp = r53client.change_resource_record_sets({
hosted_zone_id: "<hosted zone id>",
change_batch: {
comment: "Create subdomain",
changes: [
{
action: "CREATE",
resource_record_set: {
name: "#{subdomain}.cjavellana.me",
type: "CNAME",
ttl: 60,
resource_records: [
{
value: "cjavellana.me."
},
],
}
}
]
}
})
rescue => e
raise e
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment