

# Importing assets to AWS Data Exchange
<a name="importing-assets"></a>

You can create an AWS Data Exchange job to import data sets that you want to publish to a product. The following sections describe how to import these assets from a variety of locations.

**Topics**
+ [From an S3 bucket](importing-from-s3.md)
+ [From a signed URL](importing-from-url.md)
+ [From an Amazon API Gateway API](import-API-asset.md)
+ [From a datashare for Amazon Redshift](import-RS-asset.md)
+ [From an AWS Lake Formation (Preview)](import-LF-asset.md)

# Importing AWS Data Exchange assets from an S3 bucket
<a name="importing-from-s3"></a>

When you import assets from Amazon S3 to AWS Data Exchange, the AWS Identity and Access Management (IAM) permissions you use must include the ability to write to the AWS Data Exchange service S3 buckets and to read from the S3 bucket where your assets are stored. You can import from any S3 bucket that you have permission to access, regardless of ownership. For more information, see [Amazon S3 permissions](access-control.md#additional-s3-permissions).

You can import up to 100 assets in a single job.

**Topics**
+ [Importing assets from an S3 bucket (AWS SDKs)](#import-assets-s3-prog)
+ [Importing assets from an S3 bucket (console)](#import-assets-via-console)

## Importing assets from an S3 bucket (AWS SDKs)
<a name="import-assets-s3-prog"></a>

**To import assets from an Amazon S3 bucket (AWS SDKs)**

1. Create a `CreateJob` request of type `IMPORT_ASSETS_FROM_S3`. 

1. Include the following in the request:
   + `AssetSources`
     + `Bucket`
     + `Key`
   + `DataSetID`
   + `RevisionID`

1. Start the `CreateJob` request with a `StartJob` operation that requires the `JobId` returned in step 1.

1. (Optional) Update the assets' name property after they are created.

## Importing assets from an S3 bucket (console)
<a name="import-assets-via-console"></a>

**To import an asset from an S3 bucket (console)**

1. Open your web browser and sign in to the [AWS Data Exchange console](https://console.aws.amazon.com/dataexchange).

1. In the left side navigation pane, for **Publish data**, choose **Owned data sets**.

1. In **Owned data sets**, choose the data set that has the revision you want to update.

1. On the **Revisions** tab, choose **Create revision** to open the **Create revision** page.

   1. For **Revision settings**, provide an optional comment for your revision that describes the purpose of the revision.

   1. For **Add tags – optional**, add tags associated with the resource.

   1. Choose **Create**.

      Your new revision is created.

1. For the **Jobs** section, choose **Import from Amazon S3**.

1. Follow the prompts in the **Import from Amazon S3** window, and then choose **Import assets**. 

   A job is started to import your asset into your data set. After the job is finished, the **State** field in the **Jobs** section is updated to **Completed**.

# Importing AWS Data Exchangeassets from a signed URL
<a name="importing-from-url"></a>

You can use signed URLs to import assets that are not stored in Amazon S3. 

**Topics**
+ [Importing assets from a signed URL (AWS SDKs)](#import-asset-signed-url-prog)
+ [Importing assets from a signed URL (console)](#import-asset-signed-url-via-console)

## Importing assets from a signed URL (AWS SDKs)
<a name="import-asset-signed-url-prog"></a>

**To import assets from a signed URL (AWS SDKs)**

1. Create a `CreateJob` request of type `IMPORT_ASSET_FROM_SIGNED_URL`.

1. Include the following in the request:
   + `AssetName`
   + `DataSetID`
   + `Md5Hash`
   + `RevisionID`

1. Start the `CreateJob` request with a `StartJob` operation that requires the `JobId` returned in step 1.

1. (Optional) Update the assets' name property after they are created.

1. The response details include the `SignedUrl` that you can use to import your file. 

**Note**  
The signed URL expires one minute after it's created.

## Importing assets from a signed URL (console)
<a name="import-asset-signed-url-via-console"></a>

**To import an asset from a signed URL (console)**

1. Open your web browser and sign in to the [AWS Data Exchange console](https://console.aws.amazon.com/dataexchange).

1. In the left side navigation pane, for **Publish data**, choose **Owned data sets**.

1. In **Owned data sets**, choose the data set that has the asset you want to update.

1. On the **Revisions** tab, choose **Create revision** to open the **Create revision** page.

   1. For **Revision settings**, provide an optional comment for your revision that describes the purpose of the revision.

   1. For **Add tags – optional**, add tags associated with the resource.

   1. Choose **Create**.

      Your new revision is created.

1. For the **Jobs** section, choose **Upload**.

1. Follow the prompts in the upload window, and then choose **Open**.

   A job is started to import your asset into your data set. After the job is finished, the **State** field in the **Jobs** section is updated to **Completed**.

# Importing AWS Data Exchange assets from an Amazon API Gateway API
<a name="import-API-asset"></a>

AWS Data Exchange subscribers can use their IAM credentials and AWS SDKs to call APIs from data providers. AWS Data Exchange manages access to APIs by handling authentication and subscription entitlements.

## Importing API assets from an Amazon API Gateway API (AWS SDKs)
<a name="import-api-asset-prog"></a>

**Note**  
Currently, the `SendApiAsset` operation is not supported for the following SDKs:  
SDK for .NET
AWS SDK for C\$1\$1
AWS SDK for Java 2.x

**To import assets from an Amazon API Gateway API (AWS SDKs)**

1. Create a `CreateJob` request of type `IMPORT_ASSET_FROM_API_GATEWAY_API`.

1. Include the following in the request:
   + `ApiID`
   + `DataSetID`
   + `ProtocolType`
   + `RevisionID`
   + `Stage`

1. Start the `CreateJob` request with a `StartJob` operation that requires the `JobId` returned in step 1.

1. (Optional) Poll the `GetJob` operation to wait for the job to complete.

1. (Optional) Update the assets' name property after they are created.

## Importing API assets from an Amazon API Gateway API (console)
<a name="import-api-asset-console"></a>

**To import an asset from an Amazon API Gateway API (console)**

1. Open your web browser and sign in to the [AWS Data Exchange console](https://console.aws.amazon.com/dataexchange).

1. In the left side navigation pane, for **Publish data**, choose **Owned data sets**.

1. In **Owned data sets**, choose the data set that has the asset you want to update.

1. On the **Revisions** tab, choose **Create revision** to open the **Create revision** page.

   1. For **Revision settings**, provide an optional comment for your revision that describes the purpose of the revision.

   1. For **Add tags – optional**, add tags associated with the resource.

   1. Choose **Create**.

      Your new revision is created.

1. For the **API assets** section, choose **Add API stage**.

1. On the **Add API stage** page, select the **Amazon API Gateway API** and the **Stage name** from your AWS account or another account.

1. For **Document API for subscribers**:

   1. Update the **API name** to a clear and concise name that subscribers can understand.

   1. Document the OpenAPI 3.0 specification by entering the specification in the field, importing the specification by choosing **Import from .JSON file**, or importing the specification by choosing **Import from Amazon API Gateway**.

1. Choose **Add API stage**.

   A job is started to import your API assets into your data set. After the job is finished, the **State** field in the **Jobs** section is updated to **Completed**.

# Importing AWS Data Exchange assets from an AWS Data Exchange datashare for Amazon Redshift
<a name="import-RS-asset"></a>

When you import assets using AWS Data Exchange datashare for Amazon Redshift, you can begin querying, analyzing, and operationalizing third-party Amazon Redshift tables after subscribing.

## Importing assets from an AWS Data Exchange datashare for Amazon Redshift (AWS SDKs)
<a name="import-RS-asset-prog"></a>

**To import assets from an AWS Data Exchange datashare for Amazon Redshift (AWS SDKs)**

1. Create a `CreateJob` request of type `IMPORT_ASSETS_FROM_REDSHIFT_DATA_SHARES`.

1. Include the following in the request:
   + `AssetSources`
     + `DataShareArn`
   + `DataSetID`
   + `RevisionID`

1. Start the `CreateJob` request with a `StartJob` operation that requires the `JobId` returned in step 1.

1. (Optional) Poll the `GetJob` operation to wait for the job to complete.

1. (Optional) Update the assets' name property after they are created.

## Importing assets from an AWS Data Exchange datashare for Amazon Redshift (console)
<a name="import-RS-asset-console"></a>

**To import an asset from an ADE datashare (for Amazon Redshift console)**

1. Open your web browser and sign in to the [AWS Data Exchange console](https://console.aws.amazon.com/dataexchange).

1. In the left side navigation pane, for **Publish data**, choose **Owned data sets**.

1. In **Owned data sets**, choose the data set that has the asset you want to update.

1. On the **Revisions** tab, choose **Create revision** to open the **Create revision** page.

   1. For **Revision settings**, provide an optional comment for your revision that describes the purpose of the revision.

   1. For **Add tags – optional**, add tags associated with the resource.

   1. Choose **Create**.

      Your new revision is created.

1. For the **AWS Data Exchange datashares for Amazon Redshift** section, choose **Add datashares**.

1. On the **Add AWS Data Exchange datashare to revision** page, select the datashare or datashares that you want to add.

1. Choose **Add datashare(s)**.

   A job is started to import your assets into your data set. After the job is finished, the **State** field in the **Jobs** section is updated to **Completed**.

# Importing AWS Data Exchange assets from AWS Lake Formation (Preview)
<a name="import-LF-asset"></a>

When you import assets from AWS Lake Formation to AWS Data Exchange, the IAM permissions that you use must include the following abilities: 
+ Write to, grant, and revoke Lake Formation permissions
+ Create resource shares for tables, databases, and catalogs
+ Update, delete, associate, and disassociate resource shares for any resource share beginning with **Lake Formation**

For more information about required and recommended IAM permissions, see [Identity and access management in AWS Data Exchange](auth-access.md).

## Importing assets from AWS Lake Formation (Preview) (AWS SDKs)
<a name="import-lf-asset-sdk"></a>

**To import assets from AWS Lake Formation (Preview) (AWS SDKs)**

1. Create a `CreateJob` request of type `Import_Assets_From_Lake_Formation_Tag_Policy`. 

1. Include the following in the request:
   + `AssetSources`
     + `CatalogId`
     + `Database`
       + `Expression`
         + `TagKey`
         + `TagValues`
       + `Permissions`
     + `Table`
       + `Expression`
         + `TagKey`
         + `TagValues`
       + `Permissions`
   + `RoleArn`
   + `DataSetId`
   + `RevisionId`

1. Start the `CreateJob` request with a `StartJob` operation that requires the `JobId`.

1. (Optional) Poll the `GetJob` operation to wait for the job to complete.

1. (Optional) Update the assets' name property after they are created.

## Importing assets from AWS Lake Formation (Preview) (console)
<a name="import-LF-asset-console"></a>

**To import an asset from AWS Lake Formation (Preview) (console)**

1. Open your web browser and sign in to the [AWS Data Exchange console](https://console.aws.amazon.com/dataexchange).

1. In the left side navigation pane, for **Publish data**, choose **Owned data sets**.

1. In **Owned data sets**, choose the data set that has the revision you want to update.

1. On the **Revisions** tab, choose **Create revision** to open the **Create revision** page.

   1. For **Revision settings**, provide an optional comment for your revision that describes the purpose of the revision.

   1. For **Add tags – optional**, add tags associated with the resource.

   1. Choose **Create**.

      Your new revision is created.

1. For the **Lake Formation data permission** section, choose **Add LF-Tag**.

1. Choose the **Key** and **Values** that you want to add and choose **Add LF-Tag**.

   1. (Optional) Choose **Preview Resource(s)** to view the associated data catalog resources that you are granting permission.

1. In **Service access**, select the **Role** to import the AWS Lake Formation resources into AWS Data Exchange.

1. Choose **Create Lake Formation data permission**.

   A job is started to import your assets into your data set. After the job is finished, the **State** field in the **Jobs** section is updated to **Completed**.