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
| <aname="input_aggregation"></a> [aggregation](#input\_aggregation)| Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events. |`string`| n/a | yes |
47
46
| <aname="input_name"></a> [name](#input\_name)| A friendly name for the Protection you are creating. |`string`| n/a | yes |
48
-
| <aname="input_pattern"></a> [pattern](#input\_pattern)| The criteria to use to choose the protected resources for inclusion in the group. |`string`| n/a | yes |
49
-
| <aname="input_protection_group_id"></a> [protection\_group\_id](#input\_protection\_group\_id)| The name of the protection group. |`string`| n/a | yes |
47
+
| <aname="input_protection_group_config"></a> [protection\_group\_config](#input\_protection\_group\_config)|`id` - The name of the protection group, or protection\_group\_id<br> `aggregation` - Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events.<br> `pattern` - The criteria to use to choose the protected resources for inclusion in the group.<br> `resource_type` - (Optional) The resource type to include in the protection group. You must set this only when you set pattern to `BY_RESOURCE_TYPE`. | <pre>list(object({<br> id = string<br> aggregation = string<br> pattern = string<br> resource_type = optional(string)<br> }))</pre> | n/a | yes |
50
48
| <aname="input_resource_arn"></a> [resource\_arn](#input\_resource\_arn)| The ARN (Amazon Resource Name) of the resource to be protected. |`string`| n/a | yes |
51
49
| <aname="input_health_check_configuration"></a> [health\_check\_configuration](#input\_health\_check\_configuration)| Amazon Route53 Health Check Configuration to be associated to AWS Shield Advanced Protection. |`map(any)`|`null`| no |
52
-
| <aname="input_resource_type"></a> [resource\_type](#input\_resource\_type)| The resource type to include in the protection group. This is required if `pattern` is set to BY\_RESOURCE\_TYPE. Otherwise this must be not set. Defaults to `null`|`string`|`null`| no |
53
-
| <aname="input_tags"></a> [tags](#input\_tags)| Key-value map of resource tags. Defaults to `{}`|`map(string)`|`{}`| no |
50
+
| <aname="input_tags"></a> [tags](#input\_tags)| Key-value map of resource tags to apply to all taggable resources created by the module. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. Defaults to `{}`. |`map(string)`|`{}`| no |
Copy file name to clipboardExpand all lines: variables.tf
+37-26Lines changed: 37 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -8,43 +8,54 @@ variable "resource_arn" {
8
8
type=string
9
9
}
10
10
11
-
variable"protection_group_id" {
12
-
description="The name of the protection group."
13
-
type=string
14
-
}
15
-
16
-
variable"aggregation" {
17
-
description="Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events."
18
-
type=string
11
+
variable"protection_group_config" {
12
+
description=<<EOF
13
+
`id` - The name of the protection group, or protection_group_id
14
+
`aggregation` - Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events.
15
+
`pattern` - The criteria to use to choose the protected resources for inclusion in the group.
16
+
`resource_type` - (Optional) The resource type to include in the protection group. You must set this only when you set pattern to `BY_RESOURCE_TYPE`.
17
+
EOF
18
+
type=list(object({
19
+
id =string
20
+
aggregation =string
21
+
pattern =string
22
+
resource_type =optional(string)
23
+
}))
19
24
validation {
20
-
condition=contains([
21
-
"SUM",
22
-
"MEAN",
23
-
"MAX",
24
-
], var.aggregation)
25
-
error_message="Valid values for `var.aggregation` are `SUM | MEAN | MAX`."
25
+
condition=alltrue([
26
+
forconfiginvar.protection_group_config:contains([
27
+
"SUM",
28
+
"MEAN",
29
+
"MAX",
30
+
], config.aggregation) &&contains([
31
+
"ARBITRARY",
32
+
"ALL",
33
+
"BY_RESOURCE_TYPE",
34
+
], config.pattern) &&contains([
35
+
"APPLICATION_LOAD_BALANCER",
36
+
"CLASSIC_LOAD_BALANCER",
37
+
"CLOUDFRONT_DISTRIBUTION",
38
+
"ELASTIC_IP_ALLOCATION",
39
+
"GLOBAL_ACCELERATOR",
40
+
"ROUTE_53_HOSTED_ZONE",
41
+
], config.resource_type) if config.resource_type!=null
42
+
])
43
+
error_message=<<EOF
44
+
Valid values for `aggregation` are `SUM | MEAN | MAX`.
45
+
Valid values for `pattern` are `ARBITRARY | ALL | BY_RESOURCE_TYPE`. You must declare `members` parameter when using the `ARBITRARY` pattern, using a list with the content of the `var.resource_arn`.
46
+
Valid values for `resource_type` are `APPLICATION_LOAD_BALANCER | CLASSIC_LOAD_BALANCER | CLOUDFRONT_DISTRIBUTION | ELASTIC_IP_ALLOCATION | GLOBAL_ACCELERATOR | ROUTE_53_HOSTED_ZONE`.
47
+
EOF
26
48
}
27
49
}
28
50
29
-
variable"pattern" {
30
-
description="The criteria to use to choose the protected resources for inclusion in the group."
31
-
type=string
32
-
}
33
-
34
-
variable"resource_type" {
35
-
description="The resource type to include in the protection group. This is required if `pattern` is set to BY_RESOURCE_TYPE. Otherwise this must be not set. Defaults to `null`"
36
-
type=string
37
-
default=null
38
-
}
39
-
40
51
variable"health_check_configuration" {
41
52
description="Amazon Route53 Health Check Configuration to be associated to AWS Shield Advanced Protection."
42
53
type=map(any)
43
54
default=null
44
55
}
45
56
46
57
variable"tags" {
47
-
description="Key-value map of resource tags. Defaults to `{}`"
58
+
description="Key-value map of resource tags to apply to all taggable resources created by the module. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. Defaults to `{}`."
0 commit comments