Skip to content

Commit 7523248

Browse files
committed
fix vars
1 parent e65c4dc commit 7523248

File tree

6 files changed

+85
-104
lines changed

6 files changed

+85
-104
lines changed

.github/workflows/pipeline.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ name: Tech Report API Pipeline
33
on: [push]
44

55
env:
6-
PIPELINE_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
76
PIPELINE_SA_KEY: ${{ secrets.GCP_SA_KEY }}
8-
PIPELINE_PROJECT_DATABASE_DEV: ${{ secrets.GCP_PROJECT_DATABASE_DEV }}
9-
PIPELINE_PROJECT_DATABASE_PROD: ${{ secrets.GCP_PROJECT_DATABASE_PROD }}
107
PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS: ${{ secrets.GCP_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}
118
PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY: ${{ secrets.GCP_SERVICE_ACCOUNT_API_GATEWAY }}
129

@@ -40,7 +37,7 @@ jobs:
4037
- name: Google Cloud Auth
4138
uses: 'google-github-actions/auth@v2'
4239
with:
43-
project_id: ${{ env.PIPELINE_PROJECT_ID }}
40+
project_id: 'httparchive'
4441
credentials_json: ${{ env.PIPELINE_SA_KEY }}
4542

4643
- uses: hashicorp/setup-terraform@v3
@@ -62,8 +59,7 @@ jobs:
6259
id: plan
6360
run: |
6461
terraform plan -no-color -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
65-
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
66-
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_DEV }}"
62+
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}"
6763
continue-on-error: true
6864

6965
- name: Terraform Plan status
@@ -75,7 +71,6 @@ jobs:
7571
run: |
7672
terraform apply -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
7773
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
78-
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_DEV }}" \
7974
-auto-approve
8075
8176
deploy_production:
@@ -90,7 +85,7 @@ jobs:
9085
- name: Google Cloud Auth
9186
uses: 'google-github-actions/auth@v2'
9287
with:
93-
project_id: ${{ env.PIPELINE_PROJECT_ID }}
88+
project_id: 'httparchive'
9489
credentials_json: ${{ env.PIPELINE_SA_KEY }}
9590

9691
- uses: hashicorp/setup-terraform@v3
@@ -112,8 +107,7 @@ jobs:
112107
id: plan
113108
run: |
114109
terraform plan -no-color -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
115-
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
116-
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_PROD }}"
110+
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}"
117111
continue-on-error: true
118112

119113
- name: Terraform Plan status
@@ -125,6 +119,5 @@ jobs:
125119
run: |
126120
terraform apply -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
127121
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
128-
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_PROD }}" \
129122
-auto-approve
130123

terraform/dev/main.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ module "endpoints" {
140140
region = var.region
141141
service_account_email = var.google_service_account_cloud_functions
142142
service_account_api_gateway = var.google_service_account_api_gateway
143-
max_instance_request_concurrency = var.max_instance_request_concurrency
144-
min_instances = var.min_instances
145143
environment_variables = {
146144
"PROJECT" = var.project
147145
"DATABASE" = var.project_database

terraform/dev/variables.tf

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,28 @@
1-
variable "google_service_account_cloud_functions" {
2-
type = string
3-
description = "Service account for Cloud Functions"
4-
}
5-
6-
variable "google_service_account_api_gateway" {
7-
type = string
8-
description = "Service account for API Gateway"
9-
}
10-
11-
variable "project_database" {
1+
variable "project" {
2+
description = "The project name"
123
type = string
13-
description = "The database name"
14-
15-
}
16-
17-
variable "min_instances" {
18-
description = "(Optional) The limit on the minimum number of function instances that may coexist at a given time."
19-
type = number
20-
default = 0
21-
}
22-
23-
variable "max_instance_request_concurrency" {
24-
description = "(Optional) The limit on the maximum number of requests that an instance can handle simultaneously. This can be used to control costs when scaling. Defaults to 1."
25-
type = number
26-
default = 1
4+
default = "httparchive"
275
}
28-
296
variable "region" {
30-
default = "us-central1"
317
type = string
8+
default = "us-central1"
329
}
33-
3410
variable "environment" {
3511
description = "The environment name"
3612
type = string
3713
default = "dev"
3814
}
15+
variable "project_database" {
16+
type = string
17+
description = "The database name"
18+
default = "tech-report-apis-prod" // TODO: Update this to the correct database name
19+
}
3920

40-
variable "project" {
41-
description = "The project name"
21+
variable "google_service_account_cloud_functions" {
4222
type = string
43-
default = "httparchive"
23+
description = "Service account for Cloud Functions"
24+
}
25+
variable "google_service_account_api_gateway" {
26+
type = string
27+
description = "Service account for API Gateway"
4428
}

terraform/modules/run-service/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ variable "service_account_api_gateway" {
5454
description = "API Gateway service account who can invoke this function. This is required!"
5555
}
5656
variable "max_instances" {
57-
default = 5
57+
default = 1
5858
type = number
5959
description = "(Optional) The limit on the maximum number of function instances that may coexist at a given time."
6060
}
@@ -66,7 +66,7 @@ variable "min_instances" {
6666
variable "max_instance_request_concurrency" {
6767
description = "(Optional) The limit on the maximum number of requests that an instance can handle simultaneously. This can be used to control costs when scaling. Defaults to 1."
6868
type = number
69-
default = 5
69+
default = 1
7070
}
7171
variable "environment_variables" {
7272
description = "environment_variables"

0 commit comments

Comments
 (0)