@@ -134,7 +134,7 @@ resource "aws_api_gateway_method_response" "db" {
134
134
135
135
resource "aws_api_gateway_deployment" "this" {
136
136
rest_api_id = aws_api_gateway_rest_api. this . id
137
- stage_name = local . api_gateway_stage_name
137
+
138
138
# explicit depends_on required to ensure module stands up on first `apply`
139
139
# otherwise a second followup `apply` would be required
140
140
# can read more here: https://stackoverflow.com/a/42783769
@@ -146,9 +146,19 @@ resource "aws_api_gateway_deployment" "this" {
146
146
}
147
147
}
148
148
149
+ resource "aws_api_gateway_stage" "this" {
150
+ deployment_id = aws_api_gateway_deployment. this . id
151
+ rest_api_id = aws_api_gateway_rest_api. this . id
152
+ stage_name = local. api_gateway_stage_name
153
+
154
+ tags = var. standard_tags
155
+ }
156
+
149
157
resource "aws_api_gateway_api_key" "this" {
150
158
count = var. api_basic_auth ? 1 : 0
151
159
name = local. api_gateway_key_name
160
+
161
+ tags = var. standard_tags
152
162
}
153
163
154
164
resource "aws_api_gateway_usage_plan" "this" {
@@ -157,8 +167,10 @@ resource "aws_api_gateway_usage_plan" "this" {
157
167
158
168
api_stages {
159
169
api_id = aws_api_gateway_rest_api. this . id
160
- stage = local . api_gateway_stage_name
170
+ stage = aws_api_gateway_deployment . this . stage_name
161
171
}
172
+
173
+ tags = var. standard_tags
162
174
}
163
175
164
176
resource "aws_api_gateway_usage_plan_key" "this" {
0 commit comments