-
Notifications
You must be signed in to change notification settings - Fork 0
/
twindb.tf
54 lines (51 loc) · 1.37 KB
/
twindb.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
42
43
44
45
46
47
48
49
50
51
52
53
54
resource "aws_iam_policy" "TwinDBTestRunner" {
provider = aws.aws-303467602807-uw1
name = "TwinDBTestRunner"
description = "Policy for TwinDB Backup integration tests"
policy = jsonencode(
{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" : [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource" : [
"arn:aws:s3:::twindb-backup-test-*"
]
},
{
"Effect" : "Allow",
"Action" : "s3:ListBucket",
"Resource" : "arn:aws:s3:::twindb-backup-test-*"
},
{
"Effect" : "Allow",
"Action" : [
"s3:CreateBucket",
"s3:DeleteBucket",
],
"Resource" : [
"arn:aws:s3:::twindb-backup-test-*"
]
}
]
}
)
}
resource "aws_iam_user" "twindb_test_runner" {
provider = aws.aws-303467602807-uw1
name = "twindb_test_runner"
}
resource "aws_iam_access_key" "twindb_test_runner" {
provider = aws.aws-303467602807-uw1
user = aws_iam_user.twindb_test_runner.name
}
resource "aws_iam_user_policy_attachment" "twindb_test_runner" {
provider = aws.aws-303467602807-uw1
policy_arn = aws_iam_policy.TwinDBTestRunner.arn
user = aws_iam_user.twindb_test_runner.name
}