Skip to content

Commit

Permalink
Add customisable aws log prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
okgolove committed Dec 3, 2020
1 parent 8c5e9fd commit 965696c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ Available targets:
| autoscaling\_scale\_down\_cooldown | Period (in seconds) to wait between scale down events | `number` | `300` | no |
| autoscaling\_scale\_up\_adjustment | Scaling adjustment to make during scale up event | `number` | `1` | no |
| autoscaling\_scale\_up\_cooldown | Period (in seconds) to wait between scale up events | `number` | `60` | no |
| aws\_logs\_prefix | Custom AWS Logs prefix. If empty name from label module will be used | `string` | `""` | no |
| aws\_logs\_region | The region for the AWS Cloudwatch Logs group | `string` | n/a | yes |
| badge\_enabled | Generates a publicly-accessible URL for the projects build badge. Available as badge\_url attribute when enabled | `bool` | `false` | no |
| branch | Branch of the GitHub repository, e.g. `master` | `string` | `""` | no |
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
| autoscaling\_scale\_down\_cooldown | Period (in seconds) to wait between scale down events | `number` | `300` | no |
| autoscaling\_scale\_up\_adjustment | Scaling adjustment to make during scale up event | `number` | `1` | no |
| autoscaling\_scale\_up\_cooldown | Period (in seconds) to wait between scale up events | `number` | `60` | no |
| aws\_logs\_prefix | Custom AWS Logs prefix. If empty name from label module will be used | `string` | `""` | no |
| aws\_logs\_region | The region for the AWS Cloudwatch Logs group | `string` | n/a | yes |
| badge\_enabled | Generates a publicly-accessible URL for the projects build badge. Available as badge\_url attribute when enabled | `bool` | `false` | no |
| branch | Branch of the GitHub repository, e.g. `master` | `string` | `""` | no |
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ module "container_definition" {
options = {
"awslogs-region" = var.aws_logs_region
"awslogs-group" = join("", aws_cloudwatch_log_group.app.*.name)
"awslogs-stream-prefix" = module.this.name
"awslogs-stream-prefix" = var.aws_logs_prefix == "" ? module.this.name : var.aws_logs_prefix
}
secretOptions = null
} : null
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,12 @@ variable "aws_logs_region" {
description = "The region for the AWS Cloudwatch Logs group"
}

variable "aws_logs_prefix" {
type = string
description = "Custom AWS Logs prefix. If empty name from label module will be used"
default = ""
}

variable "log_retention_in_days" {
type = number
description = "The number of days to retain logs for the log group"
Expand Down

0 comments on commit 965696c

Please sign in to comment.