Skip to content

Commit d11aaba

Browse files
Add optional custom stage name (#16)
* add optional custom stage name * Auto Format Co-authored-by: cloudpossebot <[email protected]>
1 parent a2c875f commit d11aaba

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

.github/renovate.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
":preserveSemverRanges"
55
],
66
"labels": ["auto-update"],
7+
"dependencyDashboardAutoclose": true,
78
"enabledManagers": ["terraform"],
89
"terraform": {
910
"ignorePaths": ["**/context.tf", "examples/**"]
1011
}
1112
}
12-

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ Available targets:
198198
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
199199
| <a name="input_rest_api_policy"></a> [rest\_api\_policy](#input\_rest\_api\_policy) | The IAM policy document for the API. | `string` | `null` | no |
200200
| <a name="input_stage"></a> [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
201+
| <a name="input_stage_name"></a> [stage\_name](#input\_stage\_name) | The name of the stage | `string` | `""` | no |
201202
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
202203
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
203204
| <a name="input_xray_tracing_enabled"></a> [xray\_tracing\_enabled](#input\_xray\_tracing\_enabled) | A flag to indicate whether to enable X-Ray tracing. | `bool` | `false` | no |

docs/terraform.md

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
6060
| <a name="input_rest_api_policy"></a> [rest\_api\_policy](#input\_rest\_api\_policy) | The IAM policy document for the API. | `string` | `null` | no |
6161
| <a name="input_stage"></a> [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
62+
| <a name="input_stage_name"></a> [stage\_name](#input\_stage\_name) | The name of the stage | `string` | `""` | no |
6263
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
6364
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
6465
| <a name="input_xray_tracing_enabled"></a> [xray\_tracing\_enabled](#input\_xray\_tracing\_enabled) | A flag to indicate whether to enable X-Ray tracing. | `bool` | `false` | no |

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ resource "aws_api_gateway_stage" "this" {
5353
count = local.enabled ? 1 : 0
5454
deployment_id = aws_api_gateway_deployment.this[0].id
5555
rest_api_id = aws_api_gateway_rest_api.this[0].id
56-
stage_name = module.this.stage
56+
stage_name = var.stage_name != "" ? var.stage_name : module.this.stage
5757
xray_tracing_enabled = var.xray_tracing_enabled
5858
tags = module.this.tags
5959

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,10 @@ variable "permissions_boundary" {
120120
type = string
121121
default = ""
122122
description = "ARN of the policy that is used to set the permissions boundary for the IAM role"
123+
}
124+
125+
variable "stage_name" {
126+
type = string
127+
default = ""
128+
description = "The name of the stage"
123129
}

0 commit comments

Comments
 (0)