@@ -556,6 +556,32 @@ def __init__(self, value_one: object, value_two: object) -> None:
556556 },
557557})
558558
559+ if not args .no_network :
560+ template .add_mapping ("OriginShieldRegionMap" , {
561+ # Regions with origin shield
562+ "us-east-2" : {"Region" : "us-east-2" },
563+ "us-east-1" : {"Region" : "us-east-1" },
564+ "us-west-2" : {"Region" : "us-west-2" },
565+ "ap-south-1" : {"Region" : "ap-south-1" },
566+ "ap-northeast-2" : {"Region" : "ap-northeast-2" },
567+ "ap-southeast-1" : {"Region" : "ap-southeast-1" },
568+ "ap-southeast-2" : {"Region" : "ap-southeast-2" },
569+ "ap-northeast-1" : {"Region" : "ap-northeast-1" },
570+ "eu-central-1" : {"Region" : "eu-central-1" },
571+ "eu-west-1" : {"Region" : "eu-west-1" },
572+ "eu-west-2" : {"Region" : "eu-west-2" },
573+ "sa-east-1" : {"Region" : "sa-east-1" },
574+ # Regions without origin shield
575+ "us-west-1" : {"Region" : "us-west-2" },
576+ "af-south-1" : {"Region" : "eu-west-1" },
577+ "ap-east-1" : {"Region" : "ap-southeast-1" },
578+ "ca-central-1" : {"Region" : "us-east-1" },
579+ "eu-south-1" : {"Region" : "eu-central-1" },
580+ "eu-west-3" : {"Region" : "eu-west-2" },
581+ "eu-north-1" : {"Region" : "eu-west-2" },
582+ "me-south-1" : {"Region" : "ap-south-1" },
583+ })
584+
559585# ==============================================================================
560586# CLOUDWATCH LOGS
561587# ==============================================================================
@@ -1357,7 +1383,7 @@ def __init__(self, value_one: object, value_two: object) -> None:
13571383 ),
13581384 OriginShield = cloudfront .OriginShield (
13591385 Enabled = True ,
1360- OriginShieldRegion = Region ,
1386+ OriginShieldRegion = FindInMap ( "OriginShieldRegionMap" , Region , "Region" ) ,
13611387 ),
13621388 )],
13631389 DefaultCacheBehavior = cloudfront .DefaultCacheBehavior (
0 commit comments