class Aws::Plugins::Route53IdFix::Handler
Public Instance Methods
call(context)
click to toggle source
# File lib/aws-sdk-core/plugins/route_53_id_fix.rb, line 18 def call(context) remove_id_prefixes(context.params) @handler.call(context) end
Private Instance Methods
remove_id_prefixes(params)
click to toggle source
# File lib/aws-sdk-core/plugins/route_53_id_fix.rb, line 25 def remove_id_prefixes(params) # Many operations accept of :id or :hosted_zone_id as a root-level # param, pruning prefixes from those. [:id, :hosted_zone_id, :delegation_set_id].each do |key| params[key] = remove_prefix(params[key]) if params[key] end # The `#change_resource_record_sets operation` has a deeply nested # target with a :hosted_zone_id that needs to be pruned. if params[:change_batch] params[:change_batch][:changes].each do |batch| if target = batch[:resource_record_set][:alias_target] target[:hosted_zone_id] = remove_prefix(target[:hosted_zone_id]) end end end end
remove_prefix(str)
click to toggle source
# File lib/aws-sdk-core/plugins/route_53_id_fix.rb, line 43 def remove_prefix(str) str.sub(/^\/(hostedzone|change|delegationset)\//, '') end