LoginSignup
0
0

More than 1 year has passed since last update.

MediaConvert の API 呼び出しに利用するリージョン固有エンドポイントの仕様

Posted at

はじめに

AWS MediaConvert の API を呼び出す場合、一般的に用意されている public なエンドポイントを使うのでなく、MediaConvert が用意しているエンドポイントを利用する必要がある。
その方法としては describe-endpoints でアカウント固有のエンドポイントを取得してきて利用する方法が紹介されている。

boto3を利用した例
# MediaConvert の public endpoint を使ってアカウント固有のエンドポイントを取得
endpoints = boto3.client(
    'mediaconvert').describe_endpoints().get('Endpoints')

# 取得した固有のエンドポイントから API 利用を行う client を取得
client = boto3.client('mediaconvert', endpoint_url=endpoints[0]['Url'])

しかし、この DescribeEndpoints はかなり API Limit の制限が強い。 言い換えると、プログラム実行の都度に呼び出すと簡単に TooManyRequestsException などが発生してしまう。 そのため、ハードコーディングをするなどしたい。

しかし、わざわざ API で呼び出してエンドポイントを取得する、ということは、この API で得られた結果が変動する可能性も考えられる。 そのため、ハードコーディングが可能であるか否かを調査した。

結論

ハードコーディング可能。 1度 API エンドポイントが作成された後は、アカウントのリージョン単位で固定される

With most AWS services, you send your service request to a public endpoint. But with MediaConvert, you request an endpoint that is specific to your Region, and then you send your service requests to that. For information about MediaConvert FIPS endpoints, see FIPS Endpoints.

Note
This endpoint is specific to your AWS Region and won't change. Request this endpoint once, and then hardcode or cache it.

0
0
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
0
0