Route 53 Advanced Hosted Zones の Change Guardrails と Change History を試してみた

Route 53 Advanced Hosted Zones の Change Guardrails と Change History を試してみた

Amazon Route 53 の Advanced Hosted Zones を CLI と CloudFormation で作成し、Change Guardrails の ALIAS_TARGET_CHECK を有効にしました。Change History ではレコード単位の変更を取得できました。既存ゾーンの tier 変更と料金も確認しています。
2026.11.24

はじめに

2026年11月20日に、Amazon Route 53 の Advanced Hosted Zones が発表されました。

https://aws.amazon.com/about-aws/whats-new/2026/11/route-53-offers-advanced-hosted-zones/

Advanced Hosted Zones は、ホストゾーンの新しい tier です。誤ったレコード削除を拒否する Change Guardrails、レコード単位で変更を残す Change History、プライベートホストゾーンでの Public DNS Fallback を含みます。

この記事では、Change Guardrails のうち ALIAS_TARGET_CHECK と、Change History を CLI で試した結果を紹介します。
Public DNS Fallback は別記事で紹介予定です。

検証環境

  • AWS CLI:2.42.1(update-hosted-zone-tier などのサブコマンドを含む版)
  • ホストゾーン:新規作成のパブリックホストゾーン
  • 有効にしたガードレール:ALIAS_TARGET_CHECK
  • CloudFormation スタックのリージョン:東京(ap-northeast-1)

Advanced ホストゾーンの作成

create-hosted-zone の --hosted-zone-config に tier を渡すと Advanced ホストゾーンを作成できます。有効にするガードレールは --change-guardrails で指定します。--caller-reference には任意の一意な文字列を指定します。

aws route53 create-hosted-zone \
  --name xxx.example.com \
  --caller-reference r53-adv-1795276324 \
  --hosted-zone-config HostedZoneTier=ADVANCED \
  --change-guardrails Name=ALIAS_TARGET_CHECK,Status=ENABLED

応答から、tier と Features の部分を抜粋します。

{
    "HostedZone": {
        "Name": "xxx.example.com.",
        "Config": {
            "HostedZoneTier": "ADVANCED"
        },
        "Features": {
            "ChangeHistory": {
                "Status": "ENABLED",
                "RetentionStartsAt": "2026-11-21T15:52:05.324000+00:00"
            },
            "ChangeGuardrails": [
                {
                    "Name": "NS_OCCLUSION_CHECK",
                    "Status": "DISABLED"
                },
                {
                    "Name": "NS_DELEGATION_AUTHORITY_CHECK",
                    "Status": "ENABLED"
                },
                {
                    "Name": "NS_FORMAT_CHECK",
                    "Status": "ENABLED"
                },
                {
                    "Name": "ALIAS_TARGET_CHECK",
                    "Status": "ENABLED"
                },
                {
                    "Name": "ACTIVE_RECORD_CHECK",
                    "Status": "DISABLED"
                },
                {
                    "Name": "ACTIVE_DELEGATION_CHECK",
                    "Status": "DISABLED"
                }
            ]
        }
    }
}

ALIAS_TARGET_CHECK の動作

作成した Advanced ホストゾーンに、A レコード app と、それを指す alias レコード www を作ります。変更バッチの JSON は、この節の末尾に折りたたんで載せています。

aws route53 change-resource-record-sets \
  --hosted-zone-id <hosted-zone-id> \
  --change-batch file://adv-create-records.json

app だけを DELETE する変更バッチ(adv-delete-app.json)を同じコマンドで送ると、リクエストが拒否されました。

aws: [ERROR]: An error occurred (InvalidChangeBatch) when calling the ChangeResourceRecordSets operation: [RRSet with DNS name app.xxx.example.com., type A. ALIAS_TARGET_CHECK: The requested change cannot be completed because it would delete a record that is still referenced by alias record 'www.xxx.example.com.'. Remove or retarget the referencing alias record(s), or delete them in the same batch, before deleting this record.]

拒否後に list-resource-record-sets で確認すると、app(A、192.0.2.10)と www(alias)は削除前と同じ状態で残っていました。

app の DELETE に別のレコード new の CREATE を加えたバッチ(adv-delete-app-and-create-new.json)も、上と同じエラーで拒否されました。レコード名を一覧すると new は作られておらず、バッチ全体が拒否されています。

aws route53 list-resource-record-sets \
  --hosted-zone-id <hosted-zone-id> \
  --query "ResourceRecordSets[?Type!='NS' && Type!='SOA'].Name"
[
    "app.xxx.example.com.",
    "www.xxx.example.com."
]

エラー文にある対処法のとおり、www と app の DELETE を1つのバッチ(adv-delete-www-and-app.json)で送ると、削除は成功しました。

aws route53 change-resource-record-sets \
  --hosted-zone-id <hosted-zone-id> \
  --change-batch file://adv-delete-www-and-app.json
変更バッチのファイル

alias レコードの HostedZoneId には、作成したホストゾーンの ID を指定します。

adv-create-records.json

{
  "Comment": "create app and www alias",
  "Changes": [
    {"Action": "CREATE", "ResourceRecordSet": {"Name": "app.xxx.example.com", "Type": "A", "TTL": 60, "ResourceRecords": [{"Value": "192.0.2.10"}]}},
    {"Action": "CREATE", "ResourceRecordSet": {"Name": "www.xxx.example.com", "Type": "A", "AliasTarget": {"HostedZoneId": "Z0123456789EXAMPLE", "DNSName": "app.xxx.example.com", "EvaluateTargetHealth": false}}}
  ]
}

adv-delete-app.json

{
  "Comment": "delete app only",
  "Changes": [
    {"Action": "DELETE", "ResourceRecordSet": {"Name": "app.xxx.example.com", "Type": "A", "TTL": 60, "ResourceRecords": [{"Value": "192.0.2.10"}]}}
  ]
}

adv-delete-app-and-create-new.json

{
  "Comment": "create new and delete app",
  "Changes": [
    {"Action": "CREATE", "ResourceRecordSet": {"Name": "new.xxx.example.com", "Type": "A", "TTL": 60, "ResourceRecords": [{"Value": "192.0.2.20"}]}},
    {"Action": "DELETE", "ResourceRecordSet": {"Name": "app.xxx.example.com", "Type": "A", "TTL": 60, "ResourceRecords": [{"Value": "192.0.2.10"}]}}
  ]
}

adv-delete-www-and-app.json

{
  "Comment": "delete www alias and app in one request",
  "Changes": [
    {"Action": "DELETE", "ResourceRecordSet": {"Name": "www.xxx.example.com", "Type": "A", "AliasTarget": {"HostedZoneId": "Z0123456789EXAMPLE", "DNSName": "app.xxx.example.com", "EvaluateTargetHealth": false}}},
    {"Action": "DELETE", "ResourceRecordSet": {"Name": "app.xxx.example.com", "Type": "A", "TTL": 60, "ResourceRecords": [{"Value": "192.0.2.10"}]}}
  ]
}

CloudFormation での更新

HostedZoneTier と HostedZoneFeatures を指定したテンプレートで Advanced ホストゾーンを作り、同じテンプレートで app と www を管理します。

cfn-v1.yaml
AWSTemplateFormatVersion: '2010-09-09'
Resources:
  Zone:
    Type: AWS::Route53::HostedZone
    Properties:
      Name: cfn.xxx.example.com
      HostedZoneConfig:
        Comment: advanced hosted zone managed by CloudFormation
        HostedZoneTier: ADVANCED
      HostedZoneFeatures:
        ChangeGuardrails:
          - Name: ALIAS_TARGET_CHECK
            Status: ENABLED
  AppRecord:
    Type: AWS::Route53::RecordSet
    Properties:
      HostedZoneId: !Ref Zone
      Name: app.cfn.xxx.example.com
      Type: A
      TTL: '60'
      ResourceRecords:
        - 192.0.2.10
  WwwRecord:
    Type: AWS::Route53::RecordSet
    DependsOn: AppRecord
    Properties:
      HostedZoneId: !Ref Zone
      Name: www.cfn.xxx.example.com
      Type: A
      AliasTarget:
        HostedZoneId: !Ref Zone
        DNSName: app.cfn.xxx.example.com
        EvaluateTargetHealth: false
aws cloudformation deploy --stack-name r53-adv-cfn --template-file cfn-v1.yaml --no-fail-on-empty-changeset

deploy コマンドは Successfully created/updated stack と表示して正常終了し、Zone、AppRecord、WwwRecord の3リソースが CREATE_COMPLETE になりました。

続いて、cfn-v1.yaml から AppRecord リソースと WwwRecord の DependsOn を取り除いた cfn-v2-remove-app.yaml で、スタックを更新します。

aws cloudformation deploy --stack-name r53-adv-cfn --template-file cfn-v2-remove-app.yaml --no-fail-on-empty-changeset

更新の deploy コマンドも Successfully created/updated stack と表示して正常終了しました。スタックイベントは次のコマンドで取得します。

aws cloudformation describe-stack-events \
  --stack-name r53-adv-cfn \
  --query 'reverse(StackEvents)[].{Time:Timestamp,Logical:LogicalResourceId,Status:ResourceStatus,Reason:ResourceStatusReason}' \
  --output json

出力から、app の削除が失敗したイベントと、スタックの最終状態のイベントを抜き出しました。

[
  {
    "Logical": "AppRecord",
    "Status": "DELETE_FAILED",
    "Reason": "Resource handler returned message: \"[RRSet with DNS name app.cfn.xxx.example.com., type A. ALIAS_TARGET_CHECK: The requested change cannot be completed because it would delete a record that is still referenced by alias record 'www.cfn.xxx.example.com.'. Remove or retarget the referencing alias record(s), or delete them in the same batch, before deleting this record.] (Service: Route53, Status Code: 400, Request ID: <request-id>) (SDK Attempt Count: 1)\" (RequestToken: <token>, HandlerErrorCode: InvalidRequest)"
  },
  {
    "Logical": "r53-adv-cfn",
    "Status": "UPDATE_COMPLETE",
    "Reason": "Update successful. One or more resources could not be deleted."
  }
]

AppRecord の削除は約3分間隔で3回試行され、どれも DELETE_FAILED になりました。そのため更新時の deploy には約6分かかりました。更新後にゾーンのレコード名を一覧表示すると、app.cfn.xxx.example.com. と www.cfn.xxx.example.com. の両方が残っていました。テンプレートから外したレコードがゾーンに残るため、deploy が成功したことだけでは、テンプレートと実際のレコードが一致しているかどうかは分かりません。削除の失敗は、スタックイベントの DELETE_FAILED で確認できます。

Change History

list-hosted-zone-change-batches で、ゾーンに適用された変更をバッチ単位で取得できます。

aws route53 list-hosted-zone-change-batches --hosted-zone-id <hosted-zone-id>
{
    "ChangeBatchSummaries": [
        {
            "ChangeId": "C0123456789EXAMPLE",
            "Operation": "ChangeResourceRecordSets",
            "SubmittedAt": "2026-11-21T15:52:55.094000+00:00",
            "SubmittedBy": "arn:aws:sts::111122223333:assumed-role/Admin/my-session",
            "Comment": "delete www alias and app in one request",
            "ChangeCount": 2
        },
        {
            "ChangeId": "C1123456789EXAMPLE",
            "Operation": "ChangeResourceRecordSets",
            "SubmittedAt": "2026-11-21T15:52:13.478000+00:00",
            "SubmittedBy": "arn:aws:sts::111122223333:assumed-role/Admin/my-session",
            "Comment": "create app and www alias",
            "ChangeCount": 2
        },
        {
            "ChangeId": "C2123456789EXAMPLE",
            "Operation": "CreateHostedZone",
            "SubmittedAt": "2026-11-21T15:52:05.358000+00:00",
            "SubmittedBy": "arn:aws:sts::111122223333:assumed-role/Admin/my-session",
            "ChangeCount": 0
        }
    ]
}

出力は、各エントリの RequestId を省いて掲載しています。ALIAS_TARGET_CHECK に拒否された2件のリクエストは、一覧に出ていません。

一覧の ChangeId を get-hosted-zone-change-batch に渡すと、そのバッチの変更内容を取得できます。ChangeBatch.Changes には、各変更の Action とレコードの内容全体が含まれます。

aws route53 get-hosted-zone-change-batch \
  --hosted-zone-id <hosted-zone-id> \
  --change-id <change-id>

特定のレコードの変更は、list-resource-record-set-changes にレコード名とタイプを渡して取得します。www を指定すると、DELETE と CREATE の2件が新しい順に返りました。

aws route53 list-resource-record-set-changes \
  --hosted-zone-id <hosted-zone-id> \
  --record-name www.xxx.example.com \
  --record-type A
{
    "ResourceRecordSetChanges": [
        {
            "Operation": "ChangeResourceRecordSets",
            "SubmittedAt": "2026-11-21T15:52:55.094000+00:00",
            "Action": "DELETE",
            "ResourceRecordSet": {
                "Name": "www.xxx.example.com.",
                "Type": "A",
                "AliasTarget": {
                    "DNSName": "app.xxx.example.com.",
                    "EvaluateTargetHealth": false
                }
            }
        },
        {
            "Operation": "ChangeResourceRecordSets",
            "SubmittedAt": "2026-11-21T15:52:13.478000+00:00",
            "Action": "CREATE",
            "ResourceRecordSet": {
                "Name": "www.xxx.example.com.",
                "Type": "A",
                "AliasTarget": {
                    "DNSName": "app.xxx.example.com.",
                    "EvaluateTargetHealth": false
                }
            }
        }
    ]
}

出力は、各エントリの ChangeId、SubmittedBy、RequestId と、AliasTarget の HostedZoneId を省いて掲載しています。

CloudFormation が作ったゾーンにも、CreateHostedZone が1件、app と www の作成がそれぞれ1件(ChangeCount はいずれも1)の計3件が記録されました。

既存ゾーンの tier 変更

作成済みのホストゾーンの tier は、update-hosted-zone-tier で変更できます。STANDARD から ADVANCED、ADVANCED から STANDARD のどちらの変更も成功しました。

STANDARD から ADVANCED へ変更するには、次のコマンドを実行します。ALIAS_TARGET_CHECK は変更後も DISABLED のままなので、update-hosted-zone-features で有効にします。

aws route53 update-hosted-zone-tier --hosted-zone-id <hosted-zone-id> --hosted-zone-tier ADVANCED
aws route53 update-hosted-zone-features --hosted-zone-id <hosted-zone-id> --change-guardrails Name=ALIAS_TARGET_CHECK,Status=ENABLED

ADVANCED から STANDARD へ戻すときは、先に ALIAS_TARGET_CHECK を無効にします。

aws route53 update-hosted-zone-features --hosted-zone-id <hosted-zone-id> --change-guardrails Name=ALIAS_TARGET_CHECK,Status=DISABLED
aws route53 update-hosted-zone-tier --hosted-zone-id <hosted-zone-id> --hosted-zone-tier STANDARD

Advanced の料金

Advanced ホストゾーンの料金は、Standard ホストゾーンの料金に Advanced の追加料金を足した額です。以下は、2026年11月22日時点の Route 53 の料金ページの記載です。

項目 料金
Standard ホストゾーン(最初の25ゾーン) $0.50/月
Standard ホストゾーン(26ゾーン目以降) $0.10/月
Advanced の追加料金 $5.00/月(時間単位の日割り)
1ゾーンあたり 10,000 を超えるレコード 1レコードあたり $0.0015/月

NS 関連のガードレールは、Standard を含む全ゾーンで追加料金がかかりません。Advanced の追加料金の対象は、削除ガードレール、Change History、プライベートホストゾーンの Public DNS Fallback です。レコードは1ゾーンあたり 10,000 件まで料金に含まれます。

tier の変更は即時に反映されます。月の途中で変更した場合、Standard ホストゾーンの料金は満額かかります。Advanced の追加料金は、Advanced だった時間の分だけかかり、Standard に戻した時点で止まります。

まとめ

Amazon Route 53 の Advanced Hosted Zones で、Change Guardrails による変更の保護と、Change History の履歴を確認できました。

DNS レコードの更新事故、特に実サービスのエンドポイントの変更ミスや誤削除は、サービス障害につながる場合があります。

ホストゾーンを IaC で管理し、履歴もリポジトリ上で追跡できる場合は、Standard で十分なこともあります。
また、2026年11月のアップデートで、レコードセット単位の保護も可能になりました。

https://dev.classmethod.jp/articles/route53-recordset-protections/

一方、ACM や SES のウィザードで GUI から作られる重要な認証レコードが多数ある場合や、複数の担当者が変更する可能性がある場合は、Advanced Hosted Zones の Change Guardrails と Change History が効果的です。Advanced の月額費用が見合うかを評価することをおすすめします。

この記事をシェアする

AWSのお困り事はクラスメソッドへ

関連記事