|
1 | | -# terraform-aws-alb-ingress |
2 | | -Terraform module to provision an HTTP style ingress based on hostname and path |
| 1 | + |
| 2 | + |
| 3 | +# terraform-aws-alb-ingress [](https://travis-ci.org/cloudposse/terraform-aws-alb-ingress) [](https://slack.cloudposse.com) |
| 4 | + |
| 5 | +A Terraform module to provision an HTTP style ingress based on hostname and path. |
| 6 | + |
| 7 | +## Usage |
| 8 | + |
| 9 | +``` |
| 10 | +module "alb" { |
| 11 | + source = "git::https://github.com/cloudposse/terraform-aws-alb.git?ref=master" |
| 12 | + namespace = "eg" |
| 13 | + stage = "dev" |
| 14 | + name = "web" |
| 15 | + vpc_id = "..." |
| 16 | +} |
| 17 | +
|
| 18 | +module "api_ingress" { |
| 19 | + source = "git::https://github.com/cloudposse/terraform-aws-alb-ingress.git?ref=master" |
| 20 | + namespace = "eg" |
| 21 | + stage = "dev" |
| 22 | + name = "web" |
| 23 | + attributes = "api" |
| 24 | + vpc_id = "..." |
| 25 | + target_group_arn = "${module.alb.default_target_group_arn}" |
| 26 | + paths = ["/api/*"] |
| 27 | +} |
| 28 | +
|
| 29 | +module "blog_ingress" { |
| 30 | + source = "git::https://github.com/cloudposse/terraform-aws-alb-ingress.git?ref=master" |
| 31 | + namespace = "eg" |
| 32 | + stage = "dev" |
| 33 | + name = "web" |
| 34 | + attributes = "blog" |
| 35 | + vpc_id = "..." |
| 36 | + target_group_arn = "${module.alb.default_target_group_arn}" |
| 37 | + paths = ["/blog/*"] |
| 38 | +} |
| 39 | +
|
| 40 | +module "blog_service" { |
| 41 | + source = "git::https://github.com/cloudposse/terraform-aws-ecs-alb-service-task.git?ref=0.1.0" |
| 42 | + namespace = "eg" |
| 43 | + stage = "dev" |
| 44 | + name = "blog" |
| 45 | + alb_target_group_arn = "${module.alb.default_target_group.arn}" |
| 46 | + container_definition_json = "${module.container_definition.json}" |
| 47 | + ecr_repository_name = "${module.ecr.repository_name}" |
| 48 | + ecs_cluster_arn = "${aws_ecs_cluster.default.arn}" |
| 49 | + launch_type = "FARGATE" |
| 50 | + vpc_id = "${module.vpc.vpc_id}" |
| 51 | + security_group_ids = ["${module.vpc.vpc_default_security_group_id}"] |
| 52 | + private_subnet_ids = "${module.dynamic_subnets.private_subnet_ids}" |
| 53 | +} |
| 54 | +``` |
| 55 | + |
| 56 | +## Inputs |
| 57 | + |
| 58 | +| Name | Default | Description | Required | |
| 59 | +|:-----------------------------------|:---------------:|:---------------------------------------------------------------------------------|:--------:| |
| 60 | +| `namespace` | `` | Namespace (e.g. `cp` or `cloudposse`) | Yes | |
| 61 | +| `stage` | `` | Stage (e.g. `prod`, `dev`, `staging`) | Yes | |
| 62 | +| `name` | `` | Name (e.g. `app` or `cluster`) | Yes | |
| 63 | +| `target_group_arn` | `` | ALB target group ARN, if this is an empty string a new one will be generated | No | |
| 64 | +| `listener_arns` | `[]` | A list of ALB listener ARNs to attach ALB listener rule to | No | |
| 65 | +| `deregistration_delay` | `15` | The amount of time to wait in seconds while deregistering target | No | |
| 66 | +| `health_check_path` | `/` | The destination for the health check request | No | |
| 67 | +| `health_check_timeout` | `10` | The amount of time to wait in seconds before failing a health check request | No | |
| 68 | +| `health_check_healthy_threshold` | `2` | The number of consecutive health checks successes required before healthy | No | |
| 69 | +| `health_check_unhealthy_threshold` | `2` | The number of consecutive health check failures required before unhealthy | No | |
| 70 | +| `health_check_interval` | `15` | The duration in seconds in between health checks | No | |
| 71 | +| `health_check_matcher` | `200-399` | The HTTP response codes to indicate a healthy check | No | |
| 72 | +| `priority` | `100` | The priority for the rule between 1 and 50000 (1 being highest priority) | No | |
| 73 | +| `port` | `80` | The port for generated ALB target group (if target_group_arn not set) | No | |
| 74 | +| `protocol` | `HTTP` | The protocol for generated ALB target group (if target_group_arn not set) | No | |
| 75 | +| `vpc_id` | `` | The VPC ID where generated ALB target group (if target_group_arn not set) | No | |
| 76 | +| `paths` | `[]` | Path pattern to match (a maximum of 1 can be defined) | No | |
| 77 | +| `hosts` | `[]` | Hosts to match in Hosts header | No | |
| 78 | +| `attributes` | `[]` | Additional attributes (e.g. `1`) | No | |
| 79 | +| `tags` | `{}` | Additional tags (e.g. `map("BusinessUnit","XYZ")` | No | |
| 80 | +| `delimiter` | `-` | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | No | |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +## Outputs |
| 85 | + |
| 86 | +| Name | Description | |
| 87 | +|:--------------------------------|:----------------------------------------------------------------| |
| 88 | +| `target_group_arn` | The target group ARN | |
| 89 | + |
| 90 | + |
| 91 | +## Help |
| 92 | + |
| 93 | +**Got a question?** |
| 94 | + |
| 95 | +File a GitHub [issue ](https://github.com/cloudposse/terraform-aws-alb-ingress/issues), send us an [email ](mailto:[email protected]) or reach out to us on [Slack ](https://slack.cloudposse.com). |
| 96 | + |
| 97 | +## Contributing |
| 98 | + |
| 99 | +### Bug Reports & Feature Requests |
| 100 | + |
| 101 | +Please use the [issue tracker](https://github.com/cloudposse/terraform-aws-alb-ingress/issues) to report any bugs or file feature requests. |
| 102 | + |
| 103 | +### Developing |
| 104 | + |
| 105 | +If you are interested in being a contributor and want to get involved in developing `terraform-aws-alb-ingress`, we would love to hear from you! Shoot us an [email ](mailto:[email protected]). |
| 106 | + |
| 107 | +In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. |
| 108 | + |
| 109 | + 1. **Fork** the repo on GitHub |
| 110 | + 2. **Clone** the project to your own machine |
| 111 | + 3. **Commit** changes to your own branch |
| 112 | + 4. **Push** your work back up to your fork |
| 113 | + 5. Submit a **Pull request** so that we can review your changes |
| 114 | + |
| 115 | +**NOTE:** Be sure to merge the latest from "upstream" before making a pull request! |
| 116 | + |
| 117 | +## License |
| 118 | + |
| 119 | +[APACHE 2.0](LICENSE) © 2018 [Cloud Posse, LLC](https://cloudposse.com) |
| 120 | + |
| 121 | +See [LICENSE](LICENSE) for full details. |
| 122 | + |
| 123 | + Licensed to the Apache Software Foundation (ASF) under one |
| 124 | + or more contributor license agreements. See the NOTICE file |
| 125 | + distributed with this work for additional information |
| 126 | + regarding copyright ownership. The ASF licenses this file |
| 127 | + to you under the Apache License, Version 2.0 (the |
| 128 | + "License"); you may not use this file except in compliance |
| 129 | + with the License. You may obtain a copy of the License at |
| 130 | + |
| 131 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 132 | + |
| 133 | + Unless required by applicable law or agreed to in writing, |
| 134 | + software distributed under the License is distributed on an |
| 135 | + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 136 | + KIND, either express or implied. See the License for the |
| 137 | + specific language governing permissions and limitations |
| 138 | + under the License. |
| 139 | + |
| 140 | +## About |
| 141 | + |
| 142 | +This project is maintained and funded by [Cloud Posse, LLC][website]. |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | +Like it? Please let us know at <[email protected]> |
| 148 | + |
| 149 | +We love [Open Source Software](https://github.com/cloudposse/)! |
| 150 | + |
| 151 | +See [our other projects][community] |
| 152 | +or [hire us][hire] to help build your next cloud platform. |
| 153 | + |
| 154 | + [website]: https://cloudposse.com/ |
| 155 | + [community]: https://github.com/cloudposse/ |
| 156 | + [hire]: https://cloudposse.com/contact/ |
| 157 | + |
| 158 | + |
| 159 | +## Contributors |
| 160 | + |
| 161 | +| [![Erik Osterman][erik_img]][erik_web]<br/>[Erik Osterman][erik_web] | [![Andriy Knysh][andriy_img]][andriy_web]<br/>[Andriy Knysh][andriy_web] |[![Igor Rodionov][igor_img]][igor_web]<br/>[Igor Rodionov][igor_img]|[![Sarkis Varozian][sarkis_img]][sarkis_web]<br/>[Sarkis Varozian][sarkis_web] | |
| 162 | +|-------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------|------------------------------------------------------------------| |
| 163 | + |
| 164 | +[erik_img]: http://s.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb?s=144 |
| 165 | +[erik_web]: https://github.com/osterman/ |
| 166 | +[andriy_img]: https://avatars0.githubusercontent.com/u/7356997?v=4&u=ed9ce1c9151d552d985bdf5546772e14ef7ab617&s=144 |
| 167 | +[andriy_web]: https://github.com/aknysh/ |
| 168 | +[igor_img]: http://s.gravatar.com/avatar/bc70834d32ed4517568a1feb0b9be7e2?s=144 |
| 169 | +[igor_web]: https://github.com/goruha/ |
| 170 | +[sarkis_img]: https://avatars3.githubusercontent.com/u/42673?s=144&v=4 |
| 171 | +[sarkis_web]: https://github.com/sarkis/ |
0 commit comments