Friday, July 12, 2024
HomeBig DataImplement tag-based entry management to your information lake and Amazon Redshift information...

Implement tag-based entry management to your information lake and Amazon Redshift information sharing with AWS Lake Formation


Knowledge-driven organizations deal with information as an asset and use it throughout completely different traces of enterprise (LOBs) to drive well timed insights and higher enterprise selections. Many organizations have a distributed instruments and infrastructure throughout varied enterprise models. This results in having information throughout many cases of information warehouses and information lakes utilizing a trendy information structure in separate AWS accounts.

Amazon Redshift information sharing lets you securely share dwell, transactionally constant information in a single Amazon Redshift information warehouse with one other Redshift information warehouse throughout the similar AWS account, throughout accounts, and throughout Areas, without having to repeat or transfer information from one cluster to a different. Clients need to have the ability to handle their permissions in a central place throughout all of their belongings. Beforehand, the administration of Redshift datashares was restricted to solely inside Amazon Redshift, which made it troublesome to handle your information lake permissions and Amazon Redshift permissions in a single place. For instance, you needed to navigate to a person account to view and handle entry data for Amazon Redshift and the info lake on Amazon Easy Storage Service (Amazon S3). As a company grows, directors desire a mechanism to successfully and centrally handle information sharing throughout information lakes and information warehouses for governance and auditing, and to implement fine-grained entry management.

We not too long ago introduced the combination of Amazon Redshift information sharing with AWS Lake Formation. With this function, Amazon Redshift prospects can now handle sharing, apply entry insurance policies centrally, and successfully scale the permission utilizing LF-Tags.

Lake Formation has been a preferred alternative for centrally governing information lakes backed by Amazon S3. Now, with Lake Formation help for Amazon Redshift information sharing, it opens up new design patterns and broadens governance and safety posture throughout information warehouses. With this integration, you should utilize Lake Formation to outline fine-grained entry management on tables and views being shared with Amazon Redshift information sharing for federated AWS Identification and Entry Administration (IAM) customers and IAM roles. Lake Formation additionally gives tag-based entry management (TBAC), which can be utilized to simplify and scale governance of information catalog objects corresponding to databases and tables.

On this put up, we focus on this new function and learn how to implement TBAC to your information lake and Amazon Redshift information sharing on Lake Formation.

Resolution overview

Lake Formation tag-based entry management (LF-TBAC) lets you group related AWS Glue Knowledge Catalog sources collectively and outline the grant or revoke permissions coverage through the use of an LF-Tag expression. LF-Tags are hierarchical in that when a database is tagged with an LF-Tag, all tables in that database inherit the tag, and when a LF-Tag is utilized to a desk, all of the columns inside that desk inherit the tag. Inherited tags then might be overridden if wanted. You then can create entry insurance policies inside Lake Formation utilizing LF-Tag expressions to grant principals entry to tagged sources utilizing an LF-Tag expression. See Managing LF-Tags for metadata entry management for extra particulars.

To show LF-TBAC with central information entry governance functionality, we use the situation the place two separate enterprise models personal specific datasets and have to share information throughout groups.

We have now a buyer care group who manages and owns the client data database together with buyer demographics information. And have a advertising group who owns a buyer leads dataset, which incorporates data on potential prospects and speak to leads.

To have the ability to run efficient campaigns, the advertising group wants entry to the client information. On this put up, we show the method of sharing this information that’s saved within the information warehouse and giving the advertising group entry. Moreover, there are personally identifiable data (PII) columns throughout the buyer dataset that ought to solely be accessed by a subset of energy customers on a need-to-know foundation. This fashion, information analysts inside advertising can solely see non-PII columns to have the ability to run nameless buyer section evaluation, however a gaggle of energy customers can entry PII columns (for instance, buyer e-mail handle) to have the ability to run campaigns or surveys for particular teams of consumers.

The next diagram exhibits the construction of the datasets that we work with on this put up and a tagging technique to supply fine-grained column-level entry.

Past our tagging technique on the info sources, the next desk offers an summary of how we should always grant permissions to our two personas by way of tags.

IAM Function Persona Useful resource Sort Permission LF-Tag expression
marketing-analyst A knowledge analyst within the advertising group DB describe (division:advertising OR division:buyer) AND classification:personal
. Desk choose (division:advertising OR division:buyer) AND classification:personal
. . . . .
marketing-poweruser A privileged person within the advertising group DB describe (division:advertising OR division:buyer) AND classification: personal
. Desk (Column) choose (division:advertising OR division:buyer) AND (classification:personal OR classification:pii-sensitive)

The next diagram offers a high-level overview of the setup that we deploy on this put up.

The next is a high-level overview of learn how to use Lake Formation to manage datashare permissions:

Producer Setup:

  1. Within the producers AWS account, the Amazon Redshift administrator that owns the client database creates a Redshift datashare on the producer cluster and grants utilization to the AWS Glue Knowledge Catalog in the identical account.
  2. The producer cluster administrator authorizes the Lake Formation account to entry the datashare.
  3. In Lake Formation, the Lake Formation administrator discovers and registers the datashares. They need to uncover the AWS Glue ARNs they’ve entry to and affiliate the datashares with an AWS Glue Knowledge Catalog ARN. In case you’re utilizing the AWS Command Line Interface (AWS CLI), you possibly can uncover and settle for datashares with the Redshift CLI operations describe-data-shares and associate-data-share-consumer. To register a datashare, use the Lake Formation CLI operation register-resource.
  4. The Lake Formation administrator creates a federated database within the AWS Glue Knowledge Catalog; assigns tags to the databases, tables, and columns; and configures Lake Formation permissions to manage person entry to things throughout the datashare. For extra details about federated databases in AWS Glue, see Managing permissions for information in an Amazon Redshift datashare.

Shopper Setup:

  1. On the patron aspect (advertising), the Amazon Redshift administrator discovers the AWS Glue database ARNs they’ve entry to, creates an exterior database within the Redshift shopper cluster utilizing an AWS Glue database ARN, and grants utilization to database customers authenticated with IAM credentials to start out querying the Redshift database.
  2. Database customers can use the views SVV_EXTERNAL_TABLES and SVV_EXTERNAL_COLUMNS to seek out all of the tables or columns throughout the AWS Glue database that they’ve entry to; then they will question the AWS Glue database’s tables.

When the producer cluster administrator decides to not share the info with the patron cluster, the producer cluster administrator can revoke utilization, deauthorize, or delete the datashare from Amazon Redshift. The related permissions and objects in Lake Formation usually are not routinely deleted.

Stipulations:

To observe the steps on this put up, you have to fulfill the next conditions:

Deploy surroundings together with producer and shopper Redshift clusters

To observe alongside the steps outlined on this put up, deploy following AWS CloudFormation stack that features crucial sources to show the topic of this put up:

  1. Select Launch stack to deploy a CloudFormation template.
  2. Present an IAM position that you’ve got already configured as a Lake Formation administrator.
  3. Full the steps to deploy the template and depart all settings as default.
  4. Choose I acknowledge that AWS CloudFormation may create IAM sources, then select Submit.

This CloudFormation stack creates the next sources:

  • Producer Redshift cluster – Owned by the client care group and has buyer and demographic information on it.
  • Shopper Redshift cluster – Owned by the advertising group and is used to research information throughout information warehouses and information lakes.
  • S3 information lake – Incorporates the online exercise and leads datasets.
  • Different crucial sources to show the method of sharing information – For instance, IAM roles, Lake Formation configuration, and extra. For a full listing of sources created by the stack, look at the CloudFormation template.

After you deploy this CloudFormation template, sources created will incur price to your AWS account. On the finish of the method, just remember to clear up sources to keep away from pointless costs.

After the CloudFormation stack is deployed efficiently (standing exhibits as CREATE_COMPLETE), be aware of the next objects on the Outputs tab:

  • Advertising and marketing analyst position ARN
  • Advertising and marketing energy person position ARN
  • URL for Amazon Redshift admin password saved in AWS Secrets and techniques Supervisor

Create a Redshift datashare and add related tables

On the AWS Administration Console, swap to the position that you just nominated as Lake Formation admin when deploying the CloudFormation template. Then go to Question Editor v2. If that is the primary time utilizing Question Editor V2 in your account, observe these steps to configure your AWS account.

Step one in Question Editor is to log in to the client Redshift cluster utilizing the database admin credentials to make your IAM admin position a DB admin on the database.

  1. Select the choices menu (three dots) subsequent to the lfunified-customer-dwh cluster and select Create connection.

  2. Choose Database person identify and password.
  3. Go away Database as dev.
  4. For Person identify, enter admin.
  5. For Password, full the next steps:
    1. Go to the console URL, which is the worth of the RedShiftClusterPassword CloudFormation output in earlier step. The URL is the Secrets and techniques Supervisor console for this password.
    2. Scroll all the way down to the Secret worth part and select Retrieve secret worth.
    3. Be aware of the password to make use of later when connecting to the advertising Redshift cluster.
    4. Enter this worth for Password.
  6. Select Create connection.

Create a datashare utilizing a SQL command

Full the next steps to create a datashare within the information producer cluster (buyer care) and share it with Lake Formation:

  1. On the Amazon Redshift console, within the navigation pane, select Editor, then Question editor V2.
  2. Select (right-click) the cluster identify and select Edit connection or Create connection.
  3. For Authentication, choose Momentary credentials utilizing your IAM identification.

Discuss with Connecting to an Amazon Redshift database to be taught extra concerning the varied authentication strategies.

  1. For Database, enter a database identify (for this put up, dev).
  2. Select Create connection to hook up with the database.
  3. Run the next SQL instructions to create the datashare and add the info objects to be shared:
    create datashare customer_ds;
    ALTER DATASHARE customer_ds ADD SCHEMA PUBLIC;
    ALTER DATASHARE customer_ds ADD TABLE buyer;

  4. Run the next SQL command to share the client datashare to the present account by way of the AWS Glue Knowledge Catalog:
    GRANT USAGE ON DATASHARE customer_ds TO ACCOUNT '<aws-account-id>' by way of DATA CATALOG;

  5. Confirm the datashare was created and objects shared by working the next SQL command:
    DESC DATASHARE customer_ds;

Be aware of the datashare producer cluster identify area and account ID, which can be used within the following step. You’ll be able to full the next actions on the console, however for simplicity, we use AWS CLI instructions.

  1. Go to CloudShell or your AWS CLI and run the next AWS CLI command to authorize the datashare to the Knowledge Catalog in order that Lake Formation can handle them:
    aws redshift authorize-data-share 
    --data-share-arn 'arn:aws:redshift:<aws-region>:<aws-account-id>:datashare:<producer-cluster-namespace>/customer_ds' 
    --consumer-identifier DataCatalog/<aws-account-id>

The next is an instance output:

 {
    "DataShareArn": "arn:aws:redshift:us-east-2:<aws-account-id>:datashare:cd8d91b5-0c17-4567-a52a-59f1bdda71cd/customer_ds",
    "ProducerArn": "arn:aws:redshift:us-east-2:<aws-account-id>:namespace:cd8d91b5-0c17-4567-a52a-59f1bdda71cd",
    "AllowPubliclyAccessibleConsumers": false,
    "DataShareAssociations": [{
        "ConsumerIdentifier": "DataCatalog/<aws-account-id>XX",
        "Status": "AUTHORIZED",
        "CreatedDate": "2022-11-09T21:10:30.507000+00:00",
        "StatusChangeDate": "2022-11-09T21:10:50.932000+00:00"
    }]
}

Be aware of your datashare ARN that you just used on this command to make use of within the subsequent steps.

Settle for the datashare within the Lake Formation catalog

To simply accept the datashare, full the next steps:

  1. Run the next AWS CLI command to just accept and affiliate the Amazon Redshift datashare to the AWS Glue Knowledge Catalog:
    aws redshift associate-data-share-consumer --data-share-arn 'arn:aws:redshift:<aws-region>:<aws-account-id>:datashare:<producer-cluster-namespace>/customer_ds' 
    --consumer-arn arn:aws:glue:<aws-region>:<aws-account-id>:catalog

The next is an instance output:

{
 "DataShareArn": "arn:aws:redshift:us-east-2:<aws-account-id>:datashare:cfd5fcbd-3492-42b5-9507-dad5d87f7427/customer_ds",
 "ProducerArn": "arn:aws:redshift:us-east-2:<aws-account-id>:namespace:cfd5fcbd-3492-42b5-9507-dad5d87f7427",
 "AllowPubliclyAccessibleConsumers": false,
 "DataShareAssociations": [
 {
 "ConsumerIdentifier": "arn:aws:glue:us-east-2:<aws-account-id>:catalog",
 "Status": "ACTIVE",
 "ConsumerRegion": "us-east-2",
 "CreatedDate": "2023-05-18T12:25:11.178000+00:00",
 "StatusChangeDate": "2023-05-18T12:25:11.178000+00:00"
 }
 ]
}

  1. Register the datashare in Lake Formation:
    aws lakeformation register-resource 
     --resource-arn arn:aws:redshift:<aws-region>:<producer-aws-account-id>:datashare:<producer-cluster-namespace>/customer_ds

  2. Create the AWS Glue database that factors to the accepted Redshift datashare:
    aws glue create-database --region <aws-region> --cli-input-json '{
        "CatalogId": "<aws-account-id>",
        "DatabaseInput": {
            "Identify": "customer_db_shared",
            "FederatedDatabase": {
                "Identifier": "arn:aws:redshift:<aws-region>:<producer-aws-account-id>:datashare:<producer-cluster-namespace>/customer_ds",
                "ConnectionName": "aws:redshift"
            }
        }
    }'

  3. To confirm, go to the Lake Formation console and verify that the database customer_db_shared is created.

Now the info lake administrator can view and grant entry on each the database and tables to the info shopper group (advertising) personas utilizing Lake Formation TBAC.

Assign Lake Formation tags to sources

Earlier than we grant applicable entry to the IAM principals of the info analyst and energy person throughout the advertising group, now we have to assign LF-tags to tables and columns of the customer_db_shared database. We then grant these principals permission to applicable LF-tags.

To assign LF-tags, observe these steps:

  1. Assign the division and classification LF-tag to customer_db_shared (Redshift datashare) primarily based on the tagging technique desk within the resolution overview. You’ll be able to run the next actions on the console, however for this put up, we use the next AWS CLI command:
    aws lakeformation add-lf-tags-to-resource --cli-input-json '{
        "CatalogId": "<aws-account-id>",
        "Useful resource": {
        "Database": {
        "CatalogId": "<aws-account-id>",
        "Identify": "customer_db_shared"
        }
        },
        "LFTags": [
        {
        "CatalogId": "<aws-account-id>",
        "TagKey": "department",
        "TagValues": [
        "customer"]
        },
        {
        "CatalogId": "<aws-account-id>",
        "TagKey": "classification",
        "TagValues": [
        "private"]
        }
        ]
        }'

If the command is profitable, you need to get a response like the next:

  1. Assign the suitable division and classification LF-tag to marketing_db (on the S3 information lake):
    aws lakeformation add-lf-tags-to-resource --cli-input-json '{
        "CatalogId": "<aws-account-id>",
        "Useful resource": {
        "Database": {
        "CatalogId": "<aws-account-id>",
        "Identify": "lfunified_marketing_dl_db"
        }
        },
        "LFTags": [
        {
        "CatalogId": "<aws-account-id>",
        "TagKey": "department",
        "TagValues": [
        "marketing"]
        },
        {
        "CatalogId": "<aws-account-id>",
        "TagKey": "classification",
        "TagValues": [
        "private"]
        }
        ]
        }'

Observe that though you solely assign the division and classification tag on the database stage, it will get inherited by the tables and columns inside that database.

  1. Assign the classification pii-sensitive LF-tag to PII columns of the buyer desk to override the inherited worth from the database stage:
    aws lakeformation add-lf-tags-to-resource --cli-input-json '{
        "CatalogId": "<aws-account-id>",
        "Useful resource": {
        "TableWithColumns": {
        "CatalogId": "<aws-account-id>",
        "DatabaseName": "customer_db_shared",
        "Identify": "public.buyer",
        "ColumnNames":["c_first_name","c_last_name","c_email_address"]
        }
        },
        "LFTags": [
        {
        "CatalogId": "<aws-account-id>",
        "TagKey": "classification",
        "TagValues": [
        "pii-sensitive"]
        }
        ]
        }'

Grant permission primarily based on LF-tag affiliation

Run the next two AWS CLI instructions to permit the advertising information analyst entry to the client desk excluding the pii-sensitive (PII) columns. Exchange the worth for DataLakePrincipalIdentifier with the MarketingAnalystRoleARN that you just famous from the outputs of the CloudFormation stack:

aws lakeformation grant-permissions --cli-input-json '{
    "CatalogId": "<aws-account-id>",
    "Principal": {"DataLakePrincipalIdentifier" : "<MarketingAnalystRoleARN-from-CloudFormation-Outputs>"},
    "Useful resource": {
    "LFTagPolicy": {
    "CatalogId": "<aws-account-id>",
    "ResourceType": "DATABASE",
    "Expression": [{"TagKey": "department","TagValues": ["marketing","customer"]},{"TagKey": "classification","TagValues": ["private"]}]
    }
    },
    "Permissions": [
    "DESCRIBE"
    ],
    "PermissionsWithGrantOption": []
}'
aws lakeformation grant-permissions --cli-input-json '{
    "CatalogId": "<aws-account-id>",
    "Principal": {"DataLakePrincipalIdentifier" : "<MarketingAnalystRoleARN-from-CloudFormation-Outputs>"},
    "Useful resource": {
    "LFTagPolicy": {
    "CatalogId": "<aws-account-id>",
    "ResourceType": "TABLE",
    "Expression": [{"TagKey": "department","TagValues": ["marketing","customer"]},{"TagKey": "classification","TagValues": ["private"]}]
    }
    },
    "Permissions": [
    "SELECT"
    ],
    "PermissionsWithGrantOption": []
}'

We have now now granted advertising analysts entry to the client database and tables that aren’t pii-sensitive.

To permit advertising energy customers entry to desk columns with restricted LF-tag (PII columns), run the next AWS CLI command:

aws lakeformation grant-permissions --cli-input-json '{
    "CatalogId": "<aws-account-id>",
    "Principal": {"DataLakePrincipalIdentifier" : "<MarketingPowerUserRoleARN-from-CloudFormation-Outputs>"},
    "Useful resource": {
    "LFTagPolicy": {
    "CatalogId": "<aws-account-id>",
    "ResourceType": "DATABASE",
    "Expression": [{"TagKey": "department","TagValues": ["marketing","customer"]},{"TagKey": "classification","TagValues": ["private"]}]
    }
    },
    "Permissions": [
    "DESCRIBE"
    ],
    "PermissionsWithGrantOption": []
}'
aws lakeformation grant-permissions --cli-input-json '{
    "CatalogId": "<aws-account-id>",
    "Principal": {"DataLakePrincipalIdentifier" : "<MarketingPowerUserRoleARN-from-CloudFormation-Outputs>"},
    "Useful resource": {
    "LFTagPolicy": {
    "CatalogId": "<aws-account-id>",
    "ResourceType": "TABLE",
    "Expression": [{"TagKey": "department","TagValues": ["marketing","customer"]},{"TagKey": "classification","TagValues": ["private", "pii-sensitive"]}]
    }
    },
    "Permissions": [
    "SELECT"
    ],
    "PermissionsWithGrantOption": []
}'

We will mix the grants right into a single batch grant permissions name:

aws lakeformation batch-grant-permissions --region us-east-1 --cli-input-json '{
    "CatalogId": "<aws-account-id>",
 "Entries": [
 {  "Id": "1",
    "Principal": {"DataLakePrincipalIdentifier" : "arn:aws:iam:: <aws-account-id>:role/Blog-MarketingAnalystRole-1CYV6JSNN14E3"},
    "Resource": {
    "LFTagPolicy": {
    "CatalogId": "<aws-account-id>",
    "ResourceType": "DATABASE",
    "Expression": [{"TagKey": "department","TagValues": ["marketing","customer"]},{"TagKey": "classification","TagValues": ["private"]}]
    }
    },
    "Permissions": [
    "DESCRIBE"
    ],
    "PermissionsWithGrantOption": []
    },
    {  "Id": "2",
    "Principal": {"DataLakePrincipalIdentifier" : "arn:aws:iam:: <aws-account-id>:position/Weblog-MarketingAnalystRole-1CYV6JSNN14E3"},
    "Useful resource": {
    "LFTagPolicy": {
    "CatalogId": "<aws-account-id>",
    "ResourceType": "TABLE",
    "Expression": [{"TagKey": "department","TagValues": ["marketing","customer"]},{"TagKey": "classification","TagValues": ["private"]}]
    }
    },
    "Permissions": [
    "SELECT"
    ],
    "PermissionsWithGrantOption": []
    },
     {  "Id": "3",
    "Principal": {"DataLakePrincipalIdentifier" : "arn:aws:iam:: <aws-account-id>:position/Weblog-MarketingPoweruserRole-RKKM0TWQBP0W"},
    "Useful resource": {
    "LFTagPolicy": {
    "CatalogId": "<aws-account-id>",
    "ResourceType": "DATABASE",
    "Expression": [{"TagKey": "department","TagValues": ["marketing","customer"]},{"TagKey": "classification","TagValues": ["private", "pii-sensitive"]}]
    }
    },
    "Permissions": [
    "DESCRIBE"
    ],
    "PermissionsWithGrantOption": []
    },
    {  "Id": "4",
    "Principal": {"DataLakePrincipalIdentifier" : "arn:aws:iam:: <aws-account-id>:position/Weblog-MarketingPoweruserRole-RKKM0TWQBP0W"},
    "Useful resource": {
    "LFTagPolicy": {
    "CatalogId": "<aws-account-id>",
    "ResourceType": "TABLE",
    "Expression": [{"TagKey": "department","TagValues": ["marketing","customer"]},{"TagKey": "classification","TagValues": ["private", "pii-sensitive"]}]
    }
    },
    "Permissions": [
    "SELECT"
    ],
    "PermissionsWithGrantOption": []
    }
    ]
 }'

Validate the answer

On this part, we undergo the steps to check the situation.

Eat the datashare within the shopper (advertising) information warehouse

To allow the customers (advertising group) to entry the client information shared with them by way of the datashare, first now we have to configure Question Editor v2. This configuration is to make use of IAM credentials because the principal for the Lake Formation permissions. Full the next steps:

  1. Check in to the console utilizing the admin position you nominated in working the CloudFormation template step.
  2. On the Amazon Redshift console, go to Question Editor v2.
  3. Select the gear icon within the navigation pane, then select Account settings.
  4. Beneath Connection settings, choose Authenticate with IAM credentials.
  5. Select Save.

Now let’s connect with the advertising Redshift cluster and make the client database accessible to the advertising group.

  1. Select the choices menu (three dots) subsequent to the Serverless:lfunified-marketing-wg cluster and select Create connection.
  2. Choose Database person identify and password.
  3. Go away Database as dev.
  4. For Person identify, enter admin.
  5. For Password, enter the identical password you retrieved from Secrets and techniques Manger in an earlier step.
  6. Select Create connection.
  7. As soon as efficiently linked, select the plus signal and select Editor to open a brand new Question Editor tab.
  8. Just be sure you specify the Serverless: lfunified-marketing-wg workgroup and dev database.
  9. To create the Redshift database from the shared catalog database, run the next SQL command on the brand new tab:
    CREATE DATABASE ext_customerdb_shared FROM ARN 'arn:aws:glue:<aws-region>:<aws-account-id>:database/customer_db_shared' WITH DATA CATALOG SCHEMA "customer_db_shared"

  10. Run the next SQL instructions to create and grant utilization on the Redshift database to the IAM roles for the facility customers and information analyst. You may get the IAM position names from the CloudFormation stack outputs:
    CREATE USER IAMR:"lf-redshift-ds-MarketingAnalystRole-XXXXXXXXXXXX" password disable;
    GRANT USAGE ON DATABASE ext_customerdb_shared to IAMR:"lf-redshift-ds-MarketingAnalystRole-XXXXXXXXXXXX";
    
    CREATE USER IAMR:"lf-redshift-ds-MarketingPoweruserRole-YYYYYYYYYYYY" password disable;
    GRANT USAGE ON DATABASE ext_customerdb_shared to IAMR:"lf-redshift-ds-MarketingPoweruserRole-YYYYYYYYYYYY";

Create the info lake schema in AWS Glue and permit the advertising energy position to question the lead and net exercise information

Run the next SQL instructions to make the lead information within the S3 information lake accessible to the advertising group:

create exterior schema datalake from information catalog
database 'lfunified_marketing_dl_db' 
iam_role 'SESSION'
catalog_id '<aws-account-id>';
GRANT USAGE ON SCHEMA datalake TO IAMR:"lf-redshift-ds-MarketingAnalystRole-XXXXXXXXXXXX";
GRANT USAGE ON SCHEMA datalake TO IAMR:"lf-redshift-ds-MarketingPoweruserRole-YYYYYYYYYYYY";

Question the shared dataset as a advertising analyst person

To validate that the advertising group analysts (IAM position marketing-analyst-role) have entry to the shared database, carry out the next steps:

  1. Check in to the console (for comfort, you should utilize a distinct browser) and swap your position to lf-redshift-ds-MarketingAnalystRole-XXXXXXXXXXXX.
  2. On the Amazon Redshift console, go to Question Editor v2.
  3. To hook up with the patron cluster, select the Serverless: lfunified-marketing-wg shopper information warehouse within the navigation pane.
  4. When prompted, for Authentication, choose Federated person.
  5. For Database, enter the database identify (for this put up, dev).
  6. Select Save.
  7. When you’re linked to the database, you possibly can validate the present logged-in person with the next SQL command:
    choose current_user;

  8. To seek out the federated databases created on the patron account, run the next SQL command:
    SHOW DATABASES FROM DATA CATALOG ACCOUNT '<aws-account-id>';

  9. To validate permissions for the advertising analyst position, run the next SQL command:
    choose * from ext_customerdb_shared.public.buyer restrict 10;

As you possibly can see within the following screenshot, the advertising analyst is ready to efficiently entry the client information however solely the non-PII attributes, which was our intention.

  1. Now let’s validate that the advertising analyst doesn’t have entry to the PII columns of the identical desk:
    choose c_customer_email from ext_customerdb_shared.public.buyer restrict 10;

Question the shared datasets as a advertising energy person

To validate that the advertising energy customers (IAM position lf-redshift-ds-MarketingPoweruserRole-YYYYYYYYYYYY) have entry to pii-sensetive columns within the shared database, carry out the next steps:

  1. Check in to the console (for comfort, you should utilize a distinct browser) and swap your position to lf-redshift-ds-MarketingPoweruserRole-YYYYYYYYYYYY.
  2. On the Amazon Redshift console, go to Question Editor v2.
  3. To hook up with the patron cluster, select the Serverless: lfunified-marketing-wg shopper information warehouse within the navigation pane.
  4. When prompted, for Authentication, choose Federated person.
  5. For Database, enter the database identify (for this put up, dev).
  6. Select Save.
  7. When you’re linked to the database, you possibly can validate the present logged-in person with the next SQL command:
    choose current_user;

  8. Now let’s validate that the advertising energy position has entry to the PII columns of the client desk:
    choose c_customer_id, c_first_name, c_last_name,c_customer_email from customershareddb.public.buyer restrict 10;

  9. Validate that the facility customers throughout the advertising group can now run a question to mix information throughout completely different datasets that they’ve entry to with a purpose to run efficient campaigns:
    SELECT
        emailaddress as emailAddress,  buyer.c_first_name as firstName, buyer.c_last_name as lastName, leadsource, contactnotes, usedpromo
    FROM
        "dev"."datalake"."lead" as lead
    JOIN ext_customerdb_shared.public.buyer as buyer
    ON lead.emailaddress = buyer.c_email_address
    WHERE lead.donotreachout="false"

Clear up

After you full the steps on this put up, to scrub up sources, delete the CloudFormation stack:

  1. On the AWS CloudFormation console, choose the stack you deployed to start with of this put up.
  2. Select Delete and observe the prompts to delete the stack.

Conclusion

On this put up, we confirmed how you should utilize Lake Formation tags and handle permissions to your information lake and Amazon Redshift information sharing utilizing Lake Formation. Utilizing Lake Formation LF-TBAC for information governance helps you handle your information lake and Amazon Redshift information sharing permissions at scale. Additionally, it permits information sharing throughout enterprise models with fine-grained entry management. Managing entry to your information lake and Redshift datashares in a single place permits higher governance, serving to with information safety and compliance.

You probably have questions or strategies, submit them within the feedback part.

For extra data on Lake Formation managed Amazon Redshift information sharing and tag-based entry management, consult with Centrally handle entry and permissions for Amazon Redshift information sharing with AWS Lake Formation and Simply handle your information lake at scale utilizing AWS Lake Formation Tag-based entry management.


Concerning the Authors

Praveen Kumar is an Analytics Resolution Architect at AWS with experience in designing, constructing, and implementing trendy information and analytics platforms utilizing cloud-native companies. His areas of pursuits are serverless expertise, trendy cloud information warehouses, streaming, and ML purposes.

Srividya Parthasarathy is a Senior Huge Knowledge Architect on the AWS Lake Formation group. She enjoys constructing information mesh options and sharing them with the group.

Paul Villena is an Analytics Options Architect in AWS with experience in constructing trendy information and analytics options to drive enterprise worth. He works with prospects to assist them harness the facility of the cloud. His areas of pursuits are infrastructure as code, serverless applied sciences, and coding in Python.

Mostafa Safipour is a Options Architect at AWS primarily based out of Sydney. He works with prospects to appreciate enterprise outcomes utilizing expertise and AWS. Over the previous decade, he has helped many massive organizations within the ANZ area construct their information, digital, and enterprise workloads on AWS.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments