Created
March 29, 2013 03:23
-
-
Save riaf/5268561 to your computer and use it in GitHub Desktop.
Route53 で管理しているドメインを一覧で見たかったので
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWS = require "aws-sdk" | |
AWS.config.update | |
accessKeyId: "chacococco" | |
secretAccessKey: "chacococco" | |
region: "us-east-1" | |
route53 = new AWS.Route53 | |
route53.client.listHostedZones {}, (err, data) -> | |
if err | |
throw err | |
for hostedZone in data.HostedZones | |
route53.client.listResourceRecordSets { HostedZoneId: hostedZone.Id }, (err, data) -> | |
if err | |
throw err | |
for ResourceRecordSet in data.ResourceRecordSets | |
for ResourceRecord in ResourceRecordSet.ResourceRecords | |
console.log "#{ ResourceRecordSet.Type }\t#{ ResourceRecordSet.Name }\t#{ ResourceRecord.Value }" | |
console.log "\n==============================\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment