amazon-web-servicesaws-glueamazon-athenaaws-lake-formation

AWS Lake Formation: Grant permission for one role to ALL databases


Is it possible to somehow grant permissions to ALL available databases in Lake Formation? Using the AWS UI I'm able to grant permission to individual databases. However I'm looking for a way to grant permissions to all available databases. Is that possible somehow?


Solution

  • Figured out how to use the CLI for that for individual databases. However, AWS confirms theres no API available for batch processing. Anyway this can be modified in a batch script or whatever one prefers to make it work in a batch style:

    aws lakeformation grant-permissions --profile <your-profile> --principal '{"DataLakePrincipalIdentifier": "arn:aws:iam::<account-id>:role/<role>"}' --resource '{"Database": {"Name": "<database-name>", "CatalogId": "<account-id>"}}' --permissions ALL --permissions-with-grant-option ALL