

# EMR Serverless compute connections in Amazon SageMaker Unified Studio
EMR Serverless

In addition to Amazon EMR on EC2 clusters, you can also create and delete EMR Serverless applications.

# Adding a new EMR Serverless application


As a data worker, you can make use of EMR Serverless applications by adding them to a project in the Amazon SageMaker Unified Studio Studio. Within a project, you can use both existing and new applications. You can use existing applications at any time. However, in order to create a new EMR Serverless application, the admin must enable blueprints.

After your admin has enabled blueprints:

1. From inside the project management view, select **Compute** from the navigation bar. 

1. In the Compute panel, select the **Data processing** tab.

1. To add an instance of an Amazon EMR Serverless, select the **Add compute** dropdown menu and then choose **New compute**.

1. In the **Add compute** modal, you can select the type of compute you would like to add to your project. Select **EMR Serverless**.

1. The **Add compute** dialog box allows you to specify the name of the EMR Serverless application, provide a description, and choose a release of EMR Serverless that you want your application to use.

1. Choose the permission mode option that supports the data you will be using with the compute resource.
   + Select **project.spark.fineGrained** for data managed using fine-grained access, meaning the compute engine can only access specific rows and columns from the full dataset. Choosing this option configures your compute to work with data asset subscriptions from Amazon SageMaker Catalog. 
   + Select **project.spark.compatibility** to configure permission mode to be compatible with data managed using full-table access, meaning the compute engine can access all rows and columns in the data. Choosing this option configures your compute to work with data assets from AWS and from external systems that you connect to from your project.

1. After configuring these settings, select **Add compute**. After a short time, your serverless application running EMR Serverless should be added to your project.

# Configuring permission mode for EMR Serverless in Amazon SageMaker Unified Studio
Configuring permission mode

Permission mode is a configuration available to Spark compute resources such as Glue ETL or EMR Serverless. It configures Spark to access different types of data based on the permissions configured for that data. There are two configuration options for permission mode:
+ Compatibility mode. This is a configuration for data managed using full-table access, meaning the compute engine can access all rows and columns in the data. Choosing this option enables your compute to work with data assets from AWS and from external systems. 
+ Fine-grained mode. This is a configuration for data managed using fine-grained access controls, meaning the compute engine can only access specific rows and columns from the full dataset. Choosing this option enables your Glue ETL to work with data asset subscriptions from Amazon SageMaker Catalog.

You configure permission mode in EMR Serverless computes in Amazon SageMaker Unified Studio when you add a new EMR Serverless compute resource in your project. For more information, see [Adding a new EMR Serverless application](adding-new-emr-serverless.md).

**Note**  
You cannot modify the permission mode after the EMR Serverless compute resource is created. Instead, you can create another EMR Serverless compute resource with a different permission mode.

# Configuring user background sessions for EMR Serverless
Configuring user background sessions

**Warning**  
 When user background sessions is enabled for EMR Serverless, Amazon SageMaker Unified Studio will not terminate interactive sessions. All interactive sessions will be only terminated once all queries are completed. 

 User background sessions for your EMR Serverless applications must be enabled manually. To enable user background sessions, perform the following action using your EMR Serverless application. 

```
aws emr-serverless update-application \
  --region {aws-region-code} \
  --application-id {application-id} \
  --identity-center-configuration userBackgroundSessionsEnabled=true
```

 For more information, see [User background sessions](https://docs.aws.amazon.com/emr/latest/EMR-Serverless-UserGuide/security-iam-service-trusted-prop-user-background.html) in the EMR Serverless management guide. 

# Deleting applications


When you no longer need an EMR Serverless application, the application can be deleted.

To delete an application:

1. Login to the Amazon SageMaker Unified Studio studio and navigate to the Serverless tab of the Compute section. Select the name of the compute instance you would like to remove.

1. On the compute details page, select the **Delete** option.

1. A dialog box will appear asking you to confirm that you want to delete the application, which in this case is your EMR Serverless application. Confirm that you want to remove the compute by typing "confirm" in the text box.

1. Choose **Delete application** to begin termination and removal.

1. After a short time, your application should be removed.