Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAT-24280 Added ecs task log-related vars #107

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Using the Repo Source

```hcl
github.com/pbs/terraform-aws-ecs-service-module?ref=6.0.0
github.com/pbs/terraform-aws-ecs-service-module?ref=x.y.z
```

### Alternative Installation Methods
Expand All @@ -26,7 +26,7 @@ Integrate this module like so:

```hcl
module "service" {
source = "github.com/pbs/terraform-aws-ecs-service-module?ref=6.0.0"
source = "github.com/pbs/terraform-aws-ecs-service-module?ref=x.y.z"

# Required
hosted_zone = "example.com"
Expand All @@ -49,7 +49,7 @@ This module will create an ECS cluster if one is not provided. If you would like

```hcl
module "service" {
source = "github.com/pbs/terraform-aws-ecs-service-module?ref=6.0.0"
source = "github.com/pbs/terraform-aws-ecs-service-module?ref=x.y.z"

# Required
hosted_zone = "example.com"
Expand All @@ -73,7 +73,7 @@ module "service" {

If this repo is added as a subtree, then the version of the module should be close to the version shown here:

`6.0.0`
`x.y.z`

Note, however that subtrees can be altered as desired within repositories.

Expand Down Expand Up @@ -220,6 +220,8 @@ Below is automatically generated documentation on this Terraform module using [t
| <a name="input_load_balancer_name"></a> [load\_balancer\_name](#input\_load\_balancer\_name) | Load balancer name. Will default to product if not defined. | `string` | `null` | no |
| <a name="input_load_balancer_sg_name"></a> [load\_balancer\_sg\_name](#input\_load\_balancer\_sg\_name) | Prefix for the name of the load balancer security group. If null, will use `${local.load_balancer_name}-sg-`. | `string` | `null` | no |
| <a name="input_load_balancer_type"></a> [load\_balancer\_type](#input\_load\_balancer\_type) | Type of load balancer to use. application, network or gateway. | `string` | `"application"` | no |
| <a name="input_log_group_class"></a> [log\_group\_class](#input\_log\_group\_class) | (Optional) log class of the log group. Possible values are: STANDARD or INFREQUENT\_ACCESS | `string` | `"INFREQUENT_ACCESS"` | no |
| <a name="input_log_group_name"></a> [log\_group\_name](#input\_log\_group\_name) | (optional) name for the log group | `string` | `null` | no |
| <a name="input_max_capacity"></a> [max\_capacity](#input\_max\_capacity) | The maximum capacity of tasks for this service | `number` | `2` | no |
| <a name="input_memory_reservation"></a> [memory\_reservation](#input\_memory\_reservation) | (optional) memory reservation for task | `number` | `512` | no |
| <a name="input_mesh_name"></a> [mesh\_name](#input\_mesh\_name) | (optional) the name for the App Mesh this task is associated with. If null, ignored | `string` | `null` | no |
Expand All @@ -240,6 +242,7 @@ Below is automatically generated documentation on this Terraform module using [t
| <a name="input_requires_compatibilities"></a> [requires\_compatibilities](#input\_requires\_compatibilities) | (optional) capabilities that the task requires | `set(string)` | <pre>[<br> "FARGATE"<br>]</pre> | no |
| <a name="input_restricted_cidr_blocks"></a> [restricted\_cidr\_blocks](#input\_restricted\_cidr\_blocks) | CIDR blocks to receive restricted service access. If empty, no CIDRs will be allowed to connect. | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| <a name="input_restricted_sg"></a> [restricted\_sg](#input\_restricted\_sg) | SG to receive restricted service access. If null, no sg will be configured to connect | `string` | `null` | no |
| <a name="input_retention_in_days"></a> [retention\_in\_days](#input\_retention\_in\_days) | (optional) log retention in days | `number` | `7` | no |
| <a name="input_role_policy_json"></a> [role\_policy\_json](#input\_role\_policy\_json) | the policy to apply for this service. Defaults to a valid ECS role policy if null. | `string` | `null` | no |
| <a name="input_route_priority"></a> [route\_priority](#input\_route\_priority) | Starting route priority, incremented by each listener rule | `number` | `10` | no |
| <a name="input_runtime_platform"></a> [runtime\_platform](#input\_runtime\_platform) | (optional) Runtime platform for the task. Defaults to LINUX operating system family w/ CPU architecture x86\_64. | <pre>object({<br> operating_system_family = optional(string, "LINUX")<br> cpu_architecture = optional(string, "X86_64")<br> })</pre> | <pre>{<br> "cpu_architecture": "X86_64",<br> "operating_system_family": "LINUX"<br>}</pre> | no |
Expand Down
18 changes: 18 additions & 0 deletions optional-task.tf
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,24 @@ variable "runtime_platform" {
})
}

variable "log_group_name" {
description = "(optional) name for the log group"
default = null
type = string
}

variable "log_group_class" {
description = "(Optional) log class of the log group. Possible values are: STANDARD or INFREQUENT_ACCESS"
default = "INFREQUENT_ACCESS"
type = string
}

variable "retention_in_days" {
description = "(optional) log retention in days"
default = 7
type = number
}

variable "awslogs_driver_mode" {
description = "(optional) awslogs driver mode. Set this to `blocking` if you would rather have an outage than lose logs."
default = "non-blocking"
Expand Down
3 changes: 3 additions & 0 deletions task.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ module "task" {

runtime_platform = var.runtime_platform

log_group_name = var.log_group_name
log_group_class = var.log_group_class
retention_in_days = var.retention_in_days
awslogs_driver_mode = var.awslogs_driver_mode

organization = var.organization
Expand Down