

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

# レガシーサブスクリプションルーター
<a name="legacy-subscription-router-component"></a>

レガシーサブスクリプションルータ (`aws.greengrass.LegacySubscriptionRouter`) は、Greengrass コアデバイスのサブスクリプションを管理します。サブスクリプションは、Lambda 関数がコアデバイスで MQTT メッセージングに使用できるトピックを定義する AWS IoT Greengrass V1 の機能です。詳細については、「*AWS IoT Greengrass V1 デベロッパーガイド*」の「[Managed subscriptions in the MQTT messaging workflow](https://docs.aws.amazon.com/greengrass/v1/developerguide/gg-sec.html#gg-msg-workflow)」を参照してください。

このコンポーネントを使用して、 AWS IoT Greengrass Core SDK を使用するコネクタコンポーネントと Lambda 関数コンポーネントのサブスクリプションを有効にできます。

**注記**  <a name="legacy-subscription-router-requirement-note"></a>
レガシーサブスクリプションルーターコンポーネントは、Lambda 関数が AWS IoT Greengrass Core SDK で `publish()`関数を使用する場合にのみ必要です。 AWS IoT Device SDK V2 でプロセス間通信 (IPC) インターフェイスを使用するように Lambda 関数コードを更新する場合、レガシーサブスクリプションルーターコンポーネントをデプロイする必要はありません。詳細については、次の[プロセス間通信](interprocess-communication.md)サービスを参照してください。  
[ローカルメッセージをパブリッシュ/サブスクライブする](ipc-publish-subscribe.md)
[AWS IoT Core MQTT メッセージを発行/サブスクライブする](ipc-iot-core-mqtt.md)

**Topics**
+ [バージョン](#legacy-subscription-router-component-versions)
+ [タイプ](#legacy-subscription-router-component-type)
+ [オペレーティングシステム](#legacy-subscription-router-component-os-support)
+ [要件](#legacy-subscription-router-component-requirements)
+ [依存関係](#legacy-subscription-router-component-dependencies)
+ [設定](#legacy-subscription-router-component-configuration)
+ [ローカルログファイル](#legacy-subscription-router-component-log-file)
+ [変更ログ](#legacy-subscription-router-component-changelog)

## バージョン
<a name="legacy-subscription-router-component-versions"></a>

このコンポーネントには、次のバージョンがあります。
+ 2.1.x
+ 2.0.x

## タイプ
<a name="legacy-subscription-router-component-type"></a>

<a name="public-component-type-generic"></a>この<a name="public-component-type-generic-phrase"></a>コンポーネントはジェネリックコンポーネント (`aws.greengrass.generic`) です。[Greengrass nucleus](greengrass-nucleus-component.md) は、コンポーネントのライフサイクルスクリプトを実行します。

<a name="public-component-type-more-information"></a>詳細については、「[コンポーネントタイプ](develop-greengrass-components.md#component-types)」を参照してください。

## オペレーティングシステム
<a name="legacy-subscription-router-component-os-support"></a>

このコンポーネントは、Linux コアデバイスにのみインストールできます。

## 要件
<a name="legacy-subscription-router-component-requirements"></a>

このコンポーネントには次の要件があります。
+ レガシーサブスクリプションルーターは、VPC での実行がサポートされています。

## 依存関係
<a name="legacy-subscription-router-component-dependencies"></a>

コンポーネントをデプロイすると、 は互換性のあるバージョンの依存関係 AWS IoT Greengrass もデプロイします。つまり、コンポーネントを正常にデプロイするには、コンポーネントとその依存関係のすべての要件を満たす必要があります。このセクションでは、このコンポーネントの[リリースされたバージョン](#legacy-subscription-router-component-changelog)の依存関係と、各依存関係に対するコンポーネントのバージョンを定義するセマンティックバージョン制約をリスト表示しています。コンポーネントの各バージョンの依存関係は、[AWS IoT Greengrass コンソール](https://console.aws.amazon.com//greengrass)でも確認できます。コンポーネントの詳細ページで **[Dependencies]** (依存関係) リストを確認します。

------
#### [ 2.1.15 ]

次の表に、このコンポーネントのバージョン 2.1.15 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.17.0 | ソフト | 

------
#### [ 2.1.14 ]

次の表に、このコンポーネントのバージョン 2.1.14 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.16.0 | ソフト | 

------
#### [ 2.1.13 ]

次の表に、このコンポーネントのバージョン 2.1.13 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.15.0 | ソフト | 

------
#### [ 2.1.12 ]

次の表に、このコンポーネントのバージョン 2.1.12 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.14.0 | ソフト | 

------
#### [ 2.1.11 ]

次の表に、このコンポーネントのバージョン 2.1.11 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.13.0 | ソフト | 

------
#### [ 2.1.10 ]

次の表に、このコンポーネントのバージョン 2.1.10 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.12.0 | ソフト | 

------
#### [ 2.1.9 ]

次の表に、このコンポーネントのバージョン 2.1.9 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.11.0 | ソフト | 

------
#### [ 2.1.8 ]

次の表に、このコンポーネントのバージョン 2.1.8 に関する依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.10.0 | ソフト | 

------
#### [ 2.1.7 ]

次の表に、このコンポーネントのバージョン 2.1.7 に関する依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.9.0 | ソフト | 

------
#### [ 2.1.6 ]

次の表に、このコンポーネントのバージョン 2.1.6 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.8.0 | ソフト | 

------
#### [ 2.1.5 ]

次の表に、このコンポーネントのバージョン 2.1.5 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.7.0 | ソフト | 

------
#### [ 2.1.4 ]

次の表に、このコンポーネントのバージョン 2.1.4 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.6.0 | ソフト | 

------
#### [ 2.1.3 ]

次の表に、このコンポーネントのバージョン 2.1.3 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.5.0 | ソフト | 

------
#### [ 2.1.2 ]

次の表に、このコンポーネントのバージョン 2.1.2 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.4.0 | ソフト | 

------
#### [ 2.1.1 ]

次の表に、このコンポーネントのバージョン 2.1.1 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.3.0 | ソフト | 

------
#### [ 2.1.0 ]

次の表に、このコンポーネントのバージョン 2.1.0 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.0 <2.2.0 | ソフト | 

------
#### [ 2.0.3 ]

次の表に、このコンポーネントのバージョン 2.0.3 の依存関係を示します。


| 依存関係 | 互換性のあるバージョン | 依存関係タイプ | 
| --- | --- | --- | 
| [Greengrass nucleus](greengrass-nucleus-component.md) | >=2.0.3 <2.1.0 | ソフト | 

------

コンポーネントの依存関係の詳細については、「[コンポーネント recipe のリファレンス](component-recipe-reference.md#recipe-reference-component-dependencies)」を参照してください。

## 設定
<a name="legacy-subscription-router-component-configuration"></a>

このコンポーネントには、コンポーネントのデプロイ時にカスタマイズできる次の設定パラメータが用意されています。

------
#### [ v2.1.x ]

`subscriptions`  
<a name="legacy-subscription-router-component-configuration-subscriptions-intro"></a>(オプション) コアデバイスで有効にするサブスクリプション。これはオブジェクトで、各キーは一意の ID であり、各値はそのコネクタのサブスクリプションを定義するオブジェクトです。V1 コネクタコンポーネントまたは AWS IoT Greengrass Core SDK を使用する Lambda 関数をデプロイするときに、サブスクリプションを設定する必要があります。  
各サブスクリプションオブジェクトには、次の情報が含まれます:    
`id`  <a name="legacy-subscription-router-component-configuration-subscription-id"></a>
このサブスクリプションの一意の ID。この ID は、このサブスクリプションオブジェクトのキーと一致する必要があります。  
`source`  
Core AWS IoT Greengrass SDK を使用して、 で指定したトピックに MQTT メッセージを発行する Lambda 関数`subject`。次のいずれかを指定します。  
+ <a name="legacy-subscription-router-component-configuration-subscription-source-target-component-name"></a>コアデバイスでの Lambda 関数コンポーネントの名前。**component:com.example.HelloWorldLambda** などの `component:` プレフィックスを付けてコンポーネント名を指定します。
+ <a name="legacy-subscription-router-component-configuration-subscription-source-target-function-arn"></a>コアデバイスの Lambda 関数の Amazon リソースネーム (ARN)。
**重要**  <a name="legacy-subscription-router-function-version-requirement"></a>
Lambda 関数のバージョンが変更された場合は、関数の新しいバージョンでサブスクリプションを設定する必要があります。これを怠ると、バージョンがサブスクリプションと一致しないうちは、このコンポーネントはメッセージをルーティングしません。  
インポートする関数のバージョンが含まれた Amazon リソースネーム (ARN) を指定する必要があります。`$LATEST` のようなバージョンエイリアスは使用できません。
V1 コネクタコンポーネントのサブスクリプションをデプロイするには、コンポーネントの名前またはコネクタコンポーネントの Lambda 関数の ARN を指定します。  
`subject`  <a name="legacy-subscription-router-component-configuration-subscription-subject"></a>
ソースとターゲットがメッセージを発行および受信できる MQTT トピックまたはトピックフィルター。この値は `+` および `#` トピックのワイルドカードをサポートしています。  
`target`  
<a name="legacy-subscription-router-component-configuration-subscription-target-intro"></a>`subject` で指定したトピックに関する MQTT メッセージを受信するターゲット。サブスクリプションは、 `source`関数がコアデバイスの Lambda 関数 AWS IoT Core に対して MQTT メッセージを発行することを指定します。次のいずれかを指定します。  
+ <a name="legacy-subscription-router-component-configuration-subscription-target-cloud"></a>`cloud`。 `source` 関数は MQTT メッセージを に発行します AWS IoT Core。
+ <a name="legacy-subscription-router-component-configuration-subscription-source-target-component-name"></a>コアデバイスでの Lambda 関数コンポーネントの名前。**component:com.example.HelloWorldLambda** などの `component:` プレフィックスを付けてコンポーネント名を指定します。
+ <a name="legacy-subscription-router-component-configuration-subscription-source-target-function-arn"></a>コアデバイスの Lambda 関数の Amazon リソースネーム (ARN)。
**重要**  <a name="legacy-subscription-router-function-version-requirement"></a>
Lambda 関数のバージョンが変更された場合は、関数の新しいバージョンでサブスクリプションを設定する必要があります。これを怠ると、バージョンがサブスクリプションと一致しないうちは、このコンポーネントはメッセージをルーティングしません。  
インポートする関数のバージョンが含まれた Amazon リソースネーム (ARN) を指定する必要があります。`$LATEST` のようなバージョンエイリアスは使用できません。
デフォルト: サブスクリプションなし

**Example 設定更新の例 (サブスクリプションの定義 AWS IoT Core)**  
次の例では、`com.example.HelloWorldLambda`Lambda 関数コンポーネントが`hello/world`トピック AWS IoT Core の に MQTT メッセージを発行することを指定します。  

```
{
  "subscriptions": {
    "Greengrass_HelloWorld_to_cloud": {
      "id": "Greengrass_HelloWorld_to_cloud",
      "source": "component:com.example.HelloWorldLambda",
      "subject": "hello/world",
      "target": "cloud"
    }
  }
}
```

**Example 設定更新の例 (別の Lambda 関数に対するサブスクリプションの定義)**  
以下の例は、`com.example.HelloWorldLambda` Lambda 関数コンポーネントが `com.example.MessageRelay` Lambda 関数コンポーネントに `hello/world` トピックに関する MQTT メッセージを公開することを指定します。  

```
{
  "subscriptions": {
    "Greengrass_HelloWorld_to_MessageRelay": {
      "id": "Greengrass_HelloWorld_to_MessageRelay",
      "source": "component:com.example.HelloWorldLambda",
      "subject": "hello/world",
      "target": "component:com.example.MessageRelay"
    }
  }
}
```

------
#### [ v2.0.x ]

`subscriptions`  
<a name="legacy-subscription-router-component-configuration-subscriptions-intro"></a>(オプション) コアデバイスで有効にするサブスクリプション。これはオブジェクトで、各キーは一意の ID であり、各値はそのコネクタのサブスクリプションを定義するオブジェクトです。V1 コネクタコンポーネントまたは AWS IoT Greengrass Core SDK を使用する Lambda 関数をデプロイするときに、サブスクリプションを設定する必要があります。  
各サブスクリプションオブジェクトには、次の情報が含まれます:    
`id`  <a name="legacy-subscription-router-component-configuration-subscription-id"></a>
このサブスクリプションの一意の ID。この ID は、このサブスクリプションオブジェクトのキーと一致する必要があります。  
`source`  
Core AWS IoT Greengrass SDK を使用して、 で指定したトピックに MQTT メッセージを発行する Lambda 関数`subject`。次を指定します:  
+ <a name="legacy-subscription-router-component-configuration-subscription-source-target-function-arn"></a>コアデバイスの Lambda 関数の Amazon リソースネーム (ARN)。
**重要**  <a name="legacy-subscription-router-function-version-requirement"></a>
Lambda 関数のバージョンが変更された場合は、関数の新しいバージョンでサブスクリプションを設定する必要があります。これを怠ると、バージョンがサブスクリプションと一致しないうちは、このコンポーネントはメッセージをルーティングしません。  
インポートする関数のバージョンが含まれた Amazon リソースネーム (ARN) を指定する必要があります。`$LATEST` のようなバージョンエイリアスは使用できません。
V1 コネクタコンポーネントのサブスクリプションをデプロイするには、コネクタコンポーネントの Lambda 関数の ARN を指定します。  
`subject`  <a name="legacy-subscription-router-component-configuration-subscription-subject"></a>
ソースとターゲットがメッセージを発行および受信できる MQTT トピックまたはトピックフィルター。この値は `+` および `#` トピックのワイルドカードをサポートしています。  
`target`  
<a name="legacy-subscription-router-component-configuration-subscription-target-intro"></a>`subject` で指定したトピックに関する MQTT メッセージを受信するターゲット。サブスクリプションは、 `source`関数がコアデバイスの Lambda 関数 AWS IoT Core に対して MQTT メッセージを発行することを指定します。次のいずれかを指定します。  
+ <a name="legacy-subscription-router-component-configuration-subscription-target-cloud"></a>`cloud`。 `source` 関数は MQTT メッセージを に発行します AWS IoT Core。
+ <a name="legacy-subscription-router-component-configuration-subscription-source-target-function-arn"></a>コアデバイスの Lambda 関数の Amazon リソースネーム (ARN)。
**重要**  <a name="legacy-subscription-router-function-version-requirement"></a>
Lambda 関数のバージョンが変更された場合は、関数の新しいバージョンでサブスクリプションを設定する必要があります。これを怠ると、バージョンがサブスクリプションと一致しないうちは、このコンポーネントはメッセージをルーティングしません。  
インポートする関数のバージョンが含まれた Amazon リソースネーム (ARN) を指定する必要があります。`$LATEST` のようなバージョンエイリアスは使用できません。
デフォルト: サブスクリプションなし

**Example 設定更新の例 (サブスクリプションの定義 AWS IoT Core)**  
次の例では、 `Greengrass_HelloWorld`関数が `hello/world`トピックで MQTT メッセージを AWS IoT Core に発行することを指定します。  

```
"subscriptions": {
  "Greengrass_HelloWorld_to_cloud": {
    "id": "Greengrass_HelloWorld_to_cloud",
    "source": "arn:aws:lambda:us-west-2:123456789012:function:Greengrass_HelloWorld:5",
    "subject": "hello/world",
    "target": "cloud"
  }
}
```

**Example 設定更新の例 (別の Lambda 関数に対するサブスクリプションの定義)**  
以下の例は、`Greengrass_HelloWorld` 関数が `Greengrass_MessageRelay` に `hello/world` トピックに関する MQTT メッセージを公開することを指定します。  

```
"subscriptions": {
  "Greengrass_HelloWorld_to_MessageRelay": {
    "id": "Greengrass_HelloWorld_to_MessageRelay",
    "source": "arn:aws:lambda:us-west-2:123456789012:function:Greengrass_HelloWorld:5",
    "subject": "hello/world",
    "target": "arn:aws:lambda:us-west-2:123456789012:function:Greengrass_MessageRelay:5"
  }
}
```

------

## ローカルログファイル
<a name="legacy-subscription-router-component-log-file"></a>

このコンポーネントはログを出力しません。

## 変更ログ
<a name="legacy-subscription-router-component-changelog"></a>

次の表は、コンポーネントの各バージョンにおける変更を示します。


|  バージョン  |  変更  | 
| --- | --- | 
| 2.1.16 | Greengrass nucleus バージョン 2.17.0 リリースのコンポーネントバージョンを更新します。 | 
| 2.1.15 | Greengrass nucleus バージョン 2.16.0 リリース用にバージョンが更新されました。 | 
| 2.1.14 | Greengrass nucleus バージョン 2.15.0 のリリース用にバージョンが更新されました。 | 
| 2.1.13 | Greengrass nucleus バージョン 2.14.0 のリリース用にバージョンが更新されました。 | 
| 2.1.12 | Greengrass nucleus バージョン 2.13.0 のリリース用にバージョンが更新されました。 | 
| 2.1.11 | Greengrass nucleus バージョン 2.12.0 のリリース用にバージョンが更新されました。 | 
| 2.1.10 | Greengrass nucleus バージョン 2.11.0 のリリース用にバージョンが更新されました。 | 
| 2.1.9 | Greengrass nucleus バージョン 2.10.0 のリリース用にバージョンが更新されました。 | 
| 2.1.8 | Greengrass nucleus バージョン 2.9.0 のリリース用にバージョンが更新されました。 | 
| 2.1.7 | Greengrass nucleus バージョン 2.8.0 のリリース用にバージョンが更新されました。 | 
| 2.1.6 | Greengrass nucleus バージョン 2.7.0 のリリース用にバージョンが更新されました。 | 
| 2.1.5 | Greengrass nucleus バージョン 2.6.0 のリリース用にバージョンが更新されました。 | 
| 2.1.4 | Greengrass nucleus バージョン 2.5.0 のリリース用にバージョンが更新されました。 | 
| 2.1.3 | Greengrass nucleus バージョン 2.4.0 のリリース用にバージョンが更新されました。 | 
| 2.1.2 | Greengrass nucleus バージョン 2.3.0 のリリース用にバージョンが更新されました。 | 
| 2.1.1 | Greengrass nucleus バージョン 2.2.0 のリリース用にバージョンが更新されました。 | 
| 2.1.0 |  <a name="changelog-legacy-subscription-router-2.1.0"></a>[See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/greengrass/v2/developerguide/legacy-subscription-router-component.html)  | 
| 2.0.3 | 当初のバージョン | 