IAM CreateTable 权限仅适用于 Athena 上的一个数据库
IAM CreateTable permission for one database only on Athena
我有一个组,我想向其授予对 Athena 中一个数据库的 CreateTable
权限,同时对同一组的所有数据库应用较小的权限,例如 RunQuery
。是否可以根据具体情况对 Athena 数据库应用权限?
例如,在下面的 IAM 策略中,我想赋予该组在测试数据库中创建和删除表的能力。
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"athena:RunQuery",
"athena:StartQueryExecution",
"athena:StopQueryExecution"
],
"Resource": [
"*" // Apply these permissions on all schemas
]
},
{
"Effect": "Allow",
"Action": [
"glue:CreateTable",
"glue:DeleteTable"
],
"Resource": [
"test" // Apply these permissions to only the test database
]
}
]
}
谢谢!
在您问这个问题时,无法授予对特定数据库和 table 的权限,但现在可以了。
目录权限、数据库权限、table三个权限(对于table权限,数据库权限只需要前两个)。
下面是一个示例,说明如何在 us-east-1 的帐户 1234567890 中为名为 my_db
的数据库中的所有 table 授予创建、更新和删除权限的示例:
{
"Effect": "Allow",
"Action": [
"glue:CreateTable",
"glue:UpdateTable",
"glue:DeleteTable"
],
"Resource": [
"arn:aws:glue:us-east-1:1234567890:catalog",
"arn:aws:glue:us-east-1:1234567890:database/my_db",
"arn:aws:glue:us-east-1:1234567890:table/my_db/*"
]
}
可以对数据库名称或部分数据库名称使用通配符(例如,如果您想授予对具有特定前缀的所有数据库的某些权限),table 名称也是如此。
我有一个组,我想向其授予对 Athena 中一个数据库的 CreateTable
权限,同时对同一组的所有数据库应用较小的权限,例如 RunQuery
。是否可以根据具体情况对 Athena 数据库应用权限?
例如,在下面的 IAM 策略中,我想赋予该组在测试数据库中创建和删除表的能力。
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"athena:RunQuery",
"athena:StartQueryExecution",
"athena:StopQueryExecution"
],
"Resource": [
"*" // Apply these permissions on all schemas
]
},
{
"Effect": "Allow",
"Action": [
"glue:CreateTable",
"glue:DeleteTable"
],
"Resource": [
"test" // Apply these permissions to only the test database
]
}
]
}
谢谢!
在您问这个问题时,无法授予对特定数据库和 table 的权限,但现在可以了。
目录权限、数据库权限、table三个权限(对于table权限,数据库权限只需要前两个)。
下面是一个示例,说明如何在 us-east-1 的帐户 1234567890 中为名为 my_db
的数据库中的所有 table 授予创建、更新和删除权限的示例:
{
"Effect": "Allow",
"Action": [
"glue:CreateTable",
"glue:UpdateTable",
"glue:DeleteTable"
],
"Resource": [
"arn:aws:glue:us-east-1:1234567890:catalog",
"arn:aws:glue:us-east-1:1234567890:database/my_db",
"arn:aws:glue:us-east-1:1234567890:table/my_db/*"
]
}
可以对数据库名称或部分数据库名称使用通配符(例如,如果您想授予对具有特定前缀的所有数据库的某些权限),table 名称也是如此。