Configuring Salesforce connections - Amazon Glue
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Configuring Salesforce connections

To configure a Salesforce connection:

  1. In Amazon Secrets Manager, create a secret with the following details:

    1. For the JWT_TOKEN grant type - the secret should contain the JWT_TOKEN key with its value.

    2. For the AuthorizationCode grant type: for a customer managed connected app the secret should contain the connected app Consumer Secret with USER_MANAGED_CLIENT_APPLICATION_CLIENT_SECRET as key. For an Amazon Managed connected app, an empty secret or a secret with some temporary value.

    3. Note: You must create a secret per connection in Amazon Glue.

  2. In the Amazon Glue Data Catalog, create a connection by following the steps below:

    1. When selecting a Connection type, select Salesforce.

    2. Provide the INSTANCE_URL of the Salesforce you want to connect to.

    3. Provide the Salesforce environment.

    4. Select the Amazon IAM role which Amazon Glue can assume and has permissions for following actions:

    5. Select the OAuth2 grant type which you want to use for the connections. The grant type determines how Amazon Glue communicates with Salesforce to request access to your data. Your choice affects the requirements that you must meet before you create the connection. You can choose either of these types:

      • JWT_BEARER Grant Type: This grant type works well for automation scenarios as it allows a JSON Web Token (JWT) to be created up front with the permissions of a particular user in the Salesforce instance. The creator has control over how long the JWT is valid for. Amazon Glue is able to use the JWT to obtain an access token which is used to call Salesforce APIs.

        This flow requires that the user has created a connected app in their Salesforce instance which enables issuing JWT-based access tokens for users.

        For information on creating a connected app for the JWT bearer OAuth flow, see OAuth 2.0 JWT bearer flow for server-to-server integration. To set up the JWT bearer flow with the Salesforce connected app, see Set up the JWT bearer OAuth flow for Salesforce.

      • AUTHORIZATION_CODE Grant Type: This grant type is considered a "three-legged" OAuth as it relies on redirecting users to the third-party authorization server to authenticate the user. It is used when creating connections via the Amazon Glue console. The user creating a connection may by default rely on an Amazon Glue connected app (Amazon Glue managed client application) where they do not need to provide any OAuth related information except for their Salesforce instance URL. The Amazon Glue console will redirect the user to Salesforce where the user must login and allow Amazon Glue the requested permissions to access their Salesforce instance.

        Users may still opt to create their own connected app in Salesforce and provide their own client ID and client secret when creating connections through the Amazon Glue console. In this scenario, they will still be redirected to Salesforce to login and authorize Amazon Glue to access their resources.

        This grant type results in a refresh token and access token. The access token is short lived, and may be refreshed automatically without user interaction using the refresh token.

        For information on creating a connected app for the Authorization Code OAuth flow, see Configure a Connected App for the Authorization Code and Credentials Flow.

    6. Select the secretName which you want to use for this connection in Amazon Glue to put the tokens.

    7. Select the network options if you want to use your network. Grant the IAM role associated with your Amazon Glue job permission to read secretName.

  3. Grant the IAM role associated with your Amazon Glue job permission to read secretName.

  4. In your Amazon Glue job configuration, provide connectionName as an Additional network connection.

    { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "secretsmanager:DescribeSecret", "secretsmanager:GetSecretValue", "secretsmanager:PutSecretValue", "ec2:CreateNetworkInterface", "ec2:DescribeNetworkInterface", "ec2:DeleteNetworkInterface", ], "Resource": "*" } ] }