Weitere ähnliche Inhalte
Ähnlich wie AWS IoT Coreを オンプレミス環境と使う際の アーキテクチャ例 (AWS IoT Deep Dive #5) (20)
Mehr von Amazon Web Services Japan (20)
AWS IoT Coreを オンプレミス環境と使う際の アーキテクチャ例 (AWS IoT Deep Dive #5)
- 1. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
2021/9/15
AWS IoT Coreを
オンプレミス環境と使う際の
アーキテクチャ例
- 2. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
⾃⼰紹介
名前︓
市川 純(いちかわ じゅん)
所属︓
アマゾン ウェブ サービス ジャパン株式会社
デジタルトランスフォーメーション本部
プロトタイピング ソリューション アーキテクト
担当︓
IoTに関係するプロトタイピングやお客様の⽀援
- 3. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アジェンダ
• AWS IoT CoreのVPCエンドポイントGAについて
• AWS IoT CoreのVPCエンドポイントの登場によって
作れるようになったアーキテクチャ
• まとめ
この内容は、2021年8月時点の情報がベースとなっております
- 4. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS IoT Coreの
VPC エンドポイント
GAについて
- 5. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• 2021年7⽉にGA
• https://aws.amazon.com/jp/about-aws/whats-new/2021/07/aws-iot-core-supports-vpc-
endpoints/
• AWS PrivateLinkを利⽤してデータエンドポイントの利⽤が可能に
• VPCから外部に出ずに直接AWS IoT Coreのエンドポイントが利⽤可能
• 閉域環境でAWS IoT Coreを利⽤したいユースケースの対応が楽に
- 6. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
新たにできる様になったこと
VPCエンドポイント経由のアクセスのみを許可するIoT Policyが利⽤できる
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iot:Connect"
],
"Resource": [
"arn:aws:iot:us-east-1:123456789012:client/${iot:Connection.Thing.ThingName}"
],
"Condition": {
"StringEquals": {
"aws:SourceVpce": "vpce-1a2b3c4d"
}
}
}
]
}
https://docs.aws.amazon.com/iot/latest/developerguide/IoTCore-VPC.html#Control-VPC-access
- 7. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
制限事項
• IoT Dataエンドポイントのみに対応
• https://docs.aws.amazon.com/general/latest/gr/iot-core.html#iot-core-data-plane-endpoints
• MQTTのkeep aliveは最⼤230secに制限されます
• 通常は30sec – 1200sec
• VPCエンドポイントごとに10万同時接続(hard limit)に対応します
• 超える場合は⾃分でDNSレコードを登録し負荷分散させます
• https://docs.aws.amazon.com/iot/latest/developerguide/IoTCore-VPC.html#Scaling-VPC-endpoints
• IP v4のみに対応
• カスタムドメインを除き、Amazon Trust Servicesで発⾏された証明書を利⽤したエンドポイ
ントのみ対応
• aws iot describe-endpoint --endpoint-type iot:Data-ATS で確認
• VPCエンドポイントポリシーに対応していない
• VPC エンドポイントが利⽤できるAZの確認が必要
• aws ec2 describe-vpc-endpoint-services --service-names com.amazonaws.[region].iot.data
• その他のAWS IoT Core VPC エンドポイントの制限を確認してください
• https://docs.aws.amazon.com/iot/latest/developerguide/IoTCore-VPC.html#VPC-limitations
- 8. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VPCエンドポイントを利⽤するアーキテクチャでは、
通常のパブリックエンドポイントを使う場合とで、
複雑になり考慮するべきことが増えます
どうしてもという要件がない限りは、
パブリックエンドポイントの利⽤を
おすすめします
- 9. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IoT CoreのVPC エンドポイントの
登場によって、作れるようになった
アーキテクチャ
- 10. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アーキテクチャの種類
• 基本
• Network Load Balancer + Proxy
• VPC Endpoint
• Static IP
• AWS Site-to-Site VPN + AWS Transit Gateway
• AWS Direct Connect + AWS Transit Gateway
IoT CoreのVPCエンドポイントを利用しないパターンについても紹介します
- 11. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
基本
AWS IoT Core
IoT thing
- 12. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
考慮が必要な点
• パブリックなネットワークへの接続ができない要件では利⽤できない
ただし、可能な限りこの構成をおすすめします
- 13. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Public subnet B
Public subnet A
Network Load Balancer + Proxy
AWS IoT Core
VPC
Availability Zone 1 Availability Zone 2
Internet gateway
Network Load
Balancer
IoT thing
Elastic IP
address
Corporate
data center
EC2(Proxy) EC2(Proxy)
- 14. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
考慮が必要な点
• どのプロキシを利⽤するか
• HTTP Proxy, Socks5, NGINX streaming proxy, etc
• 接続可能なデバイス数は、Proxyインスタンスの性能に依存する
• デバイスのアプリケーションがProxyに対応している必要がある
• 構成要素が増えるため、検討事項や運⽤コストが増加する
VPCエンドポイントの登場前によく利⽤されたパターンですが、今後はVPCエンド
ポイントの利⽤を検討してください。
- 15. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
VPC エンドポイント
AWS IoT Core
VPC
Private subnet A Private subnet B
Availability Zone 1 Availability Zone 2
Customer gateway
Corporate
data center
AWS Direct Connect
VPC Endpoint VPC Endpoint
Public subnet A Public subnet B
IoT thing
VPN connection
- 16. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
考慮が必要な点
• IoT Dataエンドポイントのみに対応
• https://docs.aws.amazon.com/general/latest/gr/iot-core.html#iot-core-data-plane-endpoints
• MQTTのkeep aliveは最⼤230secに制限されます
• 通常は30sec – 1200sec
• VPCエンドポイントごとに10万同時接続(hard limit)に対応します
• 超える場合は⾃分でDNSレコードを登録し負荷分散させます
• https://docs.aws.amazon.com/iot/latest/developerguide/IoTCore-VPC.html#Scaling-VPC-endpoints
• IP V4のみに対応
• カスタムドメインを除き、Amazon Trust Servicesで発⾏された証明書を利⽤したエンドポイ
ントのみ対応
• aws iot describe-endpoint --endpoint-type iot:Data-ATS で確認
• VPCエンドポイントポリシーに対応していない
• VPC エンドポイントが利⽤できるAZの確認が必要
• aws ec2 describe-vpc-endpoint-services --service-names com.amazonaws.[region].iot.data
• その他のAWS IoT Core VPC エンドポイントの制限を確認してください
• https://docs.aws.amazon.com/iot/latest/developerguide/IoTCore-VPC.html#VPC-limitations
• 構成要素が増えるため、検討事項や運⽤コストが増加する
- 17. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Static IP
AWS IoT Core
VPC
Private subnet A Private subnet B
Availability Zone 1 Availability Zone 2
Internet gateway
VPC Endpoint VPC Endpoint
Internet
Network Load
Balancer
Public subnet A Public subnet B
IoT thing
Elastic IP
address
Firewall
Corporate
data center
注意: iot.example.comのように
カスタムドメインを利⽤してアクセスする。
NLBのEIPをこのドメインのアドレスに指定
Amazon Route 53
特定のIPのみ許可
されているFW
- 18. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
考慮が必要な点
• VPCエンドポイントと同様の制限がある
• カスタムドメインの利⽤が必須
• NLB⾃体にセキュリティーグループが設定できない
• 固定のパブリックIPを利⽤するため、不正なリクエストでもAWS IoT Coreま
での経路が課⾦対象となってしまう
• AWS Shield Advancedの利⽤など検討
• https://docs.aws.amazon.com/waf/latest/developerguide/ddos-overview.html
• 構成要素が増えるため、検討事項や運⽤コストが増加する
- 19. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Site-to-Site VPN + AWS Transit Gateway
AWS Transit Gateway
AWS Site-to-Site VPN
AWS IoT Core
Private subnet C Private subnet D
Public subnet A Public subnet B
VPC
Private subnet A Private subnet B
Availability Zone 1 Availability Zone 2
Internet gateway
NAT gateway
Customer gateway
Corporate
data center
NAT gateway
IoT thing
- 20. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
考慮が必要な点
• NAT Gatewayの制限を確認する必要あり
• https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-
basics
• MQTTのkeep aliveは最⼤350secに制限されます
• NAT Gatewayの制限
• https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-troubleshooting.html#nat-
gateway-troubleshooting-timeout
• 構成要素が増えるため、検討事項や運⽤コストが増加する
- 21. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Direct Connect(専有型) + AWS Transit Gateway
AWS Transit Gateway
AWS IoT Core
Private subnet C Private subnet D
Public subnet A Public subnet B
VPC
Private subnet A Private subnet B
Availability Zone 1 Availability Zone 2
Internet gateway
Customer gateway
Corporate
data center
AWS Direct Connect
注意: ”専有型”とは、「専有接続」および、「選ばれたAPNパートナーに限り提供し
ているAWS の承認を受けた 1Gbps から 10Gbps の容量を提供するホスト型接続」
を指します
https://aws.amazon.com/jp/blogs/news/aws-transit-gateway-with-shared-
directconnect/
IoT thing
NAT gateway NAT gateway
- 22. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
考慮が必要な点
• Transit Gatewayを利⽤できるDirect Connectの種類がある
• Transit Gatewayの制限を確認する必要あり
• https://docs.aws.amazon.com/ja_jp/vpc/latest/tgw/transit-gateway-quotas.html
• NAT Gatewayの制限を確認する必要あり
• https://docs.aws.amazon.com/ja_jp/vpc/latest/userguide/vpc-nat-gateway.html#nat-
gateway-basics
• MQTTのkeep aliveは最⼤350secに制限されます
• NAT Gatewayの制限
• https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-troubleshooting.html#nat-
gateway-troubleshooting-timeout
• 構成要素が増えるため、検討事項や運⽤コストが増加する
- 23. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アーキテクチャによって利⽤できるAWS IoT Coreの機能
利⽤したい機能 基本
VPC
エンドポイント
Static IP
Transit
Gateway
Proxy
メッセージのPub/Sub OK OK OK OK OK
device shadowの利⽤ OK OK OK OK OK
Fleet Provisioningを使った証明書の発⾏ OK OK OK OK *2
Jobsの利⽤(MQTT topic経由) OK OK OK OK *2
Credential Providerの利⽤ OK NG NG OK *2
コントロールプレーン API エンドポイント OK NG NG OK *2
Jobデータプレーン API エンドポイント OK NG NG OK *2
Secure Tunneling API エンドポイント OK*1 NG NG OK*1 *2
*1: Secure Tunnelingでトンネルを開いての通信も可能
*2: Proxyの設定次第
- 24. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
- 25. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
• AWS IoT Core VPCエンドポイントの登場で、スマートファクトリーの様な
ユースケースでブロッカーとなった閉域環境でのアーキテクチャが作りやす
くなった
• 全てのIoTユースケースを解決してくれるものではない
• ニーズに合わせて適切なアーキテクチャを検討し、性能を満たすかを確認す
ること
- 26. © 2021, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!