-
Notifications
You must be signed in to change notification settings - Fork 0
/
permissions.tf
55 lines (47 loc) · 1.54 KB
/
permissions.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
55
resource "google_project_iam_custom_role" "ff-byos-object-permissions" {
role_id = "firefliesai_gcp_byos_role_new"
title = "Fireflies AI BYOS Role New"
description = "Fireflies AI BYOS Role"
permissions = [
"storage.objects.create",
"storage.objects.delete",
"storage.objects.get",
"storage.objects.getIamPolicy",
"storage.objects.list",
"storage.objects.update"
]
}
resource "google_project_iam_custom_role" "bucket-permissions" {
role_id = "firefliesai_gcp_byos_bucket_role"
title = "Fireflies AI BYOS Bucket Role"
description = "Fireflies AI BYOS Bucket Role"
permissions = [
"storage.buckets.list",
"storage.buckets.get",
"storage.buckets.getIamPolicy"
]
}
resource "google_project_iam_binding" "project" {
project = var.project_id
role = resource.google_project_iam_custom_role.ff-byos-object-permissions.id
members = [
"serviceAccount:${var.service_account_email}",
]
condition {
title = "limit_access_to_objects"
description = "Limit object access to specific buckets"
expression = "resource.name.startsWith('projects/_/buckets/${var.bucket_name}/objects/')"
}
}
resource "google_project_iam_binding" "bucket" {
project = var.project_id
role = resource.google_project_iam_custom_role.bucket-permissions.id
members = [
"serviceAccount:${var.service_account_email}",
]
condition {
title = "read_bucket_metadata"
description = "Read Bucket Metadata"
expression = "resource.name.startsWith('projects/_/buckets/')"
}
}