Set Up an Amazon Redshift Data Federation Connection
Use Identity Provider Authentication for Amazon Redshift Data Federation Connection
Create an Amazon Redshift Data Stream
MuleSoft Anypoint Connector for Salesforce Data 360
Add an identity provider (IdP) and create the necessary policies in AWS to use IdP-based authentication when connecting to a Redshift database using Amazon Redshift Data Federation Connection.
| User Permissions Needed | |
|---|---|
| To create an Amazon Redshift Federation connection in Data Cloud | System Admin profile or Data Cloud Architect permission set |
Before you begin be sure to set up your connection and get the generated External Id.
Add an identity provider for Salesforce in AWS.
In the navigation pane of IAM, choose Identity providers, and then choose Add provider.
For Configure provider, choose OpenID Connect.
Enter the My Domain URL details for the provider URL and audience.
| IdP Details in AWS Management Console | URL Format | Example |
|---|---|---|
| Provider URL | My Domain URL/services/connectors | https://dlt0000007luz2am-dev-ed.develop.test1.my.pc-rnd.salesforce.com/services/connectors |
| Audience | My Domain URL | https://dlt0000007luz2am-dev-ed.develop.test1.my.pc-rnd.salesforce.com |
To find the My Domain URL of your org, go to Setup, click Settings, and then Company Settings. Click My Domain to find your Current My Domain URL. For more information, see My Domain.
Tip
Verify the information you provided and choose Add provider.
IAM attempts to retrieve and use the top intermediate CA thumbprint of the OIDC IdP server certificate to create the IAM OIDC identity provider.
Create the necessary roles in AWS for the Data Cloud Redshift connector to connect to Redshift. See Creating a role using custom trust policies (console).
Associate a permission policy to the role.
Sample permission policy for Redshift Cluster.
1{
2"Sid": "AllowGetCredentialsRedshift",
3"Effect": "Allow",
4"Action": [
5"redshift:GetClusterCredentialsWithIAM"
6],
7"Resource": [
8"arn:aws:redshift:us-west-2:211125688834:dbname:redshift-cluster-idp-poc/dev"
9]
10}Sample permission policy for Redshift Workgroup (Serverless)
1{
2"Version": "2012-10-17",
3"Statement": [
4{
5"Sid": "AllowGetCredentialsRedshiftServerless",
6"Effect": "Allow",
7"Action": [
8"redshift-serverless:GetCredentials"
9],
10"Resource": [
11"arn:aws:redshift-serverless:us-west-2:211125688834:workgroup/33f34cd9-7b0a-4bfc-b5ae-7d03da8038cd"
12]
13}
14]
15}Associate a trust policy to the role using the External ID obtained when you set up the connection.
Sample trust policy
1{
2"Version": "2012-10-17",
3"Statement": [
4{
5"Effect": "Allow",
6"Principal": {
7"Federated": "arn:aws:iam::211125688834:oidc-provider/orgfarmout-2d4.test1.my.pc-rnd.salesforce.com/services/connectors"
8},
9"Action": "sts:AssumeRoleWithWebIdentity",
10"Condition": {
11"StringEquals": {
12"orgfarmout-2d4.test1.my.pc-rnd.salesforce.com/services/connectors:sub": "app:DE809C7E:EF92A163"
13}
14}
15}
16]
17}Get the Amazon Resource Name (ARN) of the role and use it as the IAM Role Name when setting up Amazon Redshift Data Federation Connection.
If you are setting up a role for Redshift Workgroup (serverless), make sure your role is part of the pg_user list.
To check if your role is part of the list, run the command select * from pg_user;. If the role is’nt part of the list, run the command, create user IAMR:<username> password DISABLE; and create the db user with the same role name.
If you’re setting up a role for Redshift Workgroup (serverless), grant read permissions on the schema with these statements.
1GRANT USAGE ON SCHEMA idp_test TO "IAMR:<ROLE NAME>";
2GRANT SELECT ON ALL TABLES IN SCHEMA idp_test TO "IAMR: <ROLE NAME>";If Redshift and Data 360 are in different regions, ensure to update the region details in the Redshift AWS Region field. You can also choose to create a new connection or edit an existing connection to use the Identity Provider based authentication method.
Note