You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add nlb support to module and complete example and idle_timeout to the alb (#34)
* fix: add nlb support to module and complete example
* fix: Add the checkov exceptions
* fix: remove unused code and fix complete example
* nostory: fix outputs and add notes to readme complete example
* fix: remove unused account_id
* fix: remove unused account_id datasource
* [Boldlinksig]: Pre-commit auto updated files on 08-11-2023 16:23:14.
* chore: add line to release on changelog
* fix: allowing admins to access logs bucket
* [Boldlinksig]: Pre-commit auto updated files on 09-11-2023 20:38:13.
---------
Co-authored-by: boldlinksig <boldlinksig@boldlink.io>
| <aname="input_family"></a> [family](#input\_family)| (Required) A unique name for your task definition. |`string`|`null`| no |
256
258
| <aname="input_force_new_deployment"></a> [force\_new\_deployment](#input\_force\_new\_deployment)| Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., myimage:latest), roll Fargate tasks onto a newer platform version, or immediately deploy ordered\_placement\_strategy and placement\_constraints updates. |`bool`|`false`| no |
257
259
| <aname="input_healthy_threshold"></a> [healthy\_threshold](#input\_healthy\_threshold)| (Optional) Number of consecutive health checks successes required before considering an unhealthy target healthy. Defaults to 3. |`number`|`3`| no |
260
+
| <aname="input_idle_timeout"></a> [idle\_timeout](#input\_idle\_timeout)| (Optional) The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type application. Default: 60 |`number`|`60`| no |
258
261
| <aname="input_internal"></a> [internal](#input\_internal)| (Optional) If true, the LB will be internal. |`bool`|`false`| no |
259
262
| <aname="input_interval"></a> [interval](#input\_interval)| (Optional) Approximate amount of time, in seconds, between health checks of an individual target. The range is 5-300. For lambda target groups, it needs to be greater than the timeout of the underlying lambda. Defaults to 30. |`number`|`30`| no |
260
263
| <aname="input_key_deletion_window_in_days"></a> [key\_deletion\_window\_in\_days](#input\_key\_deletion\_window\_in\_days)| The number of days before the key is deleted |`number`|`7`| no |
@@ -265,7 +268,7 @@ No modules.
265
268
| <aname="input_listener_protocol"></a> [listener\_protocol](#input\_listener\_protocol)| (Required) The protocol to listen on. Valid values are HTTP, HTTPS, TCP, or SSL |`string`|`"HTTP"`| no |
266
269
| <aname="input_load_balancer"></a> [load\_balancer](#input\_load\_balancer)| (Optional) Configuration block for load balancers |`any`|`[]`| no |
267
270
| <aname="input_load_balancer_type"></a> [load\_balancer\_type](#input\_load\_balancer\_type)| (Optional) The type of load balancer to create. Possible values are application, gateway, or network. The default value is application. |`string`|`"application"`| no |
268
-
| <aname="input_matcher"></a> [matcher](#input\_matcher)| (May be required) Response codes to use when checking for a healthy responses from a target. You can specify multiple values (for example, 200,202 for HTTP(s)) |`string`|`"200,202"`| no |
271
+
| <aname="input_matcher"></a> [matcher](#input\_matcher)| (May be required) Response codes to use when checking for a healthy responses from a target. You can specify multiple values (for example, 200,202 for HTTP(s)) |`string`|`null`| no |
269
272
| <aname="input_max_capacity"></a> [max\_capacity](#input\_max\_capacity)| (Required) The max capacity of the scalable target. |`number`|`2`| no |
270
273
| <aname="input_memory"></a> [memory](#input\_memory)| Amount (in MiB) of memory used by the task. If the requires\_compatibilities is FARGATE this field is required. |`number`|`1024`| no |
271
274
| <aname="input_metric_aggregation_type"></a> [metric\_aggregation\_type](#input\_metric\_aggregation\_type)| (Optional) The aggregation type for the policy's metrics. Valid values are `Minimum`, `Maximum`, and `Average`. Without a value, AWS will treat the aggregation type as `Average`. |`string`|`"Maximum"`| no |
Copy file name to clipboardExpand all lines: examples/complete/README.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,8 @@
17
17
- Add HTTPS inbound rule to load balancer security group for HTTPS to work
18
18
- For this example `deletion_protection` is enabled for the load balancer. Change the argument ` enable_deletion_protection = true` to ` enable_deletion_protection = false` or delete it to disable this feature. Terraform will not be able to delete the resource if this feature is not enabled.
19
19
- Ensure that traffic on port `5000` is allowed in the ALB security group. This example uses an image that is configured to listen on port `5000`. If you are using your own image, make sure to allow traffic for the port that your application is configured to.
20
+
- This example also contains now a NLB configuration, no SSL/TLS is specified for the NLB, so it will be created as a TCP NLB. If you want to use a HTTP NLB, you need to specify a certificate for the NLB. See the [NLB documentation](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html) for more information.
21
+
- SSL/TLS support is enabled at the alb/nlb endpoint not end-to-end encryption, the certificate used is a self-signed certificate for testing and example purposes.
20
22
21
23
## Testing the deployment
22
24
To test the deployment, follow these steps:
@@ -37,19 +39,21 @@ To test the deployment, follow these steps:
|[aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity)| data source |
53
57
|[aws_ecs_cluster.ecs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ecs_cluster)| data source |
54
58
|[aws_elb_service_account.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/elb_service_account)| data source |
55
59
|[aws_iam_policy_document.access_logs_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
@@ -69,6 +73,7 @@ To test the deployment, follow these steps:
69
73
| Name | Description | Type | Default | Required |
| <aname="input_access_logs_enabled"></a> [access\_logs\_enabled](#input\_access\_logs\_enabled)| Whether to enable access logs for the lb |`bool`|`true`| no |
76
+
| <aname="input_alb_ingress_rules"></a> [alb\_ingress\_rules](#input\_alb\_ingress\_rules)| Incoming traffic configuration for the load balancer security group |`list(any)`| <pre>[<br> {<br> "cidr_blocks": [<br> "0.0.0.0/0"<br> ],<br> "description": "Allow traffic to load balancer on port 443",<br> "from_port": 443,<br> "protocol": "tcp",<br> "to_port": 443<br> },<br> {<br> "cidr_blocks": [<br> "0.0.0.0/0"<br> ],<br> "description": "Allow traffic to alb load balancer on port 80",<br> "from_port": 80,<br> "protocol": "tcp",<br> "to_port": 80<br> }<br>]</pre> | no |
72
77
| <aname="input_containerport"></a> [containerport](#input\_containerport)| Specify container port |`number`|`5000`| no |
73
78
| <aname="input_cpu"></a> [cpu](#input\_cpu)| The number of cpu units to allocate |`number`|`10`| no |
74
79
| <aname="input_create_load_balancer"></a> [create\_load\_balancer](#input\_create\_load\_balancer)| Whether to create a load balancer for ecs. |`bool`|`true`| no |
@@ -80,10 +85,10 @@ To test the deployment, follow these steps:
80
85
| <aname="input_force_new_deployment"></a> [force\_new\_deployment](#input\_force\_new\_deployment)| Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., myimage:latest), roll Fargate tasks onto a newer platform version, or immediately deploy ordered\_placement\_strategy and placement\_constraints updates. |`bool`|`true`| no |
81
86
| <aname="input_hostport"></a> [hostport](#input\_hostport)| Specify host port |`number`|`5000`| no |
82
87
| <aname="input_image"></a> [image](#input\_image)| Name of image to pull from dockerhub |`string`|`"boldlink/flaskapp:latest"`| no |
83
-
| <aname="input_lb_ingress_rules"></a> [lb\_ingress\_rules](#input\_lb\_ingress\_rules)| Incoming traffic configuration for the load balancer security group |`list(any)`| <pre>[<br> {<br> "cidr_blocks": [<br> "0.0.0.0/0"<br> ],<br> "description": "Allow traffic to load balancer on port 443",<br> "from_port": 443,<br> "protocol": "tcp",<br> "to_port": 443<br> },<br> {<br> "cidr_blocks": [<br> "0.0.0.0/0"<br> ],<br> "description": "Allow traffic to load balancer on port 80",<br> "from_port": 80,<br> "protocol": "tcp",<br> "to_port": 80<br> }<br>]</pre> | no |
84
88
| <aname="input_memory"></a> [memory](#input\_memory)| The size of memory to allocate in MiBs |`number`|`512`| no |
85
89
| <aname="input_name"></a> [name](#input\_name)| Name of the stack |`string`|`"complete-ecs-example"`| no |
86
90
| <aname="input_network_mode"></a> [network\_mode](#input\_network\_mode)| Docker networking mode to use for the containers in the task. Valid values are none, bridge, awsvpc, and host. |`string`|`"awsvpc"`| no |
91
+
| <aname="input_nlb_ingress_rules"></a> [nlb\_ingress\_rules](#input\_nlb\_ingress\_rules)| Incoming traffic configuration for the NLB load balancer security group |`list(any)`| <pre>[<br> {<br> "cidr_blocks": [<br> "0.0.0.0/0"<br> ],<br> "description": "Allow traffic to nlb load balancer on port 5000",<br> "from_port": 5000,<br> "protocol": "tcp",<br> "to_port": 5000<br> }<br>]</pre> | no |
87
92
| <aname="input_path"></a> [path](#input\_path)| Destination for the health check request. Required for HTTP/HTTPS ALB and HTTP NLB. Only applies to HTTP/HTTPS. |`string`|`"/healthz"`| no |
88
93
| <aname="input_requires_compatibilities"></a> [requires\_compatibilities](#input\_requires\_compatibilities)| Set of launch types required by the task. The valid values are EC2 and FARGATE. |`list(string)`| <pre>[<br> "FARGATE"<br>]</pre> | no |
89
94
| <aname="input_retention_in_days"></a> [retention\_in\_days](#input\_retention\_in\_days)| Number of days you want to retain log events in the specified log group. |`number`|`1`| no |
@@ -97,10 +102,8 @@ To test the deployment, follow these steps:
97
102
98
103
| Name | Description |
99
104
|------|-------------|
100
-
| <aname="output_lb_arn"></a> [lb\_arn](#output\_lb\_arn)| The load balancer arn/id |
101
-
| <aname="output_lb_sg_id"></a> [lb\_sg\_id](#output\_lb\_sg\_id)| The ID of the load balancer security group |
102
-
| <aname="output_service_sg_id"></a> [service\_sg\_id](#output\_service\_sg\_id)| The ID of the service security group |
103
-
| <aname="output_task_definition_arn"></a> [task\_definition\_arn](#output\_task\_definition\_arn)| The task definition arn |
105
+
| <aname="output_alb_service_url"></a> [alb\_service\_url](#output\_alb\_service\_url)| The task definition arn |
106
+
| <aname="output_nlb_service_url"></a> [nlb\_service\_url](#output\_nlb\_service\_url)| The task definition arn |
0 commit comments