

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

# 使用 AWS RAM 共用 S3 on Outposts
<a name="outposts-sharing-with-ram"></a>

Amazon S3 on Outposts 支援使用 AWS Resource Access Manager ([AWS RAM](https://docs.aws.amazon.com/ram/latest/userguide/what-is.html))，在組織內的多個帳戶之間共用 S3 容量。透過 S3 on Outposts 共用，您可以允許其他人在您的 Outpost 上建立和管理儲存貯體、端點和存取點。

本主題示範如何使用 AWS RAM，與您 AWS 組織中的另一個 AWS 帳戶共用 S3 on Outposts。

## 必要條件
<a name="outposts-ram-prereqs"></a>
+ Outpost 擁有者帳戶已在 AWS Organizations 中設定組織。如需詳細資訊，請參閱《AWS Organizations 使用者指南》**中的[建立組織](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_create.html)。
+ 組織包括您希望與其共用 S3 on Outposts 容量的 AWS 帳戶。如需詳細資訊，請參閱《AWS Organizations 使用者指南》**中的[傳送邀請給 AWS 帳戶](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_invites.html#orgs_manage_accounts_invite-account)。
+ 選取您要共用的下列選項之一。必須選取第二個資源 (**子網路**或 **Outposts**)，才能存取端點。端點是要存取存放在 S3 on Outposts 上的資料時的一項網路要求。    
[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/AmazonS3/latest/s3-outposts/outposts-sharing-with-ram.html)

## 程序
<a name="outposts-ram-procedure"></a>

1. 使用擁有 Outpost 的 AWS 帳戶 登入AWS 管理主控台，然後開啟 AWS RAM 主控台：[https://console.aws.amazon.com/ram/home](https://console.aws.amazon.com/ram/home)。

1. 確定您已在 AWS RAM 中啟用與 AWS Organizations 共用。如需詳細資訊，請參閱《AWS RAM 使用者指南》**中的[在 AWS Organizations 中啟用資源共用](https://docs.aws.amazon.com/ram/latest/userguide/getting-started-sharing.html#getting-started-sharing-orgs)。

1. 使用[先決條件](#outposts-ram-prereqs)中的選項 1 或選項 2 建立資源共享。如果您有多個 S3 on Outposts 資源，請選取要共用的資源的 Amazon Resource Name (ARN)。若要啟用端點，請共用您的子網路或 Outpost。

   如需如何建立資源共用的資訊，請參閱《AWS RAM 使用者指南》**中的[建立資源共用](https://docs.aws.amazon.com/ram/latest/userguide/getting-started-sharing.html#getting-started-sharing-create)。

1. 您與其共用資源的 AWS 帳戶現在應該能夠使用 S3 on Outposts。根據您在[先決條件](#outposts-ram-prereqs)中選取的選項，請向帳戶使用者提供下列資訊：    
[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/AmazonS3/latest/s3-outposts/outposts-sharing-with-ram.html)

**注意**  
使用者可以使用 AWS RAM 主控台、AWS Command Line Interface (AWS CLI)、AWS SDK 或 REST API 來確認資源已與他們共用。使用者可以使用 [get-resource-shares](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ram/get-resource-shares.html) CLI 命令來查看其現有資源共用。

## 使用範例
<a name="outposts-ram-examples"></a>

在您與另一個帳戶共用您的 S3 on Outposts 資源後，該帳戶可以管理您的 Outpost 上的儲存貯體和物件。如果您共用 **Subnets (子網路)** 資源，那麼該帳戶可以使用您建立的端點。下列範例示範使用者如何使用 AWS CLI，在您共用這些資源後與 Outpost 互動。

**Example ：建立儲存貯體**  
下列範例會在 Outpost `{{op-01ac5d28a6a232904}}` 上建立名為 {{amzn-s3-demo-bucket1}} 的儲存貯體。在使用此命令之前，請將每個 `{{user input placeholder}}` 取代為適合您的使用案例的值。  

```
aws s3control create-bucket --bucket {{{{amzn-s3-demo-bucket1}}}} --outpost-id {{op-01ac5d28a6a232904}}
```
如需此命令的詳細資訊，請參閱 *AWS CLI 參考*中的 [create-bucket](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3control/create-bucket.html)。

**Example ：建立存取點**  
下列範例會使用下表中的範例參數，在 Outpost 上建立存取點。在使用此命令之前，請將這些 `{{user input placeholder}}` 值和 AWS 區域 程式碼取代為適合您的使用案例的值。  


| **參數** | **值**： | 
| --- | --- | 
| 帳戶 ID | {{111122223333}} | 
| 存取點名稱 | {{example-outpost-access-point}} | 
| Outpost ID | {{op-01ac5d28a6a232904}} | 
| Outpost 儲存貯體名稱 | {{amzn-s3-demo-bucket1}} | 
| VPC ID | {{vpc-1a2b3c4d5e6f7g8h9}} | 
帳戶 ID 參數必須是儲存貯體擁有者 (共用使用者) 的 AWS 帳戶 ID。

```
aws s3control create-access-point --account-id {{111122223333}} --name {{example-outpost-access-point}} \
--bucket arn:aws:s3-outposts:{{us-east-1}}:{{111122223333}}:outpost/{{op-01ac5d28a6a232904}}/bucket/{{{{amzn-s3-demo-bucket1}}}} \
--vpc-configuration VpcId={{vpc-1a2b3c4d5e6f7g8h9}}
```
如需此命令的相關詳細資訊，請參閱 *AWS CLI 參考*中的 [create-access-point](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3control/create-access-point.html)。

**Example ：上傳物件**  
下列範例會透過由 AWS 帳戶 {{`111122223333`}} 擁有之 Outpost {{`op-01ac5d28a6a232904`}} 上的存取點 {{`example-outpost-access-point`}}，從使用者的本機檔案系統上傳檔案 {{`my_image.jpg`}} 到名為 {{`images/my_image.jpg`}} 的物件。在使用此命令之前，請將這些 `{{user input placeholder}}` 值和 AWS 區域 代碼取代為適合您的使用案例的值。  

```
aws s3api put-object --bucket arn:aws:s3-outposts:{{us-east-1}}:{{111122223333}}:outpost/{{op-01ac5d28a6a232904}}/accesspoint/{{example-outpost-access-point}} \
--body {{my_image.jpg}} --key {{images/my_image.jpg}}
```
如需此命令的詳細資訊，請參閱 *AWS CLI 參考*中的 [put-object](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/put-object.html)。  
如果此操作導致 Resource not found (找不到資源) 錯誤或無回應，則您的 VPC 可能沒有共用端點。  
若要檢查是否存在共享端點，請使用 [list-shared-endpoints](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3outposts/list-shared-endpoints.html) AWS CLI 命令。如果沒有共享端點，請與 Outpost 擁有者合作建立一個端點。如需詳細資訊，請參閱 *Amazon Simple Storage Service API 參考*中的 [ListSharedEndpoints](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListSharedEndpoints.html)。

**Example ：建立端點**  
下列範例在共用 Outpost 上建立端點。在使用此命令之前，請將 Outpost ID、子網路 ID 和安全群組 ID 的 `{{user input placeholder}}` 值取代為適合您的使用案例的值。  
使用者只有在資源共用包含 **Outposts** 資源時，才能執行此操作。

```
aws s3outposts create-endpoint --outposts-id {{op-01ac5d28a6a232904}} --subnet-id {{XXXXXX}} --security-group-id {{XXXXXXX}}
```
如需此命令的詳細資訊，請參閱 *AWS CLI 參考*中的 [create-endpoint](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3outposts/create-endpoint.html)。