Amazon Comprehend および Application Auto Scaling
ターゲット追跡スケーリングポリシーとスケジュールされたスケーリングを使用して、Amazon Comprehend document classification and entity recognizer endpoints をスケールできます。
Amazon Comprehend と Application Auto Scaling の統合には、次の情報を参考にしてください。
Amazon Comprehend document classification and entity recognizer endpoints のスケーリングを始めたばかりの場合は、以下のドキュメントで、Application Auto Scaling での Amazon Comprehend の使用に関するサンプル設定と詳細を確認できます。
-
Auto scaling with endpoints in the Amazon Comprehend 開発者ガイド
Amazon Comprehend 向けに作成されたサービスリンクロール
The following service-linked role is automatically created in your AWS account when registering Amazon Comprehend resources as scalable targets with Application Auto Scaling. This role allows Application Auto Scaling to perform supported operations within your account. For more information, see Application Auto Scaling のサービスリンクロール.
-
AWSServiceRoleForApplicationAutoScaling_ComprehendEndpoint
サービスリンクロールが使用するサービスプリンシパル
The service-linked role in the previous section can be assumed only by the service principal authorized by the trust relationships defined for the role. The service-linked role used by Application Auto Scaling grants access to the following service principal:
-
comprehend.application-autoscaling.amazonaws.com
スケーラブルターゲットとしての Amazon Comprehend リソースの Application Auto Scaling への登録
Application Auto Scaling では、Amazon Comprehend のドキュメント分類とエンティティ認識器の各エンドポイントのスケーリングポリシーまたはスケジュールされたアクションを作成する前に、スケーラブルターゲットが必要になります。スケーラブルターゲットとは、Application Auto Scaling がスケールアウトまたはスケールインできるリソースです。スケーラブルターゲットは、リソース ID、スケーラブルディメンション、および名前空間の組み合わせによって一意に識別されます。
AWS SDK のいずれか、または AWS CLI を使用してオートスケーリングを設定するには、以下のオプションを使用できます。
-
AWS CLI:
ドキュメント分類エンドポイントに対して 登録登録-スケーラブル-ターゲット コマンドを呼び出します。以下の例は、最小容量を 1 個の推論単位、および最大容量を 3 個の推論単位とし、ドキュメント分類器エンドポイントの ARN を使用してそのエンドポイントのモデルによって使用される推論単位の希望数を登録します。
aws application-autoscaling register-scalable-target \ --service-namespace comprehend \ --scalable-dimension comprehend:document-classifier-endpoint:DesiredInferenceUnits \ --resource-id arn:aws:comprehend:
us-west-2
:123456789012
:document-classifier-endpoint/EXAMPLE
\ --min-capacity1
\ --max-capacity3
エンティティ認識器エンドポイントに対して
register-scalable-target
コマンドを呼び出します。以下の例は、最小容量を 1 個の推論単位、および最大容量を 3 個の推論単位とし、エンティティ認識器エンドポイントの ARN を使用してそのエンドポイントのモデルによって使用される推論単位の希望数を登録します。aws application-autoscaling register-scalable-target \ --service-namespace comprehend \ --scalable-dimension comprehend:entity-recognizer-endpoint:DesiredInferenceUnits \ --resource-id arn:aws:comprehend:
us-west-2
:123456789012
:entity-recognizer-endpoint/EXAMPLE
\ --min-capacity1
\ --max-capacity3
-
AWS SDK:
RegisterScalableTargetオペレーションを呼び出し、
ResourceId
、ScalableDimension
、ServiceNamespace
、MinCapacity
、およびMaxCapacity
をパラメータとして指定します。