离开资源共享 - Amazon Resource Access Manager
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

离开资源共享

如果您不再需要访问与您共享的资源,则可以随时保留资源共享。当您离开资源共享时,您将失去对共享资源的访问权限。

退出资源共享的前提条件

  • 只有资源共享是以个人身份与您共享的,而不是在组织环境中共享的Amazon Web Services 账户,您才能离开该共享。如果您的组织Amazon Web Services 账户内部人员将您添加到资源共享并且启用了与Amazon Organizations共享,则无法离开资源共享。自动访问组织内的资源共享。

  • 要离开资源共享,请验证资源共享是否为空或仅包含支持离开共享的资源类型。

    以下是唯一支持退出资源共享的资源类型。

    服务 资源类型

    Amazon Aurora

    rds:Cluster

    Amazon EC2

    ec2:CapacityReservation

    ec2:DedicatedHost

    Amazon License Manager

    license-manager:LicenseConfiguration

    Amazon Outposts

    ec2:LocalGatewayRouteTable

    outposts:Outpost

    outposts:Site

    Amazon Route 53

    route53resolver:ResolverRule

    Amazon VPC

    ec2:CoipPool

    ec2:PrefixList

    ec2:Subnet

    ec2:TrafficMirrorTarget

    ec2:TransitGateway

    ec2:TransitGatewayMulticastDomain

如何退出资源共享

Console
离开资源共享
  1. 导航到Amazon RAM控制台中的 “与我共享:资源共享” 页面。

  2. 由于Amazon RAM资源共享是特定的Amazon Web Services 区域,因此请Amazon Web Services 区域从控制台右上角的下拉列表中选择相应的资源共享。要查看包含全球资源的资源共享,必须将设置Amazon Web Services 区域为美国东部(弗吉尼亚北部)、(us-east-1)。有关共享全球资源的更多信息,请参阅与全球资源相比,共享区域资源

  3. 选择要离开的资源共享。

  4. 选择 “离开资源共享”,然后在确认对话框中选择 “离开”。

Amazon CLI
离开资源共享

您可以使用disassociate-resource-share命令离开资源共享。

以下示例命令会导致调用Amazon Web Services 账户该命令的无法访问由 ARN 指定的资源共享共享的资源。您必须将请求定向到中Amazon Web Services 区域包含您要离开的资源共享的服务终端节点。

  1. 首先,检索资源共享列表以检索要离开的资源共享的 ARN。

    $ aws ram get-resource-shares \ --region us-east-1 \ --resource-owner OTHER-ACCOUNTS { "resourceShares": [ { "resourceShareArn": "arn:aws:ram:us-east-1:111111111111:resource-share/8b831ba0-63df-4608-be3c-19096b1ee16e", "name": "Prod Environment Shared Licenses", "owningAccountId": "111111111111", "allowExternalPrincipals": true, "status": "ACTIVE", "creationTime": "2021-09-21T08:50:41.308000-07:00", "lastUpdatedTime": "2021-09-21T08:50:41.308000-07:00", "featureSet": "STANDARD" } ] }
  2. 然后,您可以运行命令以离开该资源共享。请注意,您还必须将您的账户 ID 指定为委托人123456789012,以取消与指定资源共享(由账户111111111111共享)的关联。

    $ aws ram disassociate-resource-share \ --region us-east-1 \ --resource-share-arn arn:aws:ram:us-east-1:111111111111:resource-share/8b831ba0-63df-4608-be3c-19096b1ee16e \ --principals 123456789012 { "resourceShareAssociations": [ { "resourceShareArn": "arn:aws:ram:us-east-1:111111111111:resource-share/8b831ba0-63df-4608-be3c-19096b1ee16e", "associatedEntity": "123456789012", "associationType": "PRINCIPAL", "status": "DISASSOCIATING", "external": false } ] }