Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def params(action:, domain:, target:, type:)
body = {
change: {
:action => action,
"resource-record-set" => {
:name => domain
}
}
}.tap do |b|
case type
when "CNAME"
b[:change].merge!(
:type => "CNAME",
:ttl => "600",
"resource-records" => [
{
value: target
}
]
)
when "ALIAS"
b[:change].merge!(
:type => "A",
"alias-target" => {
"dns-name" => target,
"evaluate-target-health" => false
}
)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment