通过使用 Amazon RAM 共享 S3 on Outposts - Amazon Simple Storage Service
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

通过使用 Amazon RAM 共享 S3 on Outposts

Amazon S3 on Outposts 支持通过使用 Amazon Resource Access Manager (Amazon RAM) 跨一个企业内的多个账户共享 S3 容量。借助 S3 on Outposts 共享,您可以允许其他人在您的 Outpost 上创建和管理存储桶、端点和访问点。

本主题演示如何使用 Amazon RAM 与您的 Amazon 企业中的另一个 Amazon Web Services 账户 共享 S3 on Outposts 和相关资源。

先决条件

  • Outpost 拥有者账户在 Amazon Organizations 中配置了一个企业。有关更多信息,请参阅 Amazon Organizations 用户指南中的创建企业

  • 该企业包括您想与之共享 S3 on Outposts 容量的 Amazon Web Services 账户。有关更多信息,请参阅 Amazon Organizations 用户指南中的向 Amazon Web Services 账户 发送邀请

  • 请选择要共享的以下选项之一。必须选择第二个资源(Subnets(子网)或 Outposts),以便端点也可供访问。端点是网络要求,以便访问 S3 on Outposts 中存储的数据。

    选项 1 选项 2

    S3 on Outposts

    允许用户在您的 Outposts 和访问点上创建存储桶,并将对象添加到这些存储桶。

    Subnets (子网)

    允许用户使用您的 Virtual Private Cloud (VPC) 和与您的子网关联的端点。

    S3 on Outposts

    允许用户在您的 Outposts 和访问点上创建存储桶,并将对象添加到这些存储桶。

    Outposts

    允许用户查看 S3 容量图表和 Amazon Outposts 控制台主页。还允许用户在共享的 Outposts 上创建子网并创建端点。

程序

  1. 使用拥有 Outpost 的 Amazon Web Services 账户登录到 Amazon Web Services Management Console,然后打开 Amazon RAM 控制台,地址为 https://console.aws.amazon.com/ram

  2. 确保您已在 Amazon RAM 中启用与 Amazon Organizations 共享。有关更多信息,请参阅 Amazon RAM 用户指南中的在 Amazon Organizations 中启用资源共享

  3. 使用先决条件中的选项 1 或选项 2 创建资源共享。如果您有多个 S3 on Outposts 资源,请选择要共享的资源的 Amazon 资源名称 (ARN)。要启用端点,请共享您的子网或 Outpost。

    有关如何创建资源共享的更新信息,请参阅 Amazon RAM 用户指南中的创建资源共享

  4. 您与之共享资源的 Amazon Web Services 账户 现在应该能够使用 S3 on Outposts 了。根据您在先决条件中选择的选项,向账户用户提供以下信息:

    选项 1 选项 2

    Outpost ID

    VPC ID

    子网 ID

    安全组 ID

    Outpost ID

注意

用户可以使用 Amazon RAM 控制台、Amazon Command Line Interface (Amazon CLI)、Amazon SDK 或 REST API 确认已与他们共享资源。用户可以使用 get-resource-shares CLI 命令查看他们的现有资源共享。

用法示例

在您与另一个账户共享 S3 on Outposts 资源后,该账户可以管理 Outpost 上的存储桶和对象。如果您共享了 Subnets(子网)资源,那么该账户可以使用您创建的端点。以下示例演示了用户如何使用 Amazon CLI 在您共享这些资源后与您的 Outpost 互动。

例 :创建存储桶

以下示例在 Outpost op-01ac5d28a6a232904 上创建名为 DOC-EXAMPLE-BUCKET1 的存储桶。在使用此命令之前,请针对您的使用案例将每个 user input placeholder 替换为适合的值。

aws s3control create-bucket --bucket DOC-EXAMPLE-BUCKET1 --outpost-id op-01ac5d28a6a232904

有关此命令的更多信息,请参阅《Amazon CLI 命令参考》中的 create-bucket

例 :创建访问点

以下示例使用下表中的示例参数在 Outpost 上创建访问点。在使用此命令之前,请针对您的使用案例将这些 user input placeholder 值和 Amazon Web Services 区域 代码替换为适合的值。

参数
账户 ID 111122223333
访问点名称 example-outpost-access-point
Outpost ID op-01ac5d28a6a232904
Outpost 存储桶名称 DOC-EXAMPLE-BUCKET1
VPC ID vpc-1a2b3c4d5e6f7g8h9
注意

账户 ID 参数必须是存储桶拥有者的 Amazon Web Services 账户 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/DOC-EXAMPLE-BUCKET1 \ --vpc-configuration VpcId=vpc-1a2b3c4d5e6f7g8h9

有关此命令的更多信息,请参阅《Amazon CLI 参考》中的 create-access-point

例 :上传对象

以下示例将通过 Amazon 账户 111122223333 拥有的 Outpost op-01ac5d28a6a232904 上的访问点 example-outpost-access-point,将文件 my_image.jpg 从用户的本地文件系统上传到名为 images/my_image.jpg 的对象。在使用此命令之前,请针对您的使用案例将这些 user input placeholder 值和 Amazon Web Services 区域 代码替换为适合的值。

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

有关此命令的更多信息,请参阅《Amazon CLI 参考》中的 put-object

注意

如果此操作导致未找到资源错误或无响应,则您的 VPC 可能没有共享端点。

要检查是否存在共享端点,请使用 list-shared-endpoints Amazon CLI 命令。如果没有共享端点,请与 Outpost 拥有者合作创建一个。有关更多信息,请参阅《Amazon Simple Storage Service API 参考》中的 ListSharedEndpoints

例 :创建端点

以下示例在共享的 Outpost 上创建端点。在使用此命令之前,请针对您的使用案例将 Outpost ID、子网 ID 和安全组 ID 的 user input placeholder 值替换为适合的值。

注意

只有在资源共享中包含 Outposts 资源时,用户才可以执行此操作。

aws s3outposts create-endpoint --outposts-id op-01ac5d28a6a232904 --subnet-id XXXXXX --security-group-id XXXXXXX

有关此命令的更多信息,请参阅《Amazon CLI 参考》中的 create-endpoint