AWSアップデート情報のJSON Feedを取得してみた

2022.11.28

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

みなさんこんにちは、杉金です。
re:invent 2022が始まり、多くのアップデートニュースがビッグウェーブのように押し寄せているのですが、AWSアップデートのJSON Feedが取得できるようになったらしいので試してみました。

例えば以下でアクセスできます。

コマンドで取得してみた

curlとjqを使ってアップデートタイトルを抽出してみます。

アップデートタイトル抽出

$curl -s https://aws.amazon.com/api/dirs/items/search\?item.directoryId\=whats-new\&sort_by\=item.additionalFields.postDateTime\&sort_order\=desc\&size\=%7B%7D\&item.locale\=en_US\&tags.id\=whats-new%23year%232022 \
  | jq '.items[].item.additionalFields.headline'

# 実行結果(例)
"Amazon QuickSight launches cluster points for Geospatial Visual"
"Amazon Managed Grafana now supports visualizing Prometheus Alertmanager rules and new configuration APIs"
"AWS IoT RoboRunner is now generally available"
"Amazon EBS launches Rule Lock for Recycle Bin to prevent unintended changes to Region-level retention rules for Snapshots and AMIs"
"Amazon Rekognition adds new pre-trained labels, and introduces color detection"
"AWS announces availability of Microsoft SQL Server 2022 images on Amazon EC2"
"Amazon SNS adds support for payload-based message filtering"
"Amazon SageMaker Autopilot experiments run with Ensemble training mode provide additional metrics and visibility into the AutoML workflow "
"Amazon EMR on EKS adds support for configuring Spark properties within EMR Studio Jupyter Notebooks"
"AWS Control Tower now displays compliance status of external AWS Config rules"
〜略〜

取得件数の調整パラメーター

  • URLクエリの末尾に &page=2 のように付与すると3ページ目が取得できます。 page=0 から始まります。
  • size\=%7B%7Dsize\=50 のようにすると取得できる件数を指定できます。スロットリングが発生するかもしれないため100以上は試していません。

日付とタイトルとURLを抽出

日付とタイトル、URLを抽出してみます。

curl -s https://aws.amazon.com/api/dirs/items/search\?item.directoryId\=whats-new\&sort_by\=item.additionalFields.postDateTime\&sort_order\=desc\&size\=%7B%7D\&item.locale\=en_US\&tags.id\=whats-new%23year%232022 \
 | jq -r '.items[].item | [.dateCreated, .additionalFields.headline, .additionalFields.headlineUrl] | @csv'

# 実行結果(例)
"2022-11-28T04:22:05+0000","AWS Backup introduces support for Amazon Redshift","/about-aws/whats-new/2022/11/aws-backup-support-amazon-redshift/"
"2022-11-28T05:31:18+0000","AWS Backup launches delegation of organization-wide backup administration","/about-aws/whats-new/2022/11/aws-backup-delegation-organization-wide-backup-administration/"
"2022-11-28T04:22:25+0000","AWS IoT announces general availability for version 5 of MQTT message broker (MQTT5)","/about-aws/whats-new/2022/11/aws-iot-general-availability-version-5-mqtt-message-broker-mqtt5/"
"2022-11-28T04:22:37+0000","Announcing real-time capabilities in Amazon Transcribe Call Analytics API to improve customer experience","/about-aws/whats-new/2022/11/real-time-capabilities-amazon-transcribe-call-analytics-api-improve-customer-experience/"
〜略〜

日付はISO 8601形式、URLはドメイン部分が省略されています。

日付とタイトルとURLを抽出(日付古い順)

末尾にsortコマンドへのリダイレクトを加えて並び替えをします。

curl -s https://aws.amazon.com/api/dirs/items/search\?item.directoryId\=whats-new\&sort_by\=item.additionalFields.postDateTime\&sort_order\=desc\&size\=50\&item.locale\=en_US\&tags.id\=whats-new%23year%232022 \
 | jq -r '.items[].item  | [.dateCreated, .additionalFields.headline, .additionalFields.headlineUrl] | @csv' | sort

# 実行結果(例)
"2022-11-21T18:04:37+0000","Amazon QuickSight now supports connectivity to Databricks","/about-aws/whats-new/2022/11/amazon-quicksight-supports-connectivity-databricks/"
"2022-11-22T18:03:25+0000","Amazon EMR on EKS adds support for configuring Spark properties within EMR Studio Jupyter Notebooks","/about-aws/whats-new/2022/11/emr-eks-configuring-spark-properties-emr-studio-jupyter-notebooks/"
"2022-11-23T18:04:48+0000","AWS IoT RoboRunner is now generally available","/about-aws/whats-new/2022/11/aws-iot-roborunner-generally-available/"
"2022-11-28T04:22:05+0000","AWS Backup introduces support for Amazon Redshift","/about-aws/whats-new/2022/11/aws-backup-support-amazon-redshift/"
〜略〜

スプレッドシートに貼り付けて見やすくする

sortで並び替えたものをスプレッドシートに貼り付けてみました。

貼り付ける時に右下のアイコンから「テキストを列に分割」を選ぶとカンマ区切りのレコードを各列に分割してくれます。

別シートを作り関数を使って見やすくしてみました。

関数は以下のように設定しました。抽出した一覧(別シート)を参照しています。

A列の関数
=DATEVALUE(MID(抽出した日付,1,10))

B列の関数
=HYPERLINK("https://aws.amazon.com/"&抽出したURL,抽出したタイトル)

最後に

JSON Feedを利用してアップデートの傾向なども分析できそうです。あとは定期取得する仕組みも実装できればと思うのですが、RSSを使うのとどちらが優れているのかまだ分かっていません。

参考情報