

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

# AWS PCS 的 Amazon EC2 Spot 角色
<a name="spot-role"></a>

如果您想要建立使用 **Spot** 作為其購買選項的 AWS PCS 運算節點群組，您還必須在 中擁有 **AWSServiceRoleForEC2Spot** 服務連結角色 AWS 帳戶。您可以使用下列 AWS CLI 命令來建立角色。如需詳細資訊，請參閱*AWS Identity and Access Management 《 使用者指南*》中的[建立服務連結角色](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create-service-linked-role.html)和[建立角色以委派許可給 AWS 服務](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html)。

```
aws iam create-service-linked-role --aws-service-name spot.amazonaws.com
```

**注意**  
 如果您的 AWS 帳戶 已有 IAM `AWSServiceRoleForEC2Spot` 角色，則會收到下列錯誤。  

```
  An error occurred (InvalidInput) when calling the CreateServiceLinkedRole operation: Service role name AWSServiceRoleForEC2Spot has been taken in this account, please try a different suffix.
```