Skip to content

Commit fc391a7

Browse files
authored
Add Support for Cache TTL (#37)
* add cache ttl * add eol
1 parent b6948f6 commit fc391a7

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ API gateway module for REST API. There is no community module available for REST
4747
| <a name="input_cache_cluster_enabled"></a> [cache\_cluster\_enabled](#input\_cache\_cluster\_enabled) | Specifies whether a cache cluster is enabled for the stage. | `bool` | `false` | no |
4848
| <a name="input_cache_cluster_size"></a> [cache\_cluster\_size](#input\_cache\_cluster\_size) | The size of the cache cluster for the stage, if enabled | `string` | `"0.5"` | no |
4949
| <a name="input_cache_data_encrypted"></a> [cache\_data\_encrypted](#input\_cache\_data\_encrypted) | Specifies whether a cache data needs to be encrypted. | `bool` | `true` | no |
50+
| <a name="input_cache_ttl"></a> [cache\_ttl](#input\_cache\_ttl) | The cache TTL of the stage | `number` | `300` | no |
5051
| <a name="input_caching_enabled"></a> [caching\_enabled](#input\_caching\_enabled) | Specifies whether caching is enabled for the API gateway method | `bool` | `false` | no |
5152
| <a name="input_data_trace_enabled"></a> [data\_trace\_enabled](#input\_data\_trace\_enabled) | Specifies the logging level for this method. | `bool` | `false` | no |
5253
| <a name="input_enable_global_apigw_logging"></a> [enable\_global\_apigw\_logging](#input\_enable\_global\_apigw\_logging) | Enable global apigw logging | `bool` | `false` | no |
@@ -62,6 +63,7 @@ API gateway module for REST API. There is no community module available for REST
6263
| <a name="input_stage"></a> [stage](#input\_stage) | Name of the API gateway stage | `string` | n/a | yes |
6364
| <a name="input_stage_variables"></a> [stage\_variables](#input\_stage\_variables) | Stage variables for the API gateway stage | `map(any)` | `{}` | no |
6465
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |
66+
| <a name="input_tf_resources_hash"></a> [tf\_resources\_hash](#input\_tf\_resources\_hash) | for api gateways that are not using body\_template and are using terraform resources | `string` | `""` | no |
6567
| <a name="input_throttling_burst_limit"></a> [throttling\_burst\_limit](#input\_throttling\_burst\_limit) | The API request burst limit, the maximum rate limit over a time ranging from one to a few seconds, depending upon whether the underlying token bucket is at its full capacity. | `number` | `1000` | no |
6668
| <a name="input_throttling_rate_limit"></a> [throttling\_rate\_limit](#input\_throttling\_rate\_limit) | The API request steady-state rate limit | `number` | `1000` | no |
6769
| <a name="input_types"></a> [types](#input\_types) | Name of the API gateway stage | `list(string)` | <pre>[<br> "REGIONAL"<br>]</pre> | no |
@@ -80,3 +82,4 @@ API gateway module for REST API. There is no community module available for REST
8082
| <a name="output_aws_api_gateway_stage_name"></a> [aws\_api\_gateway\_stage\_name](#output\_aws\_api\_gateway\_stage\_name) | Stage name of the deployed api gateway stage |
8183
| <a name="output_aws_api_gateway_vpc_link_id"></a> [aws\_api\_gateway\_vpc\_link\_id](#output\_aws\_api\_gateway\_vpc\_link\_id) | VPC link id |
8284
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
85+
<!-- END_TF_DOCS -->

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ resource "aws_api_gateway_method_settings" "method_settings" {
9797
throttling_rate_limit = var.throttling_rate_limit
9898
cache_data_encrypted = var.cache_data_encrypted
9999
caching_enabled = var.caching_enabled
100+
cache_ttl_in_seconds = var.cache_ttl
100101
}
101102
}
102103

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ variable "cache_cluster_size" {
7878
default = "0.5"
7979
}
8080

81+
variable "cache_ttl" {
82+
description = "The cache TTL of the stage"
83+
type = number
84+
default = 300
85+
}
86+
8187
variable "log_group_name" {
8288
description = "Custom log group name."
8389
type = string

0 commit comments

Comments
 (0)