2015-01-17 10:17:25 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								from  __future__  import  unicode_literals  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								template  =  {  
						 
					
						
							
								
									
										
										
										
											2017-02-23 21:37:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    " AWSTemplateFormatVersion " :  " 2010-09-09 " , 
							 
						 
					
						
							
								
									
										
										
										
											2015-01-17 10:17:25 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-02-23 21:37:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    " Description " :  " AWS CloudFormation Sample Template Route53_RoundRobin: Sample template showing how to use weighted round robin (WRR) DNS entried via Amazon Route 53. This contrived sample uses weighted CNAME records to illustrate that the weighting influences the return records. It assumes that you already have a Hosted Zone registered with Amazon Route 53. **WARNING** This template creates one or more AWS resources. You will be billed for the AWS resources used if you create a stack from this template. " , 
							 
						 
					
						
							
								
									
										
										
										
											2015-01-17 10:17:25 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-10-21 22:41:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    " Parameters " :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " R53ZoneName " :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " Type " :  " String " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " Default " :  " my_zone " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-02-23 21:37:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    " Resources " :  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-01-17 10:17:25 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-02-23 21:37:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " MyZone " :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " Type " :  " AWS::Route53::HostedZone " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " Properties " :  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-21 22:41:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                " Name " :  { " Ref " :  " R53ZoneName " } 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-23 21:37:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } , 
							 
						 
					
						
							
								
									
										
										
										
											2015-01-17 10:17:25 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-02-23 21:37:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " MyDNSRecord " :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " Type " :  " AWS::Route53::RecordSetGroup " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " Properties " :  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-21 22:41:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                " HostedZoneId " :  { " Ref " :  " MyZone " } , 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-23 21:37:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                " Comment " :  " Contrived example to redirect to aws.amazon.com 75 % o f the time and www.amazon.com 25 % o f the time. " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                " RecordSets " :  [ { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " SetIdentifier " :  { " Fn::Join " :  [ "   " ,  [ { " Ref " :  " AWS::StackName " } ,  " AWS " ] ] } , 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-21 22:41:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    " Name " :  { " Fn::Join " :  [ " " ,  [ { " Ref " :  " AWS::StackName " } ,  " . " ,  { " Ref " :  " AWS::Region " } ,  " . " ,  { " Ref " :  " R53ZoneName " } ,  " . " ] ] } , 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-23 21:37:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    " Type " :  " CNAME " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " TTL " :  " 900 " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " ResourceRecords " :  [ " aws.amazon.com " ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " Weight " :  " 3 " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " SetIdentifier " :  { " Fn::Join " :  [ "   " ,  [ { " Ref " :  " AWS::StackName " } ,  " Amazon " ] ] } , 
							 
						 
					
						
							
								
									
										
										
										
											2017-10-21 22:41:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    " Name " :  { " Fn::Join " :  [ " " ,  [ { " Ref " :  " AWS::StackName " } ,  " . " ,  { " Ref " :  " AWS::Region " } ,  " . " ,  { " Ref " :  " R53ZoneName " } ,  " . " ] ] } , 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-23 21:37:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    " Type " :  " CNAME " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " TTL " :  " 900 " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " ResourceRecords " :  [ " www.amazon.com " ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " Weight " :  " 1 " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } , 
							 
						 
					
						
							
								
									
										
										
										
											2015-01-17 10:17:25 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-02-23 21:37:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    " Outputs " :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " DomainName " :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " Description " :  " Fully qualified domain name " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " Value " :  { " Ref " :  " MyDNSRecord " } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2015-01-17 10:17:25 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-23 21:37:43 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}