Skip to content

Commit b8a8711

Browse files
nheijmanskeetonian
authored andcommitted
feat(policy-templates): add AthenaQueryPolicy template (#1137)
1 parent b208db1 commit b8a8711

File tree

5 files changed

+1878
-1742
lines changed

5 files changed

+1878
-1742
lines changed

samtranslator/policy_templates_data/policy_templates.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,6 +1795,60 @@
17951795
}
17961796
]
17971797
}
1798+
},
1799+
"AthenaQueryPolicy": {
1800+
"Description": "Gives permissions to execute Athena queries",
1801+
"Parameters": {
1802+
"WorkGroupName": {
1803+
"Description": "Name of the Athena Workgroup"
1804+
}
1805+
},
1806+
"Definition": {
1807+
"Statement": [
1808+
{
1809+
"Effect": "Allow",
1810+
"Action": [
1811+
"athena:ListWorkGroups",
1812+
"athena:GetExecutionEngine",
1813+
"athena:GetExecutionEngines",
1814+
"athena:GetNamespace",
1815+
"athena:GetCatalogs",
1816+
"athena:GetNamespaces",
1817+
"athena:GetTables",
1818+
"athena:GetTable"
1819+
],
1820+
"Resource": "*"
1821+
},
1822+
{
1823+
"Effect": "Allow",
1824+
"Action": [
1825+
"athena:StartQueryExecution",
1826+
"athena:GetQueryResults",
1827+
"athena:DeleteNamedQuery",
1828+
"athena:GetNamedQuery",
1829+
"athena:ListQueryExecutions",
1830+
"athena:StopQueryExecution",
1831+
"athena:GetQueryResultsStream",
1832+
"athena:ListNamedQueries",
1833+
"athena:CreateNamedQuery",
1834+
"athena:GetQueryExecution",
1835+
"athena:BatchGetNamedQuery",
1836+
"athena:BatchGetQueryExecution",
1837+
"athena:GetWorkGroup"
1838+
],
1839+
"Resource": {
1840+
"Fn::Sub": [
1841+
"arn:${AWS::Partition}:athena:${AWS::Region}:${AWS::AccountId}:workgroup/${workgroupName}",
1842+
{
1843+
"workgroupName": {
1844+
"Ref": "WorkGroupName"
1845+
}
1846+
}
1847+
]
1848+
}
1849+
}
1850+
]
1851+
}
17981852
}
17991853
}
18001854
}

tests/translator/input/all_policy_templates.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,7 @@ Resources:
155155
RepositoryName: name
156156

157157
- KMSEncryptPolicy:
158-
KeyId: keyId
158+
KeyId: keyId
159+
160+
- AthenaQueryPolicy:
161+
WorkGroupName: name

0 commit comments

Comments
 (0)