使用 Amazon Security Token Service - Amazon Snowball Edge 开发者指南
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

使用 Amazon Security Token Service

Amazon Security Token Service (Amazon STS) 可帮助您为用户申请具有有限权限的临时凭证。

重要

要使 Amazon 服务在 Snowball Edge 上正常工作,您必须允许服务的端口。有关详细信息,请参阅在 Amazon Snowball Edge 设备上使用 Amazon 服务所需的端口

在 Snowball Edge 上使用 Amazon CLI 和 API 操作

在使用 Amazon CLI 或 API 操作在 Snowball Edge 设备上发出 IAM、Amazon STS、Amazon S3 和 Amazon EC2 命令时,必须将 region 指定为“snow”。您可以使用 Amazon configure 或在命令本身中执行此操作,如以下示例所示。

aws configure --profile snowballEdge Amazon Access Key ID [None]: defgh Amazon Secret Access Key [None]: 1234567 Default region name [None]: snow Default output format [None]: json

或者

aws iam list-users --profile snowballEdge --endpoint http://192.0.2.0:6078 --region snow
注意

在 Amazon Snowball Edge 上本地使用的访问密钥 ID 和访问机密密钥无法与 Amazon Web Services 云 云中的密钥互换。

Snowball Edge 上支持的 Amazon STSAmazon CLI 命令的列表

在本地仅支持 assume-role 命令。

对于 assume-role,支持以下参数:

  • role-arn

  • role-session-name

  • duration-seconds

示例命令

要代入角色,请使用以下命令。

aws sts assume-role --role-arn "arn:aws:iam::123456789012:role/example-role" --role-session-name AWSCLI-Session --endpoint http://snow-device-IP-address:7078

有关使用 assume-role 命令的更多信息,请参阅如何使用 Amazon CLI 代入 IAM 角色?

有关使用 Amazon STS 的更多信息,请参阅《IAM 用户指南》中的使用临时安全凭证

支持的 Amazon STS API 操作

在本地仅支持 AssumeRole API。

对于 AssumeRole,支持以下参数:

  • RoleArn

  • RoleSessionName

  • DurationSeconds

示例

要代入角色,请使用以下命令。

https://sts.amazonaws.com/ ?Version=2011-06-15 &Action=AssumeRole &RoleSessionName=session-example &RoleArn=arn:aws:iam::123456789012:role/demo &DurationSeconds=3600