I have an AWS CloudFormation file that includes this:
"myELB" : {
"Type": "AWS::ElasticLoadBalancing::LoadBalancer",
Blah Blah Blah
},
"DatabaseDNSRecord" : {
"Type" : "AWS::Route53::RecordSetGroup",
"DependsOn": ["myELB"],
"Properties" : {
"HostedZoneId" : "Z19Y4P1DDQJADI", # obfuscated obviously.
"RecordSets" : [
{
"Name" : "mydns.privatehostedzone.",
"Type" : "CNAME",
"ResourceRecords" : [
{"Fn::GetAtt" : ["myELB","DNSName"]}
]
}
]
}
},
When I run it, I get the following cryptic error:
Error Message: 18:59:16 UTC-0500 CREATE_FAILED AWS::Route53::RecordSetGroup DatabaseDNSRecord Invalid request
Can someone suggest what the problem is here? I don't see what I'm doing wrong. myELB is successfully created.
I found the answer here. TTL is needed. Even though the docs wrongly state that it is not.
https://serverfault.com/questions/649004/aws-cloudformation-returning-invalid-request-when-trying-to-create-a-awsrout
I was struggling with Cloudformation "HandlerErrorCode: InvalidRequest" error while creating other AWS resource (AWS::KafkaConnect::Connector which is far from being well documented as of today). One option to get more descriptive error is to go to CloudTrail and find exact Cloudformation event that has failed (you can use exact time range). In CloudTrail event json you will find responseElements.message that might bring more detail information. It has solve the problem for me, perhaps will be useful for others in future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With