Skip to content

Commit c9fd279

Browse files
Added Egress Outbound Variable & Updated Redis Family in Example (cloudposse#90)
* added eggress * updated example * Updated README.md Co-authored-by: actions-bot <[email protected]>
1 parent 7014078 commit c9fd279

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
<!-- markdownlint-disable -->
12
# terraform-aws-elasticache-redis [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-elasticache-redis.svg)](https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
3+
<!-- markdownlint-restore -->
24

35
[![README Header][readme_header_img]][readme_header_link]
46

@@ -185,6 +187,7 @@ Available targets:
185187
| context | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | <pre>object({<br> enabled = bool<br> namespace = string<br> environment = string<br> stage = string<br> name = string<br> delimiter = string<br> attributes = list(string)<br> tags = map(string)<br> additional_tag_map = map(string)<br> regex_replace_chars = string<br> label_order = list(string)<br> id_length_limit = number<br> })</pre> | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_order": [],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {}<br>}</pre> | no |
186188
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
187189
| dns\_subdomain | The subdomain to use for the CNAME record. If not provided then the CNAME record will use var.name. | `string` | `""` | no |
190+
| egress\_cidr\_blocks | Outbound traffic address | `list` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
188191
| elasticache\_subnet\_group\_name | Subnet group name for the ElastiCache instance | `string` | `""` | no |
189192
| enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
190193
| engine\_version | Redis engine version | `string` | `"4.0.10"` | no |
@@ -356,8 +359,10 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
356359

357360
### Contributors
358361

362+
<!-- markdownlint-disable -->
359363
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Daren Desjardins][darend_avatar]][darend_homepage]<br/>[Daren Desjardins][darend_homepage] | [![Max Moon][MoonMoon1919_avatar]][MoonMoon1919_homepage]<br/>[Max Moon][MoonMoon1919_homepage] | [![Christopher Riley][christopherriley_avatar]][christopherriley_homepage]<br/>[Christopher Riley][christopherriley_homepage] |
360364
|---|---|---|---|---|---|
365+
<!-- markdownlint-restore -->
361366

362367
[osterman_homepage]: https://github.com/osterman
363368
[osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png

docs/terraform.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
| context | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | <pre>object({<br> enabled = bool<br> namespace = string<br> environment = string<br> stage = string<br> name = string<br> delimiter = string<br> attributes = list(string)<br> tags = map(string)<br> additional_tag_map = map(string)<br> regex_replace_chars = string<br> label_order = list(string)<br> id_length_limit = number<br> })</pre> | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_order": [],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {}<br>}</pre> | no |
3838
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
3939
| dns\_subdomain | The subdomain to use for the CNAME record. If not provided then the CNAME record will use var.name. | `string` | `""` | no |
40+
| egress\_cidr\_blocks | Outbound traffic address | `list` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
4041
| elasticache\_subnet\_group\_name | Subnet group name for the ElastiCache instance | `string` | `""` | no |
4142
| enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
4243
| engine\_version | Redis engine version | `string` | `"4.0.10"` | no |

examples/complete/fixtures.us-east-2.tfvars

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ instance_type = "cache.t2.micro"
1414

1515
cluster_size = 1
1616

17-
family = "redis4.0"
17+
family = "redis6.x"
1818

19-
engine_version = "4.0.10"
19+
engine_version = "6.x"
2020

2121
at_rest_encryption_enabled = false
2222

main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ resource "aws_security_group" "default" {
1010

1111
resource "aws_security_group_rule" "egress" {
1212
count = module.this.enabled && var.use_existing_security_groups == false ? 1 : 0
13-
description = "Allow all egress traffic"
13+
description = "Allow outbound traffic from existing cidr blocks"
1414
from_port = 0
1515
to_port = 0
1616
protocol = "-1"
17-
cidr_blocks = ["0.0.0.0/0"]
17+
cidr_blocks = var.egress_cidr_blocks
1818
security_group_id = join("", aws_security_group.default.*.id)
1919
type = "egress"
2020
}

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,9 @@ variable "cloudwatch_metric_alarms_enabled" {
210210
description = "Boolean flag to enable/disable CloudWatch metrics alarms"
211211
default = false
212212
}
213+
214+
variable egress_cidr_blocks {
215+
type = list
216+
default = ["0.0.0.0/0"]
217+
description = "Outbound traffic address"
218+
}

0 commit comments

Comments
 (0)