Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does AWS Cloudformation say "Invalid request" when trying to create this RecordSetGroup?

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.

like image 246
Saqib Ali Avatar asked Feb 01 '26 16:02

Saqib Ali


2 Answers

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

like image 189
Saqib Ali Avatar answered Feb 04 '26 04:02

Saqib Ali


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.

like image 36
awenclaw Avatar answered Feb 04 '26 05:02

awenclaw



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!