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
[breaking] Fix aws-redis-node security groups (#149)
[breaking] Fix aws-redis-node security groupsaws-redis-node (and its predecessor in shared-infra, redis-node) had a bug (or at least a naming bug), where the variable named "ingress_security_groups" which ostensibly controlled which security groups were allowed to access the cache, instead assigned the security group that were assigned to Elasticache. In all cases in CZI repos so far, this was set to be the security group assigned to the worker nodes, which happened to allow access to all traffic.
The PR makes this module match the description of ingress_security_group by introducing a new security group in between, assigning the cache the new security group and allowing ingress into that security group from the input security groups, only to the port Redis is listening on.
This PR is breaking because we now need the vpc_id as a new input to be able to create the new intermediate security group. It is also breaking (although not used in this way anywhere in CZI's code base) since it now requires service to be provided, and does not provide a default.
Copy file name to clipboardexpand all lines: aws-redis-node/README.md
+7-6
Original file line number
Diff line number
Diff line change
@@ -8,19 +8,20 @@ parameters.
8
8
9
9
| Name | Description | Type | Default | Required |
10
10
|------|-------------|:----:|:-----:|:-----:|
11
-
| apply\_immediately | Whether changes should be applied immediately or during the next maintenance window. |string|`"true"`| no |
12
-
| availability\_zone | Availability zone in which this instance should run. | string |n/a|yes|
13
-
| engine\_version | The version of Redis to run. See [supported versions](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/supported-engine-versions.html)| string |`"4.0.10"`| no |
11
+
| apply\_immediately | Whether changes should be applied immediately or during the next maintenance window. |bool|`true`| no |
12
+
| availability\_zone | Availability zone in which this instance should run. | string |`null`|no|
13
+
| engine\_version | The version of Redis to run. See [supported versions](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/supported-engine-versions.html)| string |`"5.0.5"`| no |
14
14
| env | Env for tagging and naming. See [doc](../README.md#consistent-tagging). | string | n/a | yes |
15
15
| ingress\_security\_group\_ids | Source security groups which should be able to contact this instance. | list | n/a | yes |
16
16
| instance\_type | The type of instance to run. See [supported node types](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html)| string |`"cache.m4.large"`| no |
17
17
| owner | Owner for tagging and naming. See [doc](../README.md#consistent-tagging). | string | n/a | yes |
18
-
| parameter\_group\_name || string |`"default.redis3.2"`| no |
19
-
| port || string|`"6379"`| no |
18
+
| parameter\_group\_name || string |`"default.redis5.0"`| no |
19
+
| port |Port to host Redis on. | number|`6379`| no |
20
20
| project | Project for tagging and naming. See [doc](../README.md#consistent-tagging)| string | n/a | yes |
21
21
| resource\_name | If not set, name will be [var.project]-[var.env]-[var.name]. | string |`""`| no |
22
-
| service | Service for tagging and naming. See [doc](../README.md#consistent-tagging)| string |`"redis"`|no|
22
+
| service | Service for tagging and naming. See [doc](../README.md#consistent-tagging)| string |n/a|yes|
23
23
| subnets | List of subnets to which this EC instance should be attached. They should probably be private. | list | n/a | yes |
24
+
| vpc\_id | VPC where the cache will be deployed. | string | n/a | yes |
description="Project for tagging and naming. See [doc](../README.md#consistent-tagging)"
4
4
}
5
5
6
6
variable"env" {
7
-
type="string"
7
+
type=string
8
8
description="Env for tagging and naming. See [doc](../README.md#consistent-tagging)."
9
9
}
10
10
11
+
variable"service" {
12
+
type=string
13
+
description="Service for tagging and naming. See [doc](../README.md#consistent-tagging)"
14
+
default="redis"
15
+
}
16
+
11
17
variable"owner" {
12
-
type="string"
18
+
type=string
13
19
description="Owner for tagging and naming. See [doc](../README.md#consistent-tagging)."
14
20
}
15
21
16
22
variable"subnets" {
17
-
type="list"
23
+
type=list(string)
18
24
description="List of subnets to which this EC instance should be attached. They should probably be private."
19
25
}
20
26
21
27
variable"availability_zone" {
22
-
type="string"
28
+
type=string
23
29
description="Availability zone in which this instance should run."
24
30
default=null
25
31
}
26
32
27
33
variable"ingress_security_group_ids" {
28
-
type="list"
34
+
type=list(string)
29
35
description="Source security groups which should be able to contact this instance."
30
36
}
31
37
32
-
variable"service" {
33
-
type="string"
34
-
description="Service for tagging and naming. See [doc](../README.md#consistent-tagging)"
35
-
default="redis"
36
-
}
37
-
38
38
variable"port" {
39
-
type="string"
40
-
default="6379"
39
+
type=number
40
+
description="Port to host Redis on."
41
+
default=6379
41
42
}
42
43
43
44
variable"instance_type" {
44
-
type="string"
45
+
type=string
45
46
description="The type of instance to run. See [supported node types](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html)"
46
47
default="cache.m5.large"
47
48
}
48
49
49
50
variable"parameter_group_name" {
50
-
default="default.redis5.0"
51
+
type=string
52
+
description="Parameter group to use for this Redis cache."
53
+
default="default.redis5.0"
51
54
}
52
55
53
56
variable"engine_version" {
54
-
type="string"
57
+
type=string
55
58
description="The version of Redis to run. See [supported versions](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/supported-engine-versions.html)"
56
59
default="5.0.5"
57
60
}
58
61
59
62
variable"apply_immediately" {
60
-
type="string"
63
+
type=bool
61
64
description="Whether changes should be applied immediately or during the next maintenance window."
62
65
default=true
63
66
}
@@ -66,6 +69,11 @@ variable "apply_immediately" {
66
69
# only 20 characters long. Use it only if you get that error.
67
70
variable"resource_name" {
68
71
description="If not set, name will be [var.project]-[var.env]-[var.name]."
69
-
type="string"
72
+
type=string
70
73
default=""
71
74
}
75
+
76
+
variable"vpc_id" {
77
+
type=string
78
+
description="VPC where the cache will be deployed."
0 commit comments