Skip to content

Commit 665781f

Browse files
committed
chore: add variable for default stage name
1 parent 8bd0adb commit 665781f

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ No modules.
138138
| <a name="input_default_route_settings"></a> [default\_route\_settings](#input\_default\_route\_settings) | Settings for default route | `map(string)` | `{}` | no |
139139
| <a name="input_default_stage_access_log_destination_arn"></a> [default\_stage\_access\_log\_destination\_arn](#input\_default\_stage\_access\_log\_destination\_arn) | Default stage's ARN of the CloudWatch Logs log group to receive access logs. Any trailing :* is trimmed from the ARN. | `string` | `null` | no |
140140
| <a name="input_default_stage_access_log_format"></a> [default\_stage\_access\_log\_format](#input\_default\_stage\_access\_log\_format) | Default stage's single line format of the access logs of data, as specified by selected $context variables. | `string` | `null` | no |
141+
| <a name="input_default_stage_name"></a> [default\_stage\_name](#input\_default\_stage\_name) | The name of the default stage | `string` | `"$default"` | no |
141142
| <a name="input_default_stage_tags"></a> [default\_stage\_tags](#input\_default\_stage\_tags) | A mapping of tags to assign to the default stage resource. | `map(string)` | `{}` | no |
142143
| <a name="input_description"></a> [description](#input\_description) | The description of the API. | `string` | `null` | no |
143144
| <a name="input_disable_execute_api_endpoint"></a> [disable\_execute\_api\_endpoint](#input\_disable\_execute\_api\_endpoint) | Whether clients can invoke the API by using the default execute-api endpoint. To require that clients use a custom domain name to invoke the API, disable the default endpoint | `string` | `false` | no |

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ resource "aws_apigatewayv2_stage" "default" {
6363
count = var.create && var.create_default_stage ? 1 : 0
6464

6565
api_id = aws_apigatewayv2_api.this[0].id
66-
name = "$default"
66+
name = var.default_stage_name
6767
auto_deploy = true
6868

6969
dynamic "access_log_settings" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ variable "tags" {
145145

146146
#####
147147
# default stage
148+
variable "default_stage_name" {
149+
description = "The name of the default stage"
150+
type = string
151+
default = "$default"
152+
}
153+
148154
variable "default_stage_access_log_destination_arn" {
149155
description = "Default stage's ARN of the CloudWatch Logs log group to receive access logs. Any trailing :* is trimmed from the ARN."
150156
type = string

0 commit comments

Comments
 (0)