Amazon OpenSearch Service のリザーブドインスタンス - Amazon OpenSearch サービス

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

Amazon OpenSearch Service のリザーブドインスタンス

Amazon OpenSearch Service のリザーブドインスタンス (RI) では、標準オンデマンドインスタンスと比べて大幅な割引を受けられます。インスタンス自体は同一です。RI は、アカウントでのオンデマンドインスタンスに適用される請求の割引にすぎません。使用状況が予想可能な存続時間の長いアプリケーションについては、RI により時間の経過と共に大幅なコスト削減が可能になります。

OpenSearch Service RI には 1 年または 3 年の期間が必要で、割引レートに影響を与える 3 つのお支払い方法があります。

  • 前払いなし – 前払いはありません。期間内の時間ごとに割引された時間料金を支払います。

  • 一部前払い – 料金の一部を前払いし、期間内の時間ごとに割引された時間料金を支払います。

  • 全前払い – 料金を全額前払いします。期間内に時間料金は支払いません。

一般的に、前払い料金が多いほど割引率がなくなります。リザーブドインスタンスをキャンセルすることはできず (予約するときに、全期間に対して支払う契約を結びます)、前払い料金は払い戻しできません。

RI は柔軟ではなく、予約したインスタンスタイプにのみ適用されます。例えば、8 個の c5.2xlarge.search インスタンスのための予約は、16 個の c5.xlarge.search インスタンスまたは 4 個の c5.4xlarge.search インスタンスには適用されません。詳細については、「Amazon OpenSearch Service の料金」および「よくある質問」を参照してください。

リザーブドインスタンスの購入 (コンソール)

コンソールでは、既存のリザーブドインスタンスを表示したり、新しいリザーブドインスタンスを購入したりできます。

予約を購入するには
  1. https://aws.amazon.com にアクセスし、[コンソールにサインイン] を選択します。

  2. [分析] の下で、[Amazon OpenSearch Service] を選択します。

  3. ナビゲーションペインで [リザーブドインスタンスのリース] を選択します。

    このページでは、既存の予約を見ることができます。多くの予約がある場合、フィルタリングして特定の予約を識別して見やすくすることができます。

    ヒント

    [リザーブドインスタンスのリース] リンクが表示されない場合は、AWS リージョン でドメインを作成します

  4. [リザーブドインスタンスの注文] を選択します。

  5. 一意のわかりやすい名前を指定します。

  6. インスタンスタイプ、サイズ、およびインスタンスの数を選択します。ガイダンスについては、「Amazon OpenSearch Service ドメインのサイズ設定」を参照してください。

  7. 期間の長さと支払いオプションを選択します。支払いの詳細を慎重に確認します。

  8. [Next] を選択します。

  9. 購入概要を慎重に確認します。リザーブドインスタンスの購入は払い戻しできません。

  10. [注文] を選択します。

リザーブドインスタンスを購入する (AWS CLI)

AWS CLI には、提供タイプの表示、予約の購入、予約の表示を行うためのコマンドがあります。次のコマンドとサンプルレスポンスは、指定された AWS リージョン の提供タイプを示しています。

aws opensearch describe-reserved-instance-offerings --region us-east-1 { "ReservedInstanceOfferings": [ { "FixedPrice": x, "ReservedInstanceOfferingId": "1a2a3a4a5-1a2a-3a4a-5a6a-1a2a3a4a5a6a", "RecurringCharges": [ { "RecurringChargeAmount": y, "RecurringChargeFrequency": "Hourly" } ], "UsagePrice": 0.0, "PaymentOption": "PARTIAL_UPFRONT", "Duration": 31536000, "InstanceType": "m4.2xlarge.search", "CurrencyCode": "USD" } ] }

各戻り値の説明については、次の表を参照してください。

フィールド 説明
FixedPrice 予約の前払いコスト。
ReservedInstanceOfferingId 提供 ID。製品を予約する場合は、この値をメモしておきます。
RecurringCharges 予約の時間料金。
UsagePrice レガシーフィールド。OpenSearch Service では、この値は常に 0 です。
PaymentOption 前払いなし、一部前払い、または全額前払い。
Duration 期間の長さ (秒)。
  • 31536000 秒が 1 年です。

  • 94608000 秒が 3 年です。

InstanceType 予約のインスタンスタイプ。各インスタンスタイプに割り当てられるハードウェアリソースについては、「Amazon OpenSearch Service の料金表」を参照してください。
CurrencyCode FixedPriceRecurringChargeAmount の通貨。

この次の例では、予約を購入します。

aws opensearch purchase-reserved-instance-offering --reserved-instance-offering-id 1a2a3a4a5-1a2a-3a4a-5a6a-1a2a3a4a5a6a --reservation-name my-reservation --instance-count 3 --region us-east-1 { "ReservationName": "my-reservation", "ReservedInstanceId": "9a8a7a6a-5a4a-3a2a-1a0a-9a8a7a6a5a4a" }

最後に、以下の例を使用して特定のリージョンの予約をリストできます。

aws opensearch describe-reserved-instances --region us-east-1 { "ReservedInstances": [ { "FixedPrice": x, "ReservedInstanceOfferingId": "1a2a3a4a5-1a2a-3a4a-5a6a-1a2a3a4a5a6a", "ReservationName": "my-reservation", "PaymentOption": "PARTIAL_UPFRONT", "UsagePrice": 0.0, "ReservedInstanceId": "9a8a7a6a-5a4a-3a2a-1a0a-9a8a7a6a5a4a", "RecurringCharges": [ { "RecurringChargeAmount": y, "RecurringChargeFrequency": "Hourly" } ], "State": "payment-pending", "StartTime": 1522872571.229, "InstanceCount": 3, "Duration": 31536000, "InstanceType": "m4.2xlarge.search", "CurrencyCode": "USD" } ] }
注記

StartTime は Unix エポック時間 (1970 年 1 月 1 日の午前 00:00 UTC から経過した秒数)。たとえば、1522872571 エポック時間は 2018 年 4 月 4 日の 20:09:31 UTC です。オンラインコンバーターを使用することができます。

前の例で使用されているコマンドの詳細については、AWS CLI コマンドリファレンスを参照してください。

リザーブドインスタンスを購入する (AWS SDK)

AWS SDK (Android および iOS SDK を除く) は、「Amazon OpenSearch Service API リファレンス」に定義されているすべてのオペレーションをサポートします。これには、次も含まれます。

  • DescribeReservedInstanceOfferings

  • PurchaseReservedInstanceOffering

  • DescribeReservedInstances

このサンプルスクリプトは、AWS SDK for Python (Boto3) の OpenSearchService 低レベル Python クライアントを使用して、リザーブドインスタンスを購入します。instance_type の値を指定する必要があります。

import boto3 from botocore.config import Config # Build the client using the default credential configuration. # You can use the CLI and run 'aws configure' to set access key, secret # key, and default region. my_config = Config( # Optionally lets you specify a region other than your default. region_name='us-east-1' ) client = boto3.client('opensearch', config=my_config) instance_type = '' # e.g. m4.2xlarge.search def describe_RI_offerings(client): """Gets the Reserved Instance offerings for this account""" response = client.describe_reserved_instance_offerings() offerings = (response['ReservedInstanceOfferings']) return offerings def check_instance(offering): """Returns True if instance type is the one you specified above""" if offering['InstanceType'] == instance_type: return True return False def get_instance_id(): """Iterates through the available offerings to find the ID of the one you specified""" instance_type_iterator = filter( check_instance, describe_RI_offerings(client)) offering = list(instance_type_iterator) id = offering[0]['ReservedInstanceOfferingId'] return id def purchase_RI_offering(client): """Purchase Reserved Instances""" response = client.purchase_reserved_instance_offering( ReservedInstanceOfferingId = get_instance_id(), ReservationName = 'my-reservation', InstanceCount = 1 ) print('Purchased reserved instance offering of type ' + instance_type) print(response) def main(): """Purchase Reserved Instances""" purchase_RI_offering(client)

AWS SDK のインストールと使用の詳細については、「AWS Software Development Kits」を参照してください。

コストを確認する

Cost Explorer は、過去 13 か月間の使用量データを表示できる無料のツールです。このデータを分析すると、傾向を見分けて、RI がユースケースに合うかどうかを理解できます。既に RI がある場合、[購入オプション] によってグループ分けし、償却コストを表示してその使用量とオンデマンドインスタンスの使用量を比較できます。また、使用状況の予算を設定して、予約を活用していることを確認することもできます。詳細については、AWS Billing ユーザーガイドの「Cost Explorer によるコストの分析」を参照してください。