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
* issue #30, use for_each over count for iteration
* fix ifs
* fixes for the target
* docs: add CHANGELOG.md for 2.0.0 breaking changes
* fix: use index-based keys for for_each to support unknown values
* docs: update CHANGELOG state migration examples with correct index-based keys
* feat: use name attribute as for_each key for authorization_rules and additional_routes
- authorization_rules: uses `name` if provided, otherwise falls back to list index
- additional_routes: added optional `name` attribute, uses it as key if provided, otherwise falls back to list index
- Updated CHANGELOG with improved state migration examples and documentation for the new name attribute
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: update README usage example with optional name attribute
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: milldr <miller0daniel@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This release contains breaking changes that require action when upgrading.
8
+
9
+
#### Resource iteration changed from `count` to `for_each` (#96)
10
+
11
+
The following resources now use `for_each` instead of `count`:
12
+
-`aws_ec2_client_vpn_network_association.default` - keyed by list index (`"0"`, `"1"`, etc.)
13
+
-`aws_ec2_client_vpn_authorization_rule.default` - keyed by `name` attribute if provided, otherwise list index
14
+
-`aws_ec2_client_vpn_route.default` - keyed by `name` attribute if provided, otherwise list index
15
+
16
+
**Impact:** Terraform will see existing resources as needing replacement. To avoid recreation, migrate state before applying:
17
+
18
+
```bash
19
+
# Network associations use index-based keys
20
+
terraform state mv 'aws_ec2_client_vpn_network_association.default[0]''aws_ec2_client_vpn_network_association.default["0"]'
21
+
terraform state mv 'aws_ec2_client_vpn_network_association.default[1]''aws_ec2_client_vpn_network_association.default["1"]'
22
+
23
+
# Authorization rules use the "name" attribute as the key
24
+
terraform state mv 'aws_ec2_client_vpn_authorization_rule.default[0]''aws_ec2_client_vpn_authorization_rule.default["<name>"]'
25
+
26
+
# Routes use "name" if provided, otherwise index
27
+
terraform state mv 'aws_ec2_client_vpn_route.default[0]''aws_ec2_client_vpn_route.default["<name-or-index>"]'
28
+
```
29
+
30
+
#### New optional `name` attribute for `additional_routes`
31
+
32
+
The `additional_routes` variable now supports an optional `name` attribute. When provided, it is used as the `for_each` key for the route resource. This enables more stable resource addressing.
33
+
34
+
```hcl
35
+
additional_routes = [
36
+
{
37
+
name = "internet" # Optional: used as for_each key
| <aname="input_additional_routes"></a> [additional\_routes](#input\_additional\_routes)| A list of additional routes that should be attached to the Client VPN endpoint | <pre>list(object({<br/> destination_cidr_block = string<br/> description = string<br/> target_vpc_subnet_id = string<br/> }))</pre> |`[]`| no |
179
+
| <aname="input_additional_routes"></a> [additional\_routes](#input\_additional\_routes)| A list of additional routes that should be attached to the Client VPN endpoint | <pre>list(object({<br/> destination_cidr_block = string<br/> description = string<br/> target_vpc_subnet_id = string<br/> name = optional(string)<br/> }))</pre> |`[]`| no |
179
180
| <aname="input_additional_security_group_rules"></a> [additional\_security\_group\_rules](#input\_additional\_security\_group\_rules)| A list of Security Group rule objects to add to the created security group, in addition to the ones<br/>this module normally creates. (To suppress the module's rules, set `create_security_group` to false<br/>and supply your own security group via `associated_security_group_ids`.)<br/>The keys and values of the objects are fully compatible with the `aws_security_group_rule` resource, except<br/>for `security_group_id` which will be ignored, and the optional "key" which, if provided, must be unique and known at "plan" time.<br/>To get more info see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule . |`list(any)`|`[]`| no |
180
181
| <aname="input_additional_security_groups"></a> [additional\_security\_groups](#input\_additional\_security\_groups)| DEPRECATED: Use `associated_security_group_ids` instead.<br/>List of security groups to attach to the client vpn network associations |`list(string)`|`[]`| no |
181
182
| <aname="input_additional_tag_map"></a> [additional\_tag\_map](#input\_additional\_tag\_map)| Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.<br/>This is for some rare cases where resources want additional configuration of tags<br/>and therefore take a list of maps with tag key, value, and additional configuration. |`map(string)`|`{}`| no |
0 commit comments