

# Setting up cross-account sharing for Amazon SageMaker AI partner AI apps
<a name="partner-app-resource-sharing-ram"></a>

Amazon SageMaker AI integrates with Amazon Resource Access Manager (Amazon RAM) to enable resource sharing. Amazon RAM is a service that enables you to share some Amazon SageMaker AI resources with other Amazon Web Services accounts or through Amazon Organizations. With Amazon RAM, you share resources that you own by creating a *resource share*. A resource share specifies the resources to share, and the consumers with whom to share them. Consumers can be specific Amazon Web Services accounts inside or outside of its organization in Amazon Organizations.

For more information about Amazon RAM, see the *[Amazon RAM User Guide](https://docs.amazonaws.cn/ram/latest/userguide/)*.

This topic explains how to share resources that you own, and how to use resources that are shared with you.

**Topics**
+ [Prerequisites for sharing an Amazon SageMaker Partner AI App](#partner-app-resource-sharing-ram-prereqs)
+ [Sharing an Amazon SageMaker Partner AI App](#partner-app-resource-sharing-share)
+ [Accepting resource share invitations](#partner-app-resource-sharing-responses)
+ [Identifying a shared Amazon SageMaker Partner AI App](#sharing-identify)
+ [Responsibilities and permissions for shared Amazon SageMaker Partner AI Apps](#sharing-perms)

## Prerequisites for sharing an Amazon SageMaker Partner AI App
<a name="partner-app-resource-sharing-ram-prereqs"></a>
+ To share an Amazon SageMaker Partner AI App, you must own it in your Amazon Web Services account. This means that the resource must be allocated or provisioned in your account. You cannot share an Amazon SageMaker Partner AI App that has been shared with you.
+ To share an Amazon SageMaker Partner AI App with your organization or an organizational unit in Amazon Organizations, you must enable sharing with Amazon Organizations. For more information, see [ Enable Sharing with Amazon Organizations](https://docs.amazonaws.cn/ram/latest/userguide/getting-started-sharing.html#getting-started-sharing-orgs) in the *Amazon RAM User Guide*.

## Sharing an Amazon SageMaker Partner AI App
<a name="partner-app-resource-sharing-share"></a>

To share an Amazon SageMaker Partner AI App, you must add it to a resource share. A resource share is an Amazon RAM resource that lets you share your resources across Amazon Web Services accounts. A resource share specifies the resources to share, and the consumers with whom they are shared. When you share an Amazon SageMaker Partner AI App using the [Amazon SageMaker AI console](https://console.amazonaws.cn/sagemaker), you add it to an existing resource share. To add the Amazon SageMaker Partner AI App to a new resource share, you must first create the resource share by using the [Amazon RAM console](https://console.amazonaws.cn/ram).

You can share an Amazon SageMaker Partner AI App that you own using the Amazon SageMaker AI console, Amazon RAM console, or the Amazon CLI.

**To share an Amazon SageMaker Partner AI App that you own using the Amazon SageMaker AI console**

1. Sign in to the Amazon Web Services Management Console and open the Amazon RAM console at [https://console.amazonaws.cn/ram/home](https://console.amazonaws.cn/ram/home).

1. In the main pane, choose **Create a resource share**.

1. Enter a name for the resource share that you want to create.

1. In the **Resources** section, for **Resource type** select **SageMaker AI Partner Apps**. The partner apps that you can share appear in the table.

1. Select the partner apps that you want to share.

1. Optionally specify tags, and then choose **Next**.

1. Specify the Amazon Web Services accounts with which you want to share your partner apps.

1. Review your resource share configuration and choose **Create resource share**. It might take the service a few minutes to finish creating the resource share.

**To share an Amazon SageMaker Partner AI App that you own using the Amazon RAM console**  
See [Creating a Resource Share](https://docs.amazonaws.cn/ram/latest/userguide/working-with-sharing.html#working-with-sharing-create) in the *Amazon RAM User Guide*.

**To share an Amazon SageMaker Partner AI App that you own using the Amazon CLI**  
Use the [create-resource-share](https://docs.amazonaws.cn/cli/latest/reference/ram/create-resource-share.html) command.

## Accepting resource share invitations
<a name="partner-app-resource-sharing-responses"></a>

When a resource owner sets up a resource share, each consumer Amazon Web Services account receives an invitation to join the resource share. The consumer Amazon Web Services accounts must accept the invitation to gain access to any shared resources.

For more information on accepting a resource share invitation through Amazon RAM, see [Using shared Amazon resources ](https://docs.amazonaws.cn/ram/latest/userguide/getting-started-shared.html)in the *Amazon Resource Access Manager User Guide*.

## Identifying a shared Amazon SageMaker Partner AI App
<a name="sharing-identify"></a>

Owners and consumers can identify shared Amazon SageMaker Partner AI Apps using the Amazon SageMaker AI console and Amazon CLI.

**To identify a shared Amazon SageMaker Partner AI App by using the Amazon SageMaker AI console**  
See [Partner AI Apps in Studio](partner-apps-studio.md).

**To identify a shared Amazon SageMaker Partner AI App by using the Amazon CLI**  
Use the [list-partner-apps](https://docs.amazonaws.cn/cli/latest/reference/sagemaker/list-partner-apps.html) command. The command returns the Amazon SageMaker Partner AI Apps that you own and Amazon SageMaker Partner AI Apps that are shared with you. `OwnerId` shows the Amazon Web Services account ID of the Amazon SageMaker Partner AI App owner.

## Responsibilities and permissions for shared Amazon SageMaker Partner AI Apps
<a name="sharing-perms"></a>

The account with which an Amazon SageMaker Partner AI App is shared needs to have the following Amazon Identity and Access Management policy.

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement" : [
    {
      "Sid" : "AmazonSageMakerPartnerListAppsPermission",
      "Effect" : "Allow",
      "Action" : "sagemaker:ListPartnerApps",
      "Resource" : "*"
    },
    {
      "Sid" : "AmazonSageMakerPartnerAppsPermission",
      "Effect" : "Allow",
      "Action" : [
        "sagemaker:CreatePartnerAppPresignedUrl",
        "sagemaker:DescribePartnerApp",
        "sagemaker:CallPartnerAppApi"
      ],
      "Condition" : {
        "StringEquals" : {
          "aws:ResourceAccount" : [
                        "{{App-owner Amazon Web Services account-1}}", "{{App-owner Amazon Web Services account-2}}"]        
        }
      },
      "Resource" : "arn:aws-cn:sagemaker:*:*:partner-app/*"
    }
  ]
}
```

------