## Requirements

| Name | Version   |
|------|-----------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.10 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
| <a name="provider_random"></a> [random](#provider\_random) | n/a |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_alb_rules"></a> [alb\_rules](#module\_alb\_rules) | ../../../ec2/alb/https_rule_with_redirect | n/a |

## Resources

| Name | Type |
|------|------|
| [aws_ecs_service.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_service) | resource |
| [aws_lb_target_group.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group) | resource |
| [aws_route53_record.www](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_service_discovery_service.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/service_discovery_service) | resource |
| [random_string.tg_id](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_alb_dns_name"></a> [alb\_dns\_name](#input\_alb\_dns\_name) | DNS name of ALB. Required if route53\_zone\_id is set | `string` | `""` | no |
| <a name="input_alb_enabled"></a> [alb\_enabled](#input\_alb\_enabled) | Specify whether you want to have integration with load balancer of not. | `bool` | `false` | no |
| <a name="input_alb_zone_id"></a> [alb\_zone\_id](#input\_alb\_zone\_id) | DNS zone id of ALB. Required if route53\_zone\_id is set | `string` | `""` | no |
| <a name="input_capacity_provider_strategy"></a> [capacity\_provider\_strategy](#input\_capacity\_provider\_strategy) | Capacity provider strategy to use for the service. | <pre>map(object({<br>    base              = number<br>    weight            = number<br>    capacity_provider = string<br>  }))</pre> | n/a | yes |
| <a name="input_cluster_arn"></a> [cluster\_arn](#input\_cluster\_arn) | ARN of ECS cluster of the environment | `string` | n/a | yes |
| <a name="input_common_tags"></a> [common\_tags](#input\_common\_tags) | Common tags to add for the objects | `map(string)` | `{}` | no |
| <a name="input_container_name"></a> [container\_name](#input\_container\_name) | Name of the container | `string` | `""` | no |
| <a name="input_container_port"></a> [container\_port](#input\_container\_port) | Port which container exposes | `number` | `8080` | no |
| <a name="input_desired_count"></a> [desired\_count](#input\_desired\_count) | Amount of tasks running that will be maintained under ECS service | `number` | `1` | no |
| <a name="input_enable_ecs_managed_tags"></a> [enable\_ecs\_managed\_tags](#input\_enable\_ecs\_managed\_tags) | Specifies whether to enable Amazon ECS managed tags for the tasks within the service. | `bool` | `false` | no |
| <a name="input_env_prefix"></a> [env\_prefix](#input\_env\_prefix) | Prefix of the environment, lowercased | `string` | n/a | yes |
| <a name="input_https_listener_arn"></a> [https\_listener\_arn](#input\_https\_listener\_arn) | ARN of HTTPS listener of ALB | `string` | `null` | no |
| <a name="input_is_public"></a> [is\_public](#input\_is\_public) | Whether or not container will be created with public IP | `bool` | `false` | no |
| <a name="input_max_percent"></a> [max\_percent](#input\_max\_percent) | The upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. | `number` | `200` | no |
| <a name="input_min_percent"></a> [min\_percent](#input\_min\_percent) | The lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment. | `number` | `100` | no |
| <a name="input_namespace_id"></a> [namespace\_id](#input\_namespace\_id) | The ID of the namespace that you want to use to create the service. | `string` | `null` | no |
| <a name="input_platform_version"></a> [platform\_version](#input\_platform\_version) | Fargate version | `string` | `"1.4.0"` | no |
| <a name="input_project"></a> [project](#input\_project) | Project name, lowercased | `string` | n/a | yes |
| <a name="input_project_group"></a> [project\_group](#input\_project\_group) | Project group name, lowercased | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | Region where resources will be created | `string` | `"us-east-1"` | no |
| <a name="input_route53_eval_health"></a> [route53\_eval\_health](#input\_route53\_eval\_health) | Allow route53 to evaluate health of the targets behind it. | `bool` | `false` | no |
| <a name="input_route53_zone_id"></a> [route53\_zone\_id](#input\_route53\_zone\_id) | ID of the DNS hosted zone in Route 53. If set, dns record will be created. | `string` | `""` | no |
| <a name="input_sd_enabled"></a> [sd\_enabled](#input\_sd\_enabled) | Specify whether you want to have integration with service discovery of not. | `bool` | `false` | no |
| <a name="input_security_groups"></a> [security\_groups](#input\_security\_groups) | List of security groups which will be applied to ECS Service | `list(string)` | n/a | yes |
| <a name="input_subnets"></a> [subnets](#input\_subnets) | List of subnets which ECS Service will use | `list(string)` | n/a | yes |
| <a name="input_task_definition_arn"></a> [task\_definition\_arn](#input\_task\_definition\_arn) | The family and revision (family:revision) or full ARN of the task definition that you want to run in your service. | `string` | n/a | yes |
| <a name="input_tg_deregistration_delay"></a> [tg\_deregistration\_delay](#input\_tg\_deregistration\_delay) | The amount time for Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. | `number` | `60` | no |
| <a name="input_tg_health_check_interval"></a> [tg\_health\_check\_interval](#input\_tg\_health\_check\_interval) | Target group health check interval | `number` | `30` | no |
| <a name="input_tg_health_check_matcher"></a> [tg\_health\_check\_matcher](#input\_tg\_health\_check\_matcher) | The HTTP codes to use when checking for a successful response from a target. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299"). | `string` | `"200-204"` | no |
| <a name="input_tg_health_check_path"></a> [tg\_health\_check\_path](#input\_tg\_health\_check\_path) | The destination path for health checks. This path must begin with a '/' character, and can be at most 1024 characters in length. | `string` | `"/"` | no |
| <a name="input_tg_health_check_port"></a> [tg\_health\_check\_port](#input\_tg\_health\_check\_port) | The port to use to connect with the target. Valid values are either ports `1-65535`, or `traffic-port`. Defaults to `traffic-port`. | `any` | `"traffic-port"` | no |
| <a name="input_tg_health_check_timeout"></a> [tg\_health\_check\_timeout](#input\_tg\_health\_check\_timeout) | Target group health check timeout | `number` | `5` | no |
| <a name="input_tg_healthy_threshold"></a> [tg\_healthy\_threshold](#input\_tg\_healthy\_threshold) | The number of consecutive health checks successes required before considering an unhealthy target healthy. | `number` | `3` | no |
| <a name="input_tg_port"></a> [tg\_port](#input\_tg\_port) | Port of the target group. Generally it should not be changed. | `number` | `80` | no |
| <a name="input_tg_unhealthy_threshold"></a> [tg\_unhealthy\_threshold](#input\_tg\_unhealthy\_threshold) | The number of consecutive health check failures required before considering the target unhealthy. | `number` | `3` | no |
| <a name="input_url"></a> [url](#input\_url) | Hostname which will be listened by ECS Service | `string` | `null` | no |
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | VPC id where network resources will be created | `string` | n/a | yes |
| <a name="input_wait_for_steady_state"></a> [wait\_for\_steady\_state](#input\_wait\_for\_steady\_state) | If true, Terraform will wait for the service to reach a steady state before continuing. | `bool` | `true` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_ecs_service"></a> [ecs\_service](#output\_ecs\_service) | ECS Service object. |
| <a name="output_sd_id"></a> [sd\_id](#output\_sd\_id) | The id of the service discovery service. |
| <a name="output_tg_arn"></a> [tg\_arn](#output\_tg\_arn) | The id of target group. |
| <a name="output_tg_arn_suffix"></a> [tg\_arn\_suffix](#output\_tg\_arn\_suffix) | Target group ARN suffix. |
| <a name="output_tg_id"></a> [tg\_id](#output\_tg\_id) | The id of target group. |
