本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
AWS 访问控制和 IAM
AWS Device Farm 允许您使用 AWS Identity and Access Management (IAM) 创建策略,以授予或限制对 Device Farm 功能的访问权限。要在 AWS Device Farm 中使用 VPC 连接功能,您用于访问 AWS Device Farm 的用户账户或角色需要以下 IAM policy:
- JSON
-
-
{
"Version":"2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"devicefarm:*",
"ec2:DescribeVpcs",
"ec2:DescribeSubnets",
"ec2:DescribeSecurityGroups",
"ec2:CreateNetworkInterface"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": "iam:CreateServiceLinkedRole",
"Resource": "arn:aws:iam::*:role/aws-service-role/devicefarm.amazonaws.com/AWSServiceRoleForDeviceFarm",
"Condition": {
"StringLike": {
"iam:AWSServiceName": "devicefarm.amazonaws.com"
}
}
}
]
}
要创建或更新具有 VPC 配置的 Device Farm 项目,您的 IAM policy 必须允许您对 VPC 配置中列出的资源调用以下操作:
"ec2:DescribeVpcs"
"ec2:DescribeSubnets"
"ec2:DescribeSecurityGroups"
"ec2:CreateNetworkInterface"
此外,您的 IAM policy 还必须允许创建服务相关角色:
"iam:CreateServiceLinkedRole"
在项目中不使用 VPC 配置的用户不需要这些权限。