-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnowflake-iam.tf
41 lines (38 loc) · 933 Bytes
/
snowflake-iam.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
resource "aws_iam_user" "snowflake-user" {
name = "snowflake-user"
}
resource "aws_iam_access_key" "snowflake-user" {
user = "${aws_iam_user.snowflake-user.name}"
}
resource "aws_iam_user_policy" "snowflake-user-policy" {
name = "test"
user = "${aws_iam_user.snowflake-user.name}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:GetObjectVersion"
],
"Resource": "arn:aws:s3:::<bucket>/<prefix>/*"
},
{
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::<bucket>",
"Condition": {
"StringLike": {
"s3:prefix": [
"*"
]
}
}
}
]
}
EOF
}