@@ -515,29 +515,28 @@ def _construct_api_domain(self, rest_api):
515
515
record_set_group = None
516
516
if self .domain .get ("Route53" ) is not None :
517
517
route53 = self .domain .get ("Route53" )
518
- if isinstance (route53 , dict ):
519
- if route53 .get ("HostedZoneId" ) is None and route53 .get ("HostedZoneName" ) is None :
520
- raise InvalidResourceException (
521
- self .logical_id ,
522
- "HostedZoneId or HostedZoneName is required to enable Route53 support on Custom Domains." ,
523
- )
524
- logical_id = logical_id_generator .LogicalIdGenerator (
525
- "" , route53 .get ("HostedZoneId" ) or route53 .get ("HostedZoneName" )
526
- ).gen ()
527
- record_set_group = Route53RecordSetGroup (
528
- "RecordSetGroup" + logical_id , attributes = self .passthrough_resource_attributes
529
- )
530
- if "HostedZoneId" in route53 :
531
- record_set_group .HostedZoneId = route53 .get ("HostedZoneId" )
532
- if "HostedZoneName" in route53 :
533
- record_set_group .HostedZoneName = route53 .get ("HostedZoneName" )
534
- record_set_group .RecordSets = self ._construct_record_sets_for_domain (self .domain )
535
- else :
518
+ if not isinstance (route53 , dict ):
536
519
raise InvalidResourceException (
537
520
self .logical_id ,
538
521
"Invalid property type '{}' for Route53. "
539
522
"Expected a map defines an Amazon Route 53 configuration'." .format (type (route53 ).__name__ ),
540
523
)
524
+ if route53 .get ("HostedZoneId" ) is None and route53 .get ("HostedZoneName" ) is None :
525
+ raise InvalidResourceException (
526
+ self .logical_id ,
527
+ "HostedZoneId or HostedZoneName is required to enable Route53 support on Custom Domains." ,
528
+ )
529
+ logical_id = logical_id_generator .LogicalIdGenerator (
530
+ "" , route53 .get ("HostedZoneId" ) or route53 .get ("HostedZoneName" )
531
+ ).gen ()
532
+ record_set_group = Route53RecordSetGroup (
533
+ "RecordSetGroup" + logical_id , attributes = self .passthrough_resource_attributes
534
+ )
535
+ if "HostedZoneId" in route53 :
536
+ record_set_group .HostedZoneId = route53 .get ("HostedZoneId" )
537
+ if "HostedZoneName" in route53 :
538
+ record_set_group .HostedZoneName = route53 .get ("HostedZoneName" )
539
+ record_set_group .RecordSets = self ._construct_record_sets_for_domain (self .domain )
541
540
542
541
return domain , basepath_resource_list , record_set_group
543
542
0 commit comments