1
1
2
2
provider "google" {
3
- project = " httparchive "
4
- region = " us-central1 "
3
+ project = var . project
4
+ region = var . region
5
5
request_timeout = " 60m"
6
6
}
7
7
8
8
terraform {
9
9
backend "gcs" {
10
10
bucket = " tf-state-backingapi-20230314"
11
- prefix = " dev "
11
+ prefix = var . environment
12
12
}
13
13
}
14
14
15
15
resource "google_api_gateway_api" "api" {
16
16
provider = google- beta
17
17
api_id = " api-gw-dev"
18
18
display_name = " The dev API Gateway"
19
- project = " httparchive "
19
+ project = var . project
20
20
}
21
21
22
22
# A Configuration, consisting of an OpenAPI specification
23
23
resource "google_api_gateway_api_config" "api_config" {
24
24
provider = google- beta
25
25
api = google_api_gateway_api. api . api_id
26
26
api_config_id_prefix = " api"
27
- project = " httparchive "
27
+ project = var . project
28
28
display_name = " The dev Config"
29
29
openapi_documents {
30
30
document {
@@ -39,84 +39,65 @@ schemes:
39
39
- https
40
40
produces:
41
41
- application/json
42
+ x-google-backend:
43
+ address: https://us-central1-httparchive.cloudfunctions.net/tech-report-api-dev
44
+ deadline: 60
45
+ path_translation: APPEND_PATH_TO_ADDRESS
46
+ protocol: h2
42
47
paths:
43
- /v1/ categories:
48
+ /categories:
44
49
get:
45
50
summary: categories
46
51
operationId: getCategories
47
- x-google-backend:
48
- address: https://us-central1-httparchive.cloudfunctions.net/tech-report-api-dev/categories
49
- deadline: 60
50
52
responses:
51
53
200:
52
54
description: String
53
55
/v1/adoption:
54
56
get:
55
57
summary: adoption
56
58
operationId: getadoptionReports
57
- x-google-backend:
58
- address: https://us-central1-httparchive.cloudfunctions.net/tech-report-api-dev/adoption
59
- deadline: 60
60
59
responses:
61
60
200:
62
61
description: String
63
62
/v1/page-weight:
64
63
get:
65
64
summary: pageWeight
66
65
operationId: getpageWeight
67
- x-google-backend:
68
- address: https://us-central1-httparchive.cloudfunctions.net/tech-report-api-dev/page-weight
69
- deadline: 60
70
66
responses:
71
67
200:
72
68
description: String
73
69
/v1/lighthouse:
74
70
get:
75
71
summary: lighthouse
76
72
operationId: getLighthouseReports
77
- x-google-backend:
78
- address: https://us-central1-httparchive.cloudfunctions.net/tech-report-api-dev/lighthouse
79
- deadline: 60
80
73
responses:
81
74
200:
82
75
description: String
83
76
/v1/cwv:
84
77
get:
85
78
summary: cwv
86
79
operationId: getCwv
87
- x-google-backend:
88
- address: https://us-central1-httparchive.cloudfunctions.net/tech-report-api-dev/cwv
89
- deadline: 60
90
80
responses:
91
81
200:
92
82
description: String
93
83
/v1/ranks:
94
84
get:
95
85
summary: ranks
96
86
operationId: getRanks
97
- x-google-backend:
98
- address: https://us-central1-httparchive.cloudfunctions.net/tech-report-api-dev/ranks
99
- deadline: 60
100
87
responses:
101
88
200:
102
89
description: String
103
90
/v1/geos:
104
91
get:
105
92
summary: geos
106
93
operationId: getGeos
107
- x-google-backend:
108
- address: https://us-central1-httparchive.cloudfunctions.net/tech-report-api-dev/geos
109
- deadline: 60
110
94
responses:
111
95
200:
112
96
description: String
113
97
/v1/technologies:
114
98
get:
115
99
summary: technologies
116
100
operationId: getTechnologies
117
- x-google-backend:
118
- address: https://us-central1-httparchive.cloudfunctions.net/tech-report-api-dev/technologies
119
- deadline: 60
120
101
responses:
121
102
200:
122
103
description: String
133
114
# The actual API Gateway
134
115
resource "google_api_gateway_gateway" "gateway" {
135
116
provider = google- beta
136
- project = " httparchive "
137
- region = " us-central1 "
117
+ project = var . project
118
+ region = var . region
138
119
api_config = google_api_gateway_api_config. api_config . id
139
120
gateway_id = " dev-gw"
140
121
display_name = " devApi Gateway"
@@ -153,7 +134,7 @@ resource "google_api_gateway_gateway" "gateway" {
153
134
module "endpoints" {
154
135
source = " ./../modules/run-service"
155
136
entry_point = " app"
156
- project = " httparchive "
137
+ project = var . project
157
138
environment = var. environment
158
139
source_directory = " ../../src"
159
140
function_name = " tech-report-api"
0 commit comments