commit
66a554470b
@ -209,7 +209,7 @@ class FakeZone(BaseModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def physical_resource_id(self):
|
def physical_resource_id(self):
|
||||||
return self.name
|
return self.id
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_from_cloudformation_json(cls, resource_name, cloudformation_json, region_name):
|
def create_from_cloudformation_json(cls, resource_name, cloudformation_json, region_name):
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
template = {
|
template = {
|
||||||
|
"Parameters": {
|
||||||
|
"R53ZoneName": {
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "my_zone"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
"Resources": {
|
"Resources": {
|
||||||
"Ec2Instance": {
|
"Ec2Instance": {
|
||||||
"Type": "AWS::EC2::Instance",
|
"Type": "AWS::EC2::Instance",
|
||||||
@ -13,20 +20,20 @@ template = {
|
|||||||
"HostedZone": {
|
"HostedZone": {
|
||||||
"Type": "AWS::Route53::HostedZone",
|
"Type": "AWS::Route53::HostedZone",
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"Name": "my_zone"
|
"Name": {"Ref": "R53ZoneName"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"myDNSRecord": {
|
"myDNSRecord": {
|
||||||
"Type": "AWS::Route53::RecordSet",
|
"Type": "AWS::Route53::RecordSet",
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"HostedZoneName": {"Ref": "HostedZone"},
|
"HostedZoneId": {"Ref": "HostedZone"},
|
||||||
"Comment": "DNS name for my instance.",
|
"Comment": "DNS name for my instance.",
|
||||||
"Name": {
|
"Name": {
|
||||||
"Fn::Join": ["", [
|
"Fn::Join": ["", [
|
||||||
{"Ref": "Ec2Instance"}, ".",
|
{"Ref": "Ec2Instance"}, ".",
|
||||||
{"Ref": "AWS::Region"}, ".",
|
{"Ref": "AWS::Region"}, ".",
|
||||||
{"Ref": "HostedZone"}, "."
|
{"Ref": "R53ZoneName"}, "."
|
||||||
]]
|
]]
|
||||||
},
|
},
|
||||||
"Type": "A",
|
"Type": "A",
|
||||||
|
@ -26,7 +26,7 @@ template = {
|
|||||||
"myDNSRecord": {
|
"myDNSRecord": {
|
||||||
"Type": "AWS::Route53::RecordSet",
|
"Type": "AWS::Route53::RecordSet",
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"HostedZoneName": {"Ref": "HostedZone"},
|
"HostedZoneId": {"Ref": "HostedZone"},
|
||||||
"Comment": "DNS name for my instance.",
|
"Comment": "DNS name for my instance.",
|
||||||
"Name": "my_record_set",
|
"Name": "my_record_set",
|
||||||
"Type": "A",
|
"Type": "A",
|
||||||
|
@ -5,30 +5,37 @@ template = {
|
|||||||
|
|
||||||
"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.",
|
"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.",
|
||||||
|
|
||||||
|
"Parameters": {
|
||||||
|
"R53ZoneName": {
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "my_zone"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
"Resources": {
|
"Resources": {
|
||||||
|
|
||||||
"MyZone": {
|
"MyZone": {
|
||||||
"Type": "AWS::Route53::HostedZone",
|
"Type": "AWS::Route53::HostedZone",
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"Name": "my_zone"
|
"Name": {"Ref": "R53ZoneName"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"MyDNSRecord": {
|
"MyDNSRecord": {
|
||||||
"Type": "AWS::Route53::RecordSetGroup",
|
"Type": "AWS::Route53::RecordSetGroup",
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"HostedZoneName": {"Ref": "MyZone"},
|
"HostedZoneId": {"Ref": "MyZone"},
|
||||||
"Comment": "Contrived example to redirect to aws.amazon.com 75% of the time and www.amazon.com 25% of the time.",
|
"Comment": "Contrived example to redirect to aws.amazon.com 75% of the time and www.amazon.com 25% of the time.",
|
||||||
"RecordSets": [{
|
"RecordSets": [{
|
||||||
"SetIdentifier": {"Fn::Join": [" ", [{"Ref": "AWS::StackName"}, "AWS"]]},
|
"SetIdentifier": {"Fn::Join": [" ", [{"Ref": "AWS::StackName"}, "AWS"]]},
|
||||||
"Name": {"Fn::Join": ["", [{"Ref": "AWS::StackName"}, ".", {"Ref": "AWS::Region"}, ".", {"Ref": "MyZone"}, "."]]},
|
"Name": {"Fn::Join": ["", [{"Ref": "AWS::StackName"}, ".", {"Ref": "AWS::Region"}, ".", {"Ref": "R53ZoneName"}, "."]]},
|
||||||
"Type": "CNAME",
|
"Type": "CNAME",
|
||||||
"TTL": "900",
|
"TTL": "900",
|
||||||
"ResourceRecords": ["aws.amazon.com"],
|
"ResourceRecords": ["aws.amazon.com"],
|
||||||
"Weight": "3"
|
"Weight": "3"
|
||||||
}, {
|
}, {
|
||||||
"SetIdentifier": {"Fn::Join": [" ", [{"Ref": "AWS::StackName"}, "Amazon"]]},
|
"SetIdentifier": {"Fn::Join": [" ", [{"Ref": "AWS::StackName"}, "Amazon"]]},
|
||||||
"Name": {"Fn::Join": ["", [{"Ref": "AWS::StackName"}, ".", {"Ref": "AWS::Region"}, ".", {"Ref": "MyZone"}, "."]]},
|
"Name": {"Fn::Join": ["", [{"Ref": "AWS::StackName"}, ".", {"Ref": "AWS::Region"}, ".", {"Ref": "R53ZoneName"}, "."]]},
|
||||||
"Type": "CNAME",
|
"Type": "CNAME",
|
||||||
"TTL": "900",
|
"TTL": "900",
|
||||||
"ResourceRecords": ["www.amazon.com"],
|
"ResourceRecords": ["www.amazon.com"],
|
||||||
|
Loading…
Reference in New Issue
Block a user