3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[AWS]ワンライナーでRoute53の情報を取得そして整形

Last updated at Posted at 2016-09-09

自己満です。
引き続き前回のRoute53の出力を整形して管理画面のような形にしてみました。

aws --profile ${_title} --region ${_region} route53 list-resource-record-sets --hosted-zone-id $zoneid | jq -r -c '.ResourceRecordSets[] | { Name: .Name, Type: .Type, Value: .ResourceRecords, Aliases: .AliasTarget.DNSName }' | jq -r 'if .Type == "NS" then {Name: .Name, Type: .Type, Value: select(.Value !=null).Value[]?.Value?} else empty end' | jq -r -c '.Name + "\t" + .Type + "\t" + .Value' | xargs printf "%-50s%-20s%s\n"

Domain RecordType Value

の形で出力されます

もっと綺麗に整形できる方法があれば教えて下さい。

3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?