

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 在 Snowball Edge AWS Security Token Service 上使用
<a name="using-sts"></a>

The AWS Security Token Service (AWS STS) 可協助您為 IAM 使用者請求暫時、有限權限的登入資料。

**重要**  
若要讓 AWS 服務在 Snowball Edge 上正常運作，您必須允許服務的連接埠。如需詳細資訊，請參閱[Snowball Edge 上 AWS 服務的連接埠需求](port-requirements.md)。

**Topics**
+ [在 Snowball Edge 上使用 AWS CLI 和 API 操作](#local-sts-specify-region)
+ [Snowball Edge 上支援的 AWS STSAWS CLI 命令](#local-sts-cli-commands)
+ [Snowball Edge 上支援的 AWS STS API 操作](#sts-local-supported-apis)

## 在 Snowball Edge 上使用 AWS CLI 和 API 操作
<a name="local-sts-specify-region"></a>

使用 AWS CLI 或 API 操作在 Snowball Edge 裝置上發出 IAM AWS STS、Amazon S3 和 Amazon EC2 命令時，您必須將 指定`region`為「」`snow`。 您可以使用 `AWS configure`或在命令本身內執行此操作，如下列範例所示。

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

或

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

**注意**  
在 上本機使用的存取金鑰 ID 和存取私密金鑰 AWS Snowball 邊緣 無法與 中的金鑰互換 AWS 雲端。

## Snowball Edge 上支援的 AWS STSAWS CLI 命令
<a name="local-sts-cli-commands"></a>

在本機僅支援 [assume-role](https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role.html) 命令。

`assume-role` 支援下列參數：
+ `role-arn`
+ `role-session-name`
+ `duration-seconds`

### 在 Snowball Edge 上擔任角色的範例命令
<a name="local-sts-cli-example"></a>

若要擔任角色，請使用下列命令。

```
    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`命令的詳細資訊，請參閱[如何使用 擔任 IAM 角色 AWS CLI？](https://aws.amazon.com/premiumsupport/knowledge-center/iam-assume-role-cli) 

如需使用 的詳細資訊 AWS STS，請參閱《*IAM 使用者指南*》中的[使用暫時安全登入](https://docs.aws.amazon.com/STS/latest/UsingSTS/)資料。

## Snowball Edge 上支援的 AWS STS API 操作
<a name="sts-local-supported-apis"></a>

在本機僅支援 [AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) API。

`AssumeRole` 支援下列參數：
+ `RoleArn`
+ `RoleSessionName`
+ `DurationSeconds`

**Example 擔任角色**  

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