Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

RoadWorkerで管理するAWS Route53

More than 5 years have passed since last update.

RoadWorker

AWSのRoute53の設定をRubyのDSLで管理できるCLIツール。

作成者サイト
http://so-wh.at/

Github
https://github.com/winebarrel/roadworker

手順

インストール

インストール

gem install roadworker --no-ri --no-rdoc

確認

➜   roadwork -v
roadwork 0.4.10

➜ roadwork
Usage: roadwork [options]
    -p, --profile PROFILE_NAME
    -k, --access-key ACCESS_KEY
    -s, --secret-key SECRET_KEY
    -a, --apply
    -f, --file FILE
        --dry-run
        --force
        --no-health-check-gc
    -e, --export
    -o, --output FILE
        --split
        --with-soa-ns
    -t, --test
        --nameservers SERVERS
        --port PORT
        --no-color
        --debug

security credentialsを記載

➜  vim ~/.aws/credentials
[default]
aws_access_key_id=AKIxxxxxxxxxxxxxxxx
aws_secret_access_key=xxxxxxxxxxxxxxxxxxxxx

Route53の情報を取得

roadwork -e -o Routefile 
cat Routefile
==========
osted_zone "domain.info." do
  rrset "domain.info.", "A" do
    ttl 60
    resource_records(
      "xxx.xxx.xxx.xxx"
    )
  end

  rrset "sub.domain.info.", "A" do
    ttl 300
    resource_records(
      "xxx.xxx.xxx.xxx"
    )
  end
==========

テスト、設定適用

差分比較

➜ roadwork -t -f Routefile

dry-run

➜   roadwork -a -f Routefile --dry-run
Apply `Routefile` to Route53 (dry-run)

適用

➜   roadwork -a -f Routefile

etc

コードはgitで管理するといい感じ。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away