Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge develop #109

Merged
merged 4 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ This README is organized into four parts: <br>

Tag Engine v2 comes with two Cloud Run services. One service is for the API (`tag-engine-api`) and the other is for the UI (`tag-engine-ui`).

The Cloud Run API service uses Bearer token headers for authentication.

The Cloud Run UI service uses OAuth for authentication. It also uses the OAuth client's credentials (`client_secret.json`) for impersonation.
Both services use access tokens for authorization. The API service expects the client to pass in an access token when calling the API functions whereas the UI service uses OAuth to authorize the client from the front end. The client secret file is required for the OAuth flow.

Follow the 6 steps below to deploy Tag Engine v2 with Terraform and without a load balancer.

Expand Down
22 changes: 18 additions & 4 deletions deploy/external_load_balancer/cloud_run.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,15 @@ resource "google_cloud_run_v2_service" "api_service" {
}

containers {
image = null_resource.build_api_image.triggers.full_image_path
}
image = null_resource.build_api_image.triggers.full_image_path

resources {
limits = {
memory = "1024Mi"
}
cpu_idle = true
}
}
}
depends_on = [null_resource.build_api_image]
}
Expand Down Expand Up @@ -126,9 +133,16 @@ resource "google_cloud_run_v2_service" "ui_service" {
}

containers {

image = null_resource.build_ui_image.triggers.full_image_path
image = null_resource.build_ui_image.triggers.full_image_path

resources {
limits = {
memory = "1024Mi"
}
cpu_idle = true
}
}

vpc_access {
connector = google_vpc_access_connector.connector.id
egress = "PRIVATE_RANGES_ONLY"
Expand Down
2 changes: 1 addition & 1 deletion deploy/external_load_balancer/iam_bindings.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ resource "google_project_iam_binding" "PolicyTagReader" {
}

resource "google_project_iam_binding" "BigQuerySchemaUpdate" {
project = var.tag_engine_project
project = var.bigquery_project
role = "projects/${var.bigquery_project}/roles/BigQuerySchemaUpdate"
members = ["serviceAccount:${var.tag_creator_sa}"]
depends_on = [google_project_service.tag_engine_project]
Expand Down
2 changes: 1 addition & 1 deletion deploy/external_load_balancer/task_queues.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "google_cloud_tasks_queue" "work_queue" {
}

retry_config {
max_attempts = 1
max_attempts = 2
}

stackdriver_logging_config {
Expand Down
24 changes: 18 additions & 6 deletions deploy/without_load_balancer/cloud_run.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ resource "google_artifact_registry_repository" "image_registry" {
depends_on = [google_project_service.tag_engine_project]
}


# ************************************************************ #
# Create the Cloud Run API service
# ************************************************************ #
Expand Down Expand Up @@ -57,8 +56,15 @@ resource "google_cloud_run_v2_service" "api_service" {
}

containers {
image = null_resource.build_api_image.triggers.full_image_path
}
image = null_resource.build_api_image.triggers.full_image_path

resources {
limits = {
memory = "1024Mi"
}
cpu_idle = true
}
}
}
depends_on = [null_resource.build_api_image]
}
Expand Down Expand Up @@ -118,9 +124,15 @@ resource "google_cloud_run_v2_service" "ui_service" {
}

containers {

image = null_resource.build_ui_image.triggers.full_image_path
}
image = null_resource.build_ui_image.triggers.full_image_path

resources {
limits = {
memory = "1024Mi"
}
cpu_idle = true
}
}
}
depends_on = [null_resource.build_ui_image]
}
Expand Down
2 changes: 1 addition & 1 deletion deploy/without_load_balancer/iam_bindings.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ resource "google_project_iam_binding" "PolicyTagReader" {
}

resource "google_project_iam_binding" "BigQuerySchemaUpdate" {
project = var.tag_engine_project
project = var.bigquery_project
role = "projects/${var.bigquery_project}/roles/BigQuerySchemaUpdate"
members = ["serviceAccount:${var.tag_creator_sa}"]
depends_on = [google_project_service.tag_engine_project]
Expand Down
2 changes: 1 addition & 1 deletion deploy/without_load_balancer/task_queues.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "google_cloud_tasks_queue" "work_queue" {
}

retry_config {
max_attempts = 1
max_attempts = 2
}

stackdriver_logging_config {
Expand Down
Loading