2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CloudFormationでHostedZoneIdを設定してるのに「Property HostedZoneId cannot be empty.」と言われた時

Posted at

本題

標題の通りですが、AWSのCloudFormationのテンプレートで、でHostedZoneIdを設定してるのに「Property HostedZoneId cannot be empty.」とエラーが出てしまい、原因が分からずしばらくハマリました。

確かにHostedZoneIdは設定したはずなのに...。

  DnsRecord: 
    Type: "AWS::Route53::RecordSet"
    Properties:
      HostedZoneId: XYZ1234ABCD  # ←Emptyじゃないよね!
      Name: hoge.fuga.co.jp
      Type: A
      AliasTarget:
        DNSName: xxxxxx.ap-northeast-1.elb.amazonaws.com

なんの事は無い、AliasTargetの方のHostedZoneIdが抜けていたのでした。

  DnsRecord: 
    Type: "AWS::Route53::RecordSet"
    Properties:
      HostedZoneId: XYZ1234ABCD
      Name: hoge.fuga.co.jp
      Type: A
      AliasTarget:
        HostedZoneId: YSHDK1233P # ←こっちです、抜けてたのは!
        DNSName: xxxxxx.ap-northeast-1.elb.amazonaws.com

もし同じミスでハマった人の手助けになればと思った次第です。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?