Skip to content

Commit 96f3c0a

Browse files
feat: enhance container definition with logging configuration (#13)
* feat: enhance container definition with logging configuration - Added log_mode and log_max_buffer_size variables for log driver configuration. - Updated README and container definition files to reflect new logging options. - Enhanced documentation with requirements, providers, inputs, and outputs sections. * refactor: clean up README and container definition files - Removed outdated sections from README and container definition documentation. - Updated log_mode default value from "blocking" to "non-blocking" in variables.tf. - Streamlined documentation to focus on current requirements and configurations. * docs: add license section to README files - Added a License section to both the main README and the container definition README. - Specified Apache 2 License and linked to the LICENSE file for full details.
1 parent f135982 commit 96f3c0a

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ No modules.
5959

6060
## License
6161

62-
Apache 2 Licensed. See [LICENSE](https://github.com/TechHoldingLLC/terraform-aws-ecs-task-definition/blob/main/LICENSE) for full details.
62+
Apache 2 Licensed. See [LICENSE](https://github.com/TechHoldingLLC/terraform-aws-ecs-task-definition/blob/main/LICENSE) for full details.

container_definition/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ No modules.
5555
| <a name="input_links"></a> [links](#input\_links) | The links parameter allows containers to communicate with each other without the need for port mappings. This parameter is only supported if the network mode of a task definition is `bridge` | `list(string)` | `[]` | no |
5656
| <a name="input_linux_parameters"></a> [linux\_parameters](#input\_linux\_parameters) | Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. For more information see [KernelCapabilities](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_KernelCapabilities.html) | `any` | `{}` | no |
5757
| <a name="input_log_configuration"></a> [log\_configuration](#input\_log\_configuration) | The log configuration for the container. For more information see [LogConfiguration](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html) | `any` | `{}` | no |
58+
| <a name="input_log_max_buffer_size"></a> [log\_max\_buffer\_size](#input\_log\_max\_buffer\_size) | The maximum buffer size for the log driver. | `string` | `"1m"` | no |
59+
| <a name="input_log_mode"></a> [log\_mode](#input\_log\_mode) | The mode for the log driver. | `string` | `"blocking"` | no |
5860
| <a name="input_memory"></a> [memory](#input\_memory) | The amount (in MiB) of memory to present to the container. If your container attempts to exceed the memory specified here, the container is killed. The total amount of memory reserved for all containers within a task must be lower than the task `memory` value, if one is specified | `number` | `null` | no |
5961
| <a name="input_memory_reservation"></a> [memory\_reservation](#input\_memory\_reservation) | The soft limit (in MiB) of memory to reserve for the container. When system memory is under heavy contention, Docker attempts to keep the container memory to this soft limit. However, your container can consume more memory when it needs to, up to either the hard limit specified with the `memory` parameter (if applicable), or all of the available memory on the container instance | `number` | `null` | no |
6062
| <a name="input_mount_points"></a> [mount\_points](#input\_mount\_points) | The mount points for data volumes in your container | `list(any)` | `[]` | no |
@@ -85,3 +87,7 @@ No modules.
8587
| <a name="output_cloudwatch_log_group_arn"></a> [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | ARN of CloudWatch log group created |
8688
| <a name="output_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of CloudWatch log group created |
8789
| <a name="output_container_definition"></a> [container\_definition](#output\_container\_definition) | Container definition |
90+
91+
## License
92+
93+
Apache 2 Licensed. See [LICENSE](https://github.com/TechHoldingLLC/terraform-aws-ecs-task-definition/blob/main/LICENSE) for full details.

container_definition/container_definition.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ locals {
99
{ for k, v in {
1010
logDriver = "awslogs",
1111
options = {
12+
mode = var.log_mode,
13+
max-buffer-size = var.log_max_buffer_size,
1214
awslogs-region = local.region
1315
awslogs-group = try(aws_cloudwatch_log_group.this[0].name, ""),
1416
awslogs-stream-prefix = "ecs"

container_definition/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,18 @@ variable "working_directory" {
280280
default = null
281281
}
282282

283+
variable "log_mode" {
284+
description = "The mode for the log driver."
285+
type = string
286+
default = "non-blocking"
287+
}
288+
289+
variable "log_max_buffer_size" {
290+
description = "The maximum buffer size for the log driver."
291+
type = string
292+
default = "1m"
293+
}
294+
283295
################################################################################
284296
# CloudWatch Log Group
285297
################################################################################

0 commit comments

Comments
 (0)