0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

13日目:AWS無料枠使い倒し「Route 53でドメイン設定」

0
Posted at

Route 53でドメイン設定を体験

予定コスト: $0.00(設定のみ)


✅ この記事でやること

Hosted Zone作成→Aレコード追加の基本操作。


✅ 前提(準備)

ドメイン名の用意(検証用でも可)。


Hosted Zone作成

ホストゾーンを作成。

ZONE_ID=$(aws route53 create-hosted-zone --name example.com 
  --caller-reference $(date +%s) --query HostedZone.Id --output text)

・--name example.com
  管理対象のドメイン名を指定します。
・--caller-reference $(date +%s)
  一意なリクエストIDを指定するため、UNIXタイムスタンプを利用。
・--query HostedZone.Id --output text
  作成されたHosted ZoneのIDのみを取得し、変数ZONE_IDに格納。


Aレコード追加(例)

Aレコードを追加して疎通確認。

cat > rr.json <<'JSON'
{
  "Comment": "Add A record",
  "Changes": [{
    "Action": "UPSERT",
    "ResourceRecordSet": {
      "Name": "www.example.com",
      "Type": "A",
      "TTL": 300,
      "ResourceRecords": [{"Value": "1.2.3.4"}]
    }
  }]
}
JSON
aws route53 change-resource-record-sets --hosted-zone-id $ZONE_ID --change-batch file://rr.json

・"Action": "UPSERT"
  レコードが存在すれば更新、なければ追加。
・"Name": "www.example.com"
  サブドメインを指定。
・"TTL": 300
  キャッシュの有効期限(秒)。
・"Value": "1.2.3.4"
  紐付けるIPv4アドレス。


💡 豆知識 (Tips)

  • ACM証明書のDNS検証にRoute 53を活用
  • ALIASレコードでCloudFront/ALBへ名前解決

⚠️ 落とし穴

  • TTL設定が長すぎて切替に時間がかかる
  • 公開ゾーンとプライベートゾーンの混同

🧾 今日のコスト

$0.00(設定のみ)


✅ まとめ

  • 本日のゴールを確認
  • 無料枠を意識して運用
  • 次回に繋がるポイントを整理

✅ 次回予告(14日目)

「CloudFrontでコンテンツ配信を高速化」

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?