View a markdown version of this page

第 2 步:创建 Systems Manager 云连接器 - AWS Systems Manager

第 2 步:创建 Systems Manager 云连接器

设置 AWS Config 连接器后,您需要创建 Systems Manager 云连接器。Systems Manager 云连接器会存储 Azure 租户和订阅配置,并将其链接至 AWS Config 连接器。

创建 Systems Manager 云连接器
  1. 运行如下命令。请将占位符值分别替换为您的 Azure 租户 ID、Systems Manager 应用程序(客户端)ID、订阅 ID、Systems Manager Azure 联合身份验证角色 ARN 和第 1 步中的 AWS Config 连接器 ARN。

    运行此命令之前,请先创建联合身份验证角色。

    运行此命令之前,--role-arn 所标识的 Systems Manager Azure 联合身份验证角色必须已存在。其信任策略还必须允许 Systems Manager 服务主体(ssm.amazonaws.com)代入该角色。AWS CLI 和 API 不会为您创建此角色。如果任一要求未得到满足,命令会失败。错误消息为 ValidationException: Nonexistent role or missing ssm service principal in trust policy。先使用 Azure 联合身份验证角色 中的信任和权限策略创建角色。使用在 Azure 先决条件 中为联合身份验证凭证主题所使用的相同角色名称和 ARN。

    aws ssm create-cloud-connector \ --display-name "MyAzureConnector" \ --configuration '{ "AzureConfiguration": { "TenantId": "TENANT_ID", "ApplicationId": "SSM_APP_CLIENT_ID", "Targets": { "Subscriptions": [ {"Id": "SUBSCRIPTION_ID"} ] } } }' \ --role-arn "arn:aws:iam::ACCOUNT_ID:role/service-role/SSM-AzureRole-CONNECTOR_NAME" \ --config-connector-arn CONFIG_CONNECTOR_ARN

    要针对租户中的所有订阅(租户级设置),请省略配置中的 Targets 字段。

    该响应返回 CloudConnectorId。请记下此值以供未来操作使用。

  2. 验证云连接器是否创建成功:

    aws ssm get-cloud-connector \ --cloud-connector-id CLOUD_CONNECTOR_ID