我们使用机器学习技术将英文博客翻译为简体中文。您可以点击导航栏中的“中文(简体)”切换到英文版本。
如何跨环境复制 亚马逊云科技 IoT SiteWise 资源
简介
在扩展
资产模型导出演练
亚马逊云科技 IoT SiteWise Tools 存储库中的实用程序使您可以灵活地仅复制特定用例所需的资源。您可以选择仅导出 亚马逊云科技 IoT SiteWise 资产模型,也可以导出相应的资产和 亚马逊云科技 IoT SiteWise Monitor 控制面板。导出工具可以从命令行手动使用(例如,将资产模型一次性导出到另一个环境),也可以集成到 CI/CD 部署场景的自动化管道中。该实用程序还可用于在同一账户中复制 亚马逊云科技 IoT SiteWise 资源以进行多区域部署。亚马逊云科技 IoT SiteWise Tools 存储库包含有关如何使用每个实用程序的详细文档,但为了对这些工具进行基本演示,我们创建了两个 数控机床 和 生产线 资产模型,如下 所示。每个模型都包含一个属性和两个模型之间的层次关系。
为了简单起见,我们只会导出模型。使用 亚马逊云科技 IoT SiteWise 导出工具,我们可以选择指定要从中导出模型的区域,并在不使用其他标志的情况下运行命令(如果您还想将资产与模型一起导出,则只需添加
-a、--
assets 标志)。命令输出将如下所示:
如果命令成功,CloudFormation 模板将保存到本地目录中名为 cfnexport 的文件夹中。在本示例中,CloudFormation 将如下所示:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "SiteWise Export",
"Resources": {
"CNCMachineResource": {
"Type": "AWS::IoTSiteWise::AssetModel",
"Properties": {
"AssetModelName": "CNC Machine",
"AssetModelProperties": [
{
"Name": "SpindleSpeed",
"DataType": "DOUBLE",
"Unit": "RPM",
"Type": {
"TypeName": "Measurement"
},
"LogicalId": "SpindleSpeed9f2e03dd"
}
],
"AssetModelHierarchies": []
}
},
"ProductionLineResource": {
"Type": "AWS::IoTSiteWise::AssetModel",
"Properties": {
"AssetModelName": "Production Line",
"AssetModelProperties": [
{
"Name": "Location",
"DataType": "STRING",
"Type": {
"TypeName": "Attribute",
"Attribute": {}
},
"LogicalId": "Locationafc85231"
}
],
"AssetModelHierarchies": [
{
"Name": "CNC Machines",
"ChildAssetModelId": {
"Ref": "CNCMachineResource"
},
"LogicalId": "CNCMachines"
}
]
}
}
}
}
这个 CloudFormation 模板现在可以在其他地区或其他 亚马逊云科技 账户启动,以创建我们上面定义的相同资产模型。
就是这样,现在您已经了解了导出实用程序的工作原理。在下一节中,我们将提供一个示例架构,说明如何将这些实用程序集成到您的 CI/CD 自动化管道中。
示例 CI/CD 架构
在本示例架构中,我们假设您现有的 CI/CD 管道可以使用 CloudFormation 和 亚马逊云科技 开发工具包部署 亚马逊云科技 服务。
构建
在架构的构建阶段,CI/CD 管道在源环境中启动
部署
在部署阶段,需要在目标环境中按特定顺序创建或修改 亚马逊云科技 IoT SiteWise 资源,即资产模型、资产和控制面板。为此,为每种资源类型定义了
创建堆栈后,CI/CD 管道的后续更新将使用工作流程和步骤函数来更新这些堆栈,这将修改和更新 亚马逊云科技 IoT SiteWise 资源。资产和控制面板状态将等待先前状态在CloudFormation中完成部署后再开始,因为它们需要这些资源存在才能创建。请查看下面的架构以获得可视化表现。
对于生产工作负载,客户可以在部署管道 中使用CloudFormation
结论
在这篇博客文章中,我们介绍了 用于在
作者简介
Sebastian Salomon
is a Sr IoT Data Architect with Amazon Web Services. He has 7+ years of experience in IoT architecture in different vertical like IIoT, Automotive, O&G, Smart Home, Smart City and Mining as well as data warehousing and big data platform. In the latest years he got focus in how to bring AI to IoT through scalable MLOps platforms. As a member of 亚马逊云科技 Professional Services, He works with customers of different scale and industries architecting and implementing a variety of end to end IoT solutions.
|
Ashok Padmanabhan
is a Sr. IoT Data architect with 亚马逊云科技 Professional services focusing on Big Data Analytics & industry 4.0 solutions in Manufacturing domain.
|
Mihai Lucaciu
, with over 16 years of experience, is a Senior IoT Data Architect at 亚马逊云科技 Professional Services, passionately helping customers with solution architectures, designs & implementations for various projects on industrial data, edge analytics and cloud services.
|
Tim Wilson
is an IoT Enablement Specialist with 亚马逊云科技’s Public Sector Partner organization. In this role Tim works with 亚马逊云科技 public sector partners to support their adoption and use of 亚马逊云科技 IoT services and solutions. He started at 亚马逊云科技 as a Solution Architect in 2012 when 亚马逊云科技’s Public Sector business was relatively small. He has also held roles at 亚马逊云科技 managing an IoT prototyping lab and as a technical presenter in the 亚马逊云科技 Executive Briefing Center.
|
*前述特定亚马逊云科技生成式人工智能相关的服务仅在亚马逊云科技海外区域可用,亚马逊云科技中国仅为帮助您发展海外业务和/或了解行业前沿技术选择推荐该服务。
Sebastian Salomon
is a Sr IoT Data Architect with Amazon Web Services. He has 7+ years of experience in IoT architecture in different vertical like IIoT, Automotive, O&G, Smart Home, Smart City and Mining as well as data warehousing and big data platform. In the latest years he got focus in how to bring AI to IoT through scalable MLOps platforms. As a member of 亚马逊云科技 Professional Services, He works with customers of different scale and industries architecting and implementing a variety of end to end IoT solutions.
Ashok Padmanabhan
is a Sr. IoT Data architect with 亚马逊云科技 Professional services focusing on Big Data Analytics & industry 4.0 solutions in Manufacturing domain.
Mihai Lucaciu
, with over 16 years of experience, is a Senior IoT Data Architect at 亚马逊云科技 Professional Services, passionately helping customers with solution architectures, designs & implementations for various projects on industrial data, edge analytics and cloud services.
Tim Wilson
is an IoT Enablement Specialist with 亚马逊云科技’s Public Sector Partner organization. In this role Tim works with 亚马逊云科技 public sector partners to support their adoption and use of 亚马逊云科技 IoT services and solutions. He started at 亚马逊云科技 as a Solution Architect in 2012 when 亚马逊云科技’s Public Sector business was relatively small. He has also held roles at 亚马逊云科技 managing an IoT prototyping lab and as a technical presenter in the 亚马逊云科技 Executive Briefing Center.