diff --git a/README.md b/README.md index a9830dc..7362462 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ Available targets: | [private\_link\_target\_arns](#input\_private\_link\_target\_arns) | A list of target ARNs for VPC Private Link | `list(string)` | `[]` | no | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | | [rest\_api\_policy](#input\_rest\_api\_policy) | The IAM policy document for the API. | `string` | `null` | no | +| [retention\_in\_days](#input\_retention\_in\_days) | Number of days you want to retain log events in the API Gateway log group | `string` | `"30"` | no | | [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | | [stage\_name](#input\_stage\_name) | The name of the stage | `string` | `""` | no | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no | diff --git a/docs/terraform.md b/docs/terraform.md index 3014ff0..a1a2b7e 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -59,6 +59,7 @@ | [private\_link\_target\_arns](#input\_private\_link\_target\_arns) | A list of target ARNs for VPC Private Link | `list(string)` | `[]` | no | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | | [rest\_api\_policy](#input\_rest\_api\_policy) | The IAM policy document for the API. | `string` | `null` | no | +| [retention\_in\_days](#input\_retention\_in\_days) | Number of days you want to retain log events in the API Gateway log group | `string` | `"30"` | no | | [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | | [stage\_name](#input\_stage\_name) | The name of the stage | `string` | `""` | no | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no | diff --git a/main.tf b/main.tf index ef261e8..d82cf28 100644 --- a/main.tf +++ b/main.tf @@ -33,6 +33,7 @@ module "cloudwatch_log_group" { enabled = local.create_log_group iam_tags_enabled = var.iam_tags_enabled permissions_boundary = var.permissions_boundary + retention_in_days = var.retention_in_days context = module.this.context } diff --git a/variables.tf b/variables.tf index 10ea8f1..e611598 100644 --- a/variables.tf +++ b/variables.tf @@ -138,4 +138,10 @@ variable "stage_name" { type = string default = "" description = "The name of the stage" -} \ No newline at end of file +} + +variable "retention_in_days" { + type = string + description = "Number of days you want to retain log events in the API Gateway log group" + default = "30" +}