I'm using the python module troposphere to create my cloud formation template. Most of it is complete but I seem to be confused about how to create my DNS entries for the load balancer with the RecordSets method/function. The output for this section is supposed to look like:
"devdevopsdemoELBDNSARecord0": {
"Type": "AWS::Route53::RecordSetGroup",
"Properties": {
"HostedZoneName": "FOO.net.",
"Comment": "Alias targeted to devdevopsdemoELB ELB.",
"RecordSets": [
{
"Name": "devopsdemo.dev.FOO.net.",
"Type": "A",
"AliasTarget": {
"HostedZoneId": {
"Fn::GetAtt": [
"devdevopsdemoELB",
"CanonicalHostedZoneNameID"
]
},
"DNSName": {
"Fn::GetAtt": [
"devdevopsdemoELB",
"CanonicalHostedZoneName"
]
}
}
},
{
"Name": "devopsdemo-dev.FOO.net.",
"Type": "A",
"AliasTarget": {
"HostedZoneId": {
"Fn::GetAtt": [
"devdevopsdemoELB",
"CanonicalHostedZoneNameID"
]
},
"DNSName": {
"Fn::GetAtt": [
"devdevopsdemoELB",
"CanonicalHostedZoneName"
]
}
}
}
I've started with:
hostedzone = "FOO.net"
myRecordSet = RecordSetType("devdevopsdemoELBDNSARecord0")
myRecordSet.HostedZoneName=Join("", hostedzone, "."])
myRecordSet.Comment="Alias targeted to devdevopsdemoELB ELB."
But then I'm not clear on how the RecordSets values should be entered.
I supposed I could just use the straight
myRecordSet.RecordSets =
And just put the json into place, but that seems a bit like a misuse of the purpose of using troposphere in the first place.
Update: Putting in the json results in this error
AttributeError: AWS::Route53::RecordSet object does not support attribute RecordSets
myRecordSet.RecordSets = [
{
"Name": "devopsdemo.dev.FOO.net.",
"Type": "A",
"AliasTarget": {
"HostedZoneId": {
"Fn::GetAtt": [
"devdevopsdemoELB",
"CanonicalHostedZoneNameID"
]
},
"DNSName": {
"Fn::GetAtt": [
"devdevopsdemoELB",
"CanonicalHostedZoneName"
]
}
}
},
{
"Name": "devopsdemo-dev.FOO.net.",
"Type": "A",
"AliasTarget": {
"HostedZoneId": {
"Fn::GetAtt": [
"devdevopsdemoELB",
"CanonicalHostedZoneNameID"
]
},
"DNSName": {
"Fn::GetAtt": [
"devdevopsdemoELB",
"CanonicalHostedZoneName"
]
}
}
}
]
Aucun commentaire:
Enregistrer un commentaire