|
1 | | -# terraform-anycloud-template [](https://github.com/rhythmictech/terraform-anycloud-template/actions) <a href="https://twitter.com/intent/follow?screen_name=RhythmicTech"><img src="https://img.shields.io/twitter/follow/RhythmicTech?style=social&logo=RhythmicTech" alt="follow on Twitter"></a> |
2 | | -Template repository for terraform modules. Good for any cloud and any provider. |
| 1 | +# terraform-aws-cloudflare-restrictor [](https://github.com/rhythmictech/terraform-aws-cloudflare-restrictor/actions) <a href="https://twitter.com/intent/follow?screen_name=RhythmicTech"><img src="https://img.shields.io/twitter/follow/RhythmicTech?style=social&logo=RhythmicTech" alt="follow on Twitter"></a> |
| 2 | + |
| 3 | +This module will automatically manage the ingress rules for any security groups that are appropriately tagged, only permitting CloudFlare IP addresses. The module will create a Lambda that runs once per day, using the public CloudFlare API for known IP addresses to pull the latest IPs and merge them into the security group. |
| 4 | + |
| 5 | +By default, the Lambda will update any security group with the tag key `CLOUDFLARE_MANAGED` set to `true`, |
| 6 | +though this can be customized. Any existing ingress rules will be removed when this tag key/value match. Since the Lambda only runs once per day, it is recommended that it be manually triggered whenever a new security group is added. |
3 | 7 |
|
4 | 8 | ## Example |
5 | | -Here's what using the module will look like |
| 9 | +Here's what using the module will look like: |
| 10 | + |
6 | 11 | ``` |
7 | | -module "example" { |
8 | | - source = "rhythmictech/terraform-mycloud-mymodule |
| 12 | +module "cloudflare-restrictor" { |
| 13 | + source = "rhythmictech/terraform-aws-cloudflare-restrictor" |
9 | 14 | } |
10 | 15 | ``` |
11 | 16 |
|
12 | | -## About |
13 | | -A bit about this module |
14 | | - |
15 | 17 | <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
16 | 18 | ## Requirements |
17 | 19 |
|
18 | | -No requirements. |
| 20 | +| Name | Version | |
| 21 | +|------|---------| |
| 22 | +| terraform | >= 0.12.19 | |
19 | 23 |
|
20 | 24 | ## Providers |
21 | 25 |
|
22 | | -No provider. |
| 26 | +| Name | Version | |
| 27 | +|------|---------| |
| 28 | +| archive | n/a | |
| 29 | +| aws | n/a | |
23 | 30 |
|
24 | 31 | ## Inputs |
25 | 32 |
|
26 | 33 | | Name | Description | Type | Default | Required | |
27 | 34 | |------|-------------|------|---------|:--------:| |
28 | | -| name | Moniker to apply to all resources in the module | `string` | n/a | yes | |
| 35 | +| allowed\_ports | Ports to allow traffic from CloudFlare on (recommended to only use 443) | `list(number)` | <pre>[<br> 443<br>]</pre> | no | |
| 36 | +| execution\_expression | cron expression for how frequently rules should be updated | `string` | `"rate(1 day)"` | no | |
| 37 | +| name | Moniker to apply to all resources in the module | `string` | `"cloudflare-restrictor"` | no | |
| 38 | +| tag\_key | Tag key to expect on security groups that will be managed by this module | `string` | `"CLOUDFLARE_MANAGED"` | no | |
| 39 | +| tag\_value | Tag value to expect on security groups that will be managed by this module | `string` | `"true"` | no | |
29 | 40 | | tags | User-Defined tags | `map(string)` | `{}` | no | |
30 | 41 |
|
31 | 42 | ## Outputs |
32 | 43 |
|
33 | | -| Name | Description | |
34 | | -|------|-------------| |
35 | | -| tags\_module | Tags Module in it's entirety | |
| 44 | +No output. |
36 | 45 |
|
37 | 46 | <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
38 | | - |
39 | | -## The Giants underneath this module |
40 | | -- pre-commit.com/ |
41 | | -- terraform.io/ |
42 | | -- github.com/tfutils/tfenv |
43 | | -- github.com/segmentio/terraform-docs |
|
0 commit comments