Amazon GameLift 的操作、资源和条件键 - 服务授权参考
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

Amazon GameLift 的操作、资源和条件键

Amazon GameLift(服务前缀:gamelift)提供以下服务特定的资源、操作和条件上下文键以在 IAM 权限策略中使用。

参考:

Amazon GameLift 定义的操作

您可以在 IAM policy 语句的 Action 元素中指定以下操作。可以使用策略授予在 Amazon 中执行操作的权限。您在策略中使用一项操作时,通常使用相同的名称允许或拒绝对 API 操作或 CLI 命令的访问。但在某些情况下,单一动作可控制对多项操作的访问。还有某些操作需要多种不同的动作。

操作表的资源类型列指示每项操作是否支持资源级权限。如果该列没有任何值,您必须在策略语句的 Resource 元素中指定策略应用的所有资源(“*”)。通过在 IAM policy 中使用条件来筛选访问权限,以控制是否可以在资源或请求中使用特定标签键。如果操作具有一个或多个必需资源,则调用方必须具有使用这些资源来使用该操作的权限。必需资源在表中以星号 (*) 表示。如果您在 IAM policy 中使用 Resource 元素限制资源访问权限,则必须为每种必需的资源类型添加 ARN 或模式。某些操作支持多种资源类型。如果资源类型是可选的(未指示为必需),则可以选择使用一种可选资源类型。

操作表的条件键列包括可以在策略语句的 Condition 元素中指定的键。有关与服务资源关联的条件键的更多信息,请参阅资源类型表的条件键列。

注意

资源条件键在资源类型表中列出。您可以在操作表的资源类型(* 为必需)列中找到应用于某项操作的资源类型的链接。资源类型表中的资源类型包括条件密钥列,这是应用于操作表中操作的资源条件键。

有关下表中各列的详细信息,请参阅操作表

操作 描述 访问级别 资源类型(* 为必需) 条件键 相关操作
AcceptMatch 授予权限以注册玩家是接受还是拒绝建议的 FlexMatch 对战 Write
ClaimGameServer 授予权限以查找并保留游戏服务器来托管新的游戏会话 Write

gameServerGroup*

CreateAlias 授予权限以为队组定义新别名 Write

aws:RequestTag/${TagKey}

aws:TagKeys

gamelift:TagResource

CreateBuild 授予权限以使用存储在 Amazon S3 存储桶中的文件创建新的游戏生成包 Write

aws:RequestTag/${TagKey}

aws:TagKeys

gamelift:TagResource

iam:PassRole

s3:GetObject

CreateFleet 授予权限以创建新的计算资源队组来运行您的游戏服务器 Write

aws:RequestTag/${TagKey}

aws:TagKeys

ec2:DescribeRegions

gamelift:TagResource

iam:PassRole

CreateFleetLocations 授予权限以为队组指定其他位置 Write

fleet*

ec2:DescribeRegions

CreateGameServerGroup 授予权限以创建新的游戏服务器组,设置相应的 Auto Scaling 组并启动实例以托管游戏服务器 Write

aws:RequestTag/${TagKey}

aws:TagKeys

autoscaling:CreateAutoScalingGroup

autoscaling:DescribeAutoScalingGroups

autoscaling:PutLifecycleHook

autoscaling:PutScalingPolicy

ec2:DescribeAvailabilityZones

ec2:DescribeSubnets

events:PutRule

events:PutTargets

gamelift:TagResource

iam:PassRole

CreateGameSession 授予权限以在指定队组上启动新的游戏会话 Write
CreateGameSessionQueue 授予权限以设置新队组来处理游戏会话放置请求 Write

aws:RequestTag/${TagKey}

aws:TagKeys

gamelift:TagResource

CreateLocation 授予权限以为实例集定义新位置 Write

aws:RequestTag/${TagKey}

aws:TagKeys

gamelift:TagResource

CreateMatchmakingConfiguration 授予权限以创建新的 FlexMatch 对战 Write

aws:RequestTag/${TagKey}

aws:TagKeys

gamelift:TagResource

CreateMatchmakingRuleSet 授予权限以为 FlexMatch 创建新的对战规则 Write

aws:RequestTag/${TagKey}

aws:TagKeys

gamelift:TagResource

CreatePlayerSession 授予权限以为一个玩家保留可用的游戏会话位置 Write
CreatePlayerSessions 授予权限以为多个玩家保留可用的游戏会话位置 Write
CreateScript 授予创建新的 Realtime Servers 脚本的权限 Write

aws:RequestTag/${TagKey}

aws:TagKeys

gamelift:TagResource

iam:PassRole

s3:GetObject

CreateVpcPeeringAuthorization 授予权限以允许 GameLift 创建或删除 GameLift 机群 VPC 与其他 Amazon Web Services 账户 上 VPC 之间的对等连接 Write

ec2:AcceptVpcPeeringConnection

ec2:AuthorizeSecurityGroupEgress

ec2:AuthorizeSecurityGroupIngress

ec2:CreateRoute

ec2:DeleteRoute

ec2:DescribeRouteTables

ec2:DescribeSecurityGroups

ec2:RevokeSecurityGroupEgress

ec2:RevokeSecurityGroupIngress

CreateVpcPeeringConnection 授予权限以在您的 GameLift 队组 VPC 与其他账户上的 VPC 之间建立对等连接。 Write
DeleteAlias 授予权限以删除别名 Write

alias*

DeleteBuild 授予权限以删除游戏生成包 Write

build*

DeleteFleet 授予权限以删除空队组 Write

fleet*

DeleteFleetLocations 授予权限以删除队组位置 Write

fleet*

DeleteGameServerGroup 授予权限以永久删除游戏服务器组并终止相应 Auto Scaling 组的 FleetIQ 活动 Write

gameServerGroup*

autoscaling:DeleteAutoScalingGroup

autoscaling:DescribeAutoScalingGroups

autoscaling:ExitStandby

autoscaling:ResumeProcesses

autoscaling:SetInstanceProtection

autoscaling:UpdateAutoScalingGroup

DeleteGameSessionQueue 授予权限以删除现有游戏会话队列 Write

gameSessionQueue*

DeleteLocation 授予权限以删除位置 Write

location*

DeleteMatchmakingConfiguration 授予权限以删除现有 FlexMatch 对战 Write

matchmakingConfiguration*

DeleteMatchmakingRuleSet 授予权限以删除现有 FlexMatch 对战规则 Write

matchmakingRuleSet*

DeleteScalingPolicy 授予权限以删除一组自动伸缩规则 Write

fleet*

DeleteScript 授予权限以删除 Realtime Servers 脚本 Write

script*

DeleteVpcPeeringAuthorization 授予权限以取消 VPC 对等授权 Write
DeleteVpcPeeringConnection 授予权限以删除 VPC 之间的对等连接 Write
DeregisterCompute 授予权限以对实例集取消注册计算 Write

fleet*

DeregisterGameServer 授予权限以从游戏服务器组中删除游戏服务器 Write

gameServerGroup*

DescribeAlias 授予权限以检索别名属性 Read

alias*

DescribeBuild 授予权限以检索游戏生成包属性 Read

build*

DescribeCompute 授予权限以检索计算的常规属性,例如 ARN、实例集详细信息、SDK 端点和位置 Read

fleet*

DescribeEC2InstanceLimits 授予权限以检索 EC2 实例类型允许的最大和当前使用量 Read
DescribeFleetAttributes 授予权限以检索队组的常规属性,包括状态 Read
DescribeFleetCapacity 授予权限以检索队组的当前容量设置 Read
DescribeFleetEvents 授予权限以从队组的事件日志中检索条目 Read

fleet*

DescribeFleetLocationAttributes 授予权限以检索队组位置的常规属性,包括状态 Read

fleet*

DescribeFleetLocationCapacity 授予权限以检索队组位置的当前容量设置 Read

fleet*

DescribeFleetLocationUtilization 授予权限以检索队组位置的利用率统计信息 Read

fleet*

DescribeFleetPortSettings 授予权限以检索队组的入站连接权限 Read

fleet*

DescribeFleetUtilization 授予权限以检索队组的利用率统计信息 Read
DescribeGameServer 授予权限以检索游戏服务器的属性 Read

gameServerGroup*

DescribeGameServerGroup 授予权限以检索游戏服务器组的属性 Read

gameServerGroup*

DescribeGameServerInstances 授予权限以检索游戏服务器组中 EC2 实例的状态 Read

gameServerGroup*

DescribeGameSessionDetails 授予权限以检索队组中游戏会话的属性,包括保护策略 Read
DescribeGameSessionPlacement 授予权限以检索游戏会话放置请求的详细信息 Read
DescribeGameSessionQueues 授予权限以检索游戏会话队列的属性 Read
DescribeGameSessions 授予权限以检索队组中游戏会话的属性 Read
DescribeInstances 授予权限以检索有关队组中实例的信息 Read

fleet*

DescribeMatchmaking 授予权限以检索对战门票的详细信息 Read
DescribeMatchmakingConfigurations 授予权限以检索 FlexMatch 对战的属性 Read
DescribeMatchmakingRuleSets 授予权限以检索 FlexMatch 对战规则的属性 Read
DescribePlayerSessions 授予权限以检索游戏会话中玩家会话的属性 Read
DescribeRuntimeConfiguration 授予权限以检索队组的当前运行配置 Read

fleet*

DescribeScalingPolicies 授予权限以检索应用于队组的所有伸缩策略 Read

fleet*

DescribeScript 授予权限以检索 Realtime Servers 脚本的属性 Read

script*

DescribeVpcPeeringAuthorizations 授予权限以检索有效的 VPC 对等授权 Read
DescribeVpcPeeringConnections 授予权限以检索活动或待处理 VPC 对等连接的详细信息 Read
GetComputeAccess 授予权限以检索计算的访问凭证 Read

fleet*

GetComputeAuthToken 授予权限以检索计算和实例集的授权令牌,以便在游戏服务器进程中使用 Read

fleet*

GetGameSessionLogUrl 授予权限以检索游戏会话的存储日志位置 Read
GetInstanceAccess 授予权限以请求远程访问指定队组实例 Read

fleet*

ListAliases 授予权限以检索当前区域中定义的所有别名 List
ListBuilds 授予权限以检索当前区域中的所有游戏生成包 List
ListCompute 授予权限以检索当前区域中的所有计算资源 List

fleet*

ListFleets 授予权限以检索当前区域中所有实例集的实例集 ID 列表 List
ListGameServerGroups 授予权限以检索当前区域中定义的所有游戏服务器组 List
ListGameServers 授予权限以检索当前在游戏服务器组中运行的所有游戏服务器 List

gameServerGroup*

ListLocations 授予权限以检索此账户中的所有位置 List
ListScripts 授予权限以检索当前区域中所有 Realtime Servers 脚本的属性 List
ListTagsForResource 授予权限以检索 GameLift 资源的标签 Read

alias

build

fleet

gameServerGroup

gameSessionQueue

location

matchmakingConfiguration

matchmakingRuleSet

script

PutScalingPolicy 授予权限以创建或更新队组自动伸缩策略 Write

fleet*

RegisterCompute 授予权限以对实例集注册计算 Write

fleet*

RegisterGameServer 授予权限以在新的游戏服务器准备好托管游戏时通知 GameLift FleetIQ Write

gameServerGroup*

RequestUploadCredentials 授予权限以检索在上传新游戏生成包时使用的全新上传凭证 Read

build*

ResolveAlias 授予权限以检索与别名关联的队组 ID Read

alias*

ResumeGameServerGroup 授予权限以恢复游戏服务器组的暂停 FleetIQ 活动 Write

gameServerGroup*

SearchGameSessions 授予权限以检索匹配一组搜索标准的游戏会话 Read
StartFleetActions 授予权限以恢复通过 StopFleetActions 暂停的队组自动伸缩活动 () Write

fleet*

StartGameSessionPlacement 授予权限以向游戏会话队列发送游戏会话放置请求 Write

gameSessionQueue*

StartMatchBackfill 授予权限以请求 FlexMatch 对战填充现有游戏会话中的可用玩家位置 Write
StartMatchmaking 授予权限以请求为一个或一组玩家进行 FlexMatch 对战匹配并启动游戏会话放置 Write
StopFleetActions 授予权限以暂停队组的自动伸缩活动 Write

fleet*

StopGameSessionPlacement 授予权限以取消正在进行的游戏会话放置请求 Write
StopMatchmaking 授予权限以取消正在进行的对战匹配或对战回填请求 Write
SuspendGameServerGroup 授予权限以暂时停止游戏服务器组的 FleetIQ 活动 Write

gameServerGroup*

TagResource 授予权限以标记 GameLift 资源 Tagging

alias

build

fleet

gameServerGroup

gameSessionQueue

location

matchmakingConfiguration

matchmakingRuleSet

script

aws:RequestTag/${TagKey}

aws:TagKeys

UntagResource 授予权限以取消标记 GameLift 资源 Tagging

alias

build

fleet

gameServerGroup

gameSessionQueue

location

matchmakingConfiguration

matchmakingRuleSet

script

aws:TagKeys

UpdateAlias 授予权限以更新现有别名的属性 Write

alias*

UpdateBuild 授予权限以更新现有生成包的元数据 Write

build*

UpdateFleetAttributes 授予权限以更新现有队组的常规属性 Write

fleet*

UpdateFleetCapacity 授予权限以调整队组的容量设置 Write

fleet*

UpdateFleetPortSettings 授予权限以调整队组的端口设置 Write

fleet*

UpdateGameServer 授予权限以更改游戏服务器属性、运行状况或利用率状态 Write

gameServerGroup*

UpdateGameServerGroup 授予权限以更新游戏服务器组的属性,包括允许的实例类型 Write

gameServerGroup*

iam:PassRole

UpdateGameSession 授予权限以更新现有游戏会话的属性 Write
UpdateGameSessionQueue 授予权限以更新现有游戏会话队列的属性 Write

gameSessionQueue*

UpdateMatchmakingConfiguration 授予权限以更新现有 FlexMatch 对战配置的属性 Write

matchmakingConfiguration*

UpdateRuntimeConfiguration 授予权限以更新如何在现有队组的实例上配置服务器进程 Write

fleet*

UpdateScript 授予权限以更新现有 Realtime Servers 脚本的元数据和内容 Write

script*

iam:PassRole

s3:GetObject

ValidateMatchmakingRuleSet 授予权限以验证 FlexMatch 对战规则的语法 Read

Amazon GameLift 定义的资源类型

以下资源类型是由该服务定义的,可以在 IAM 权限策略语句的 Resource 元素中使用这些资源类型。操作表中的每个操作指定了可以使用该操作指定的资源类型。您也可以在策略中包含条件键,从而定义资源类型。这些键显示在资源类型表的最后一列。有关下表中各列的详细信息,请参阅资源类型表

资源类型 ARN 条件键
alias arn:${Partition}:gamelift:${Region}::alias/${AliasId}

aws:ResourceTag/${TagKey}

build arn:${Partition}:gamelift:${Region}:${Account}:build/${BuildId}

aws:ResourceTag/${TagKey}

fleet arn:${Partition}:gamelift:${Region}:${Account}:fleet/${FleetId}

aws:ResourceTag/${TagKey}

gameServerGroup arn:${Partition}:gamelift:${Region}:${Account}:gameservergroup/${GameServerGroupName}

aws:ResourceTag/${TagKey}

gameSessionQueue arn:${Partition}:gamelift:${Region}:${Account}:gamesessionqueue/${GameSessionQueueName}

aws:ResourceTag/${TagKey}

location arn:${Partition}:gamelift:${Region}:${Account}:location/${LocationId}

aws:ResourceTag/${TagKey}

matchmakingConfiguration arn:${Partition}:gamelift:${Region}:${Account}:matchmakingconfiguration/${MatchmakingConfigurationName}

aws:ResourceTag/${TagKey}

matchmakingRuleSet arn:${Partition}:gamelift:${Region}:${Account}:matchmakingruleset/${MatchmakingRuleSetName}

aws:ResourceTag/${TagKey}

script arn:${Partition}:gamelift:${Region}:${Account}:script/${ScriptId}

aws:ResourceTag/${TagKey}

Amazon GameLift 的条件键

Amazon GameLift 定义了以下条件键,可用于 Condition 策略的 IAM policy 元素。您可以使用这些键进一步细化应用策略语句的条件。有关下表中各列的详细信息,请参阅条件键表

要查看适用于所有服务的全局条件键,请参阅可用的全局条件键

条件键 描述 类型
aws:RequestTag/${TagKey} 按请求中传递的标签筛选访问权限 字符串
aws:ResourceTag/${TagKey} 按与资源关联的标签筛选访问权限 字符串
aws:TagKeys 按请求中传递的标签键筛选访问权限 字符串数组