-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy paths3.tf
More file actions
62 lines (60 loc) · 1.69 KB
/
s3.tf
File metadata and controls
62 lines (60 loc) · 1.69 KB
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
55
56
57
58
59
60
61
62
resource "aws_s3_bucket" "unison_cloud_byoc_native_services" {
bucket_prefix = "unison-cloud-byoc-services"
force_destroy = true
}
resource "aws_s3_bucket" "unison_cloud_byoc_blobs" {
bucket_prefix = "unison-cloud-byoc-blobs"
force_destroy = true
}
resource "aws_iam_policy" "byoc_container_s3_policy" {
description = "build servers need to docker push, connect to rds"
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
"Effect" : "Allow",
"Action" : [
"ecr:*"
],
"Resource" : "*"
},
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:ListBucketVersions",
],
"Resource": [ aws_s3_bucket.unison_cloud_byoc_native_services.arn,
aws_s3_bucket.unison_cloud_byoc_blobs.arn ]
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:GetObjectVersion",
"s3:PutObject",
"s3:DeleteObject",
"s3:DeleteObjectVersion",
"s3:AbortMultipartUpload"
],
"Resource": [ "${aws_s3_bucket.unison_cloud_byoc_native_services.arn}/*",
"${aws_s3_bucket.unison_cloud_byoc_blobs.arn}/*"]
},
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:ConditionCheckItem",
"dynamodb:TransactWriteItems",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem",
"dynamodb:BatchGetItem",
"dynamodb:BatchWriteItem",
"dynamodb:Scan"
],
"Resource": [ "${aws_dynamodb_table.unison_cloud_byoc_state.arn}" ]
}
]
})
}