generated from thclark/django-rabid-armadillo
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from octue/updates-pre-unfold
Updates pre unfold
- Loading branch information
Showing
7 changed files
with
164 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,51 @@ | ||
# You need to start with a service account called "terraform" which has both the 'editor' and 'owner' basic permissions. | ||
# This allows it to assign permissions to resources per https://cloud.google.com/iam/docs/understanding-roles | ||
# | ||
# Start by assigning the permissions that it needs itself | ||
|
||
# Allows django-gcp.tasks to create periodic tasks for you using google cloud scheduler | ||
# resource "google_project_iam_binding" "terraform_serviceaccount_bindings" { | ||
# count = length(var.terraform_serviceaccount_roles) | ||
# project = var.project | ||
# role = var.terraform_serviceaccount_roles[count.index] | ||
# members = [ | ||
# "serviceAccount:terraform@octue-django-gcp.iam.gserviceaccount.com", | ||
# ] | ||
# } | ||
|
||
|
||
resource "google_service_account" "dev_thclark" { | ||
account_id = "dev-thclark" | ||
display_name = "dev-thclark" | ||
project = "octue-django-gcp" | ||
project = var.project | ||
} | ||
|
||
|
||
resource "google_service_account" "dev_lukasvinclav" { | ||
account_id = "dev-lukasvinclav" | ||
display_name = "dev-lukasvinclav" | ||
project = var.project | ||
} | ||
|
||
|
||
# For iam bindings to storage buckets see terraform/storage.tf | ||
|
||
|
||
resource "google_project_iam_binding" "errorreporting_writer" { | ||
project = var.project | ||
role = "roles/errorreporting.writer" | ||
members = [ | ||
"serviceAccount:${google_service_account.dev_thclark.email}", | ||
"serviceAccount:${google_service_account.dev_lukasvinclav.email}", | ||
] | ||
} | ||
|
||
|
||
# Allows django-gcp.tasks to create periodic tasks for you using google cloud scheduler | ||
# resource "google_project_iam_binding" "cloudscheduler_jobs_update" { | ||
# project = var.project | ||
# role = "roles/CloudSchedulerAdmin" | ||
# Allow django-gcp.tasks to create and update task queues | ||
resource "google_project_iam_binding" "cloudtasks_admin" { | ||
project = var.project | ||
role = "roles/cloudtasks.admin" | ||
members = [ | ||
"serviceAccount:${google_service_account.dev_thclark.email}", | ||
"serviceAccount:${google_service_account.dev_lukasvinclav.email}", | ||
] | ||
} | ||
|
||
|
||
# members = [ | ||
# "serviceAccount:${google_service_account.dev_thclark.email}", | ||
# ] | ||
# } | ||
# Allow django-gcp.tasks to create periodic tasks in google cloud scheduler | ||
resource "google_project_iam_binding" "cloudscheduler_admin" { | ||
project = var.project | ||
role = "roles/cloudscheduler.admin" | ||
members = [ | ||
"serviceAccount:${google_service_account.dev_thclark.email}", | ||
"serviceAccount:${google_service_account.dev_lukasvinclav.email}", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
tests/server/example/migrations/0006_examplemultipleblobfieldmodel.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Generated by Django 4.1.7 on 2023-11-17 15:19 | ||
|
||
import django_gcp.storage.fields | ||
from django.db import migrations, models | ||
|
||
import tests.server.example.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("example", "0005_examplecallbackblobfieldmodel_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="ExampleMultipleBlobFieldModel", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("category", models.CharField(blank=True, max_length=20, null=True)), | ||
( | ||
"blob1", | ||
django_gcp.storage.fields.BlobField( | ||
accept_mimetype="*/*", | ||
default=None, | ||
get_destination_path=tests.server.example.models.get_destination_path, | ||
help_text="GCP cloud storage object", | ||
ingress_to="_tmp/", | ||
on_change=None, | ||
overwrite_mode="never", | ||
store_key="media", | ||
), | ||
), | ||
( | ||
"blob2", | ||
django_gcp.storage.fields.BlobField( | ||
accept_mimetype="*/*", | ||
default=None, | ||
get_destination_path=tests.server.example.models.get_destination_path, | ||
help_text="GCP cloud storage object", | ||
ingress_to="_tmp/", | ||
on_change=None, | ||
overwrite_mode="never", | ||
store_key="media", | ||
), | ||
), | ||
( | ||
"blob3", | ||
django_gcp.storage.fields.BlobField( | ||
accept_mimetype="*/*", | ||
default=None, | ||
get_destination_path=tests.server.example.models.get_destination_path, | ||
help_text="GCP cloud storage object", | ||
ingress_to="_tmp/", | ||
on_change=None, | ||
overwrite_mode="never", | ||
store_key="media", | ||
), | ||
), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters