| 
									
										
										
										
											2022-05-12 09:58:17 -04:00
										 |  |  | # Example distribution config used in tests in both test_cloudfront.py | 
					
						
							|  |  |  | # as well as test_cloudfront_distributions.py. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def example_distribution_config(ref): | 
					
						
							|  |  |  |     """Return a basic example distribution config for use in tests.""" | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |         "CallerReference": ref, | 
					
						
							|  |  |  |         "Origins": { | 
					
						
							|  |  |  |             "Quantity": 1, | 
					
						
							|  |  |  |             "Items": [ | 
					
						
							|  |  |  |                 { | 
					
						
							|  |  |  |                     "Id": "origin1", | 
					
						
							|  |  |  |                     "DomainName": "asdf.s3.us-east-1.amazonaws.com", | 
					
						
							| 
									
										
										
										
											2022-12-08 00:02:01 +00:00
										 |  |  |                     "OriginPath": "/example", | 
					
						
							|  |  |  |                     "S3OriginConfig": { | 
					
						
							|  |  |  |                         "OriginAccessIdentity": "origin-access-identity/cloudfront/00000000000001" | 
					
						
							|  |  |  |                     }, | 
					
						
							| 
									
										
										
										
											2022-05-12 09:58:17 -04:00
										 |  |  |                 } | 
					
						
							|  |  |  |             ], | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "DefaultCacheBehavior": { | 
					
						
							|  |  |  |             "TargetOriginId": "origin1", | 
					
						
							|  |  |  |             "ViewerProtocolPolicy": "allow-all", | 
					
						
							|  |  |  |             "MinTTL": 10, | 
					
						
							|  |  |  |             "ForwardedValues": {"QueryString": False, "Cookies": {"Forward": "none"}}, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "Comment": "an optional comment that's not actually optional", | 
					
						
							|  |  |  |         "Enabled": False, | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-06-29 20:12:56 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def example_dist_config_with_tags(ref): | 
					
						
							|  |  |  |     config = example_distribution_config(ref) | 
					
						
							|  |  |  |     config["Tags"] = { | 
					
						
							|  |  |  |         "Items": [{"Key": "k1", "Value": "v1"}, {"Key": "k2", "Value": "v2"}] | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return config | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def example_dist_custom_config(ref): | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |         "CallerReference": ref, | 
					
						
							|  |  |  |         "Origins": { | 
					
						
							|  |  |  |             "Quantity": 1, | 
					
						
							|  |  |  |             "Items": [ | 
					
						
							|  |  |  |                 { | 
					
						
							|  |  |  |                     "Id": "origin1", | 
					
						
							|  |  |  |                     "DomainName": "asdf.s3.us-east-1.amazonaws.com", | 
					
						
							|  |  |  |                     "CustomOriginConfig": { | 
					
						
							|  |  |  |                         "HTTPPort": 80, | 
					
						
							|  |  |  |                         "HTTPSPort": 443, | 
					
						
							|  |  |  |                         "OriginKeepaliveTimeout": 5, | 
					
						
							|  |  |  |                         "OriginProtocolPolicy": "http-only", | 
					
						
							|  |  |  |                         "OriginReadTimeout": 30, | 
					
						
							|  |  |  |                         "OriginSslProtocols": { | 
					
						
							|  |  |  |                             "Quantity": 2, | 
					
						
							|  |  |  |                             "Items": ["TLSv1", "SSLv3"], | 
					
						
							|  |  |  |                         }, | 
					
						
							|  |  |  |                     }, | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             ], | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "DefaultCacheBehavior": { | 
					
						
							|  |  |  |             "TargetOriginId": "origin1", | 
					
						
							|  |  |  |             "ViewerProtocolPolicy": "allow-all", | 
					
						
							|  |  |  |             "MinTTL": 10, | 
					
						
							|  |  |  |             "ForwardedValues": {"QueryString": False, "Cookies": {"Forward": "none"}}, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "Comment": "an optional comment that's not actually optional", | 
					
						
							|  |  |  |         "Enabled": False, | 
					
						
							|  |  |  |     } |