LoginSignup
15
14

More than 5 years have passed since last update.

RoadWorkerで管理するAWS Route53

Posted at

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で管理するといい感じ。

15
14
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
15
14