1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

ROUTE53: Allow R53_ALIAS records to enable target health evaluation (#2649)

This commit is contained in:
Jonathan Bouvier
2023-11-27 17:50:21 -05:00
committed by GitHub
parent bf9e48d06f
commit e783d7024c
13 changed files with 196 additions and 44 deletions

View File

@ -328,8 +328,14 @@ var R53_ALIAS = recordBuilder('R53_ALIAS', {
record.target = args.target;
if (_.isObject(record.r53_alias)) {
record.r53_alias['type'] = args.type;
if (!_.isString(record.r53_alias['evaluate_target_health'])) {
record.r53_alias['evaluate_target_health'] = 'false';
}
} else {
record.r53_alias = { type: args.type };
record.r53_alias = {
type: args.type,
evaluate_target_health: 'false',
};
}
},
});
@ -347,6 +353,17 @@ function R53_ZONE(zone_id) {
};
}
// R53_EVALUATE_TARGET_HEALTH(enabled)
function R53_EVALUATE_TARGET_HEALTH(enabled) {
return function (r) {
if (_.isObject(r.r53_alias)) {
r.r53_alias['evaluate_target_health'] = enabled.toString();
} else {
r.r53_alias = { evaluate_target_health: enabled.toString() };
}
};
}
function validateR53AliasType(value) {
if (!_.isString(value)) {
return false;