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
Remove hardcoded providers to enable for_each/count (#118)
* feat: remove hardcoded providers to enable for_each/count/depends_on
Remove hardcoded provider blocks from the module and use configuration_aliases
instead. This allows the module to be used with for_each, count, and depends_on.
Callers now pass in pre-configured providers via the providers argument.
BREAKING: Removes variables requester_region, accepter_region,
requester_aws_assume_role_arn, accepter_aws_assume_role_arn, requester_aws_profile,
accepter_aws_profile, requester_aws_access_key, accepter_aws_access_key,
requester_aws_secret_key, accepter_aws_secret_key, requester_aws_token,
accepter_aws_token, and skip_metadata_api_check. Callers must define aws
providers with these configs and pass them in via the providers block.
Closes#48Closes#108
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* docs: add migration guide and update README for v2.0
Update usage examples in README.yaml and README.md to show the new
provider-passing pattern. Remove deleted variables from the inputs table.
Add MIGRATION.md with step-by-step upgrade instructions from v1.x to v2.0.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
In v2.0, the module no longer contains hardcoded `provider "aws"` blocks. Instead, it uses `configuration_aliases` and expects providers to be passed in by the caller. This enables the module to be used with `for_each`, `count`, and `depends_on`.
6
+
7
+
## Removed Variables
8
+
9
+
The following variables have been removed. Provider configuration (region, credentials, assume role) is now handled by defining providers in your root module.
10
+
11
+
| Removed Variable | Previously Used For |
12
+
|---|---|
13
+
|`requester_aws_assume_role_arn`| IAM role to assume for the requester account |
14
+
|`requester_region`| AWS region of the requester |
15
+
|`requester_aws_profile`| AWS CLI profile for the requester |
16
+
|`requester_aws_access_key`| Access key for the requester |
17
+
|`requester_aws_secret_key`| Secret key for the requester |
18
+
|`requester_aws_token`| Session token for the requester |
19
+
|`accepter_aws_assume_role_arn`| IAM role to assume for the accepter account |
20
+
|`accepter_region`| AWS region of the accepter |
21
+
|`accepter_aws_profile`| AWS CLI profile for the accepter |
22
+
|`accepter_aws_access_key`| Access key for the accepter |
23
+
|`accepter_aws_secret_key`| Secret key for the accepter |
24
+
|`accepter_aws_token`| Session token for the accepter |
25
+
|`skip_metadata_api_check`| Skip EC2 metadata API check on providers |
1.**Define providers externally** -- Create `provider "aws"` blocks with `alias = "requester"` and `alias = "accepter"` in your root module, including region, assume_role, and any credential configuration.
91
+
2.**Pass providers to the module** -- Add a `providers` block to the module call mapping `aws.requester` and `aws.accepter`.
92
+
3.**Remove deleted arguments** -- Delete `requester_region`, `requester_aws_assume_role_arn`, `accepter_region`, `accepter_aws_assume_role_arn`, and all other removed variables from the module call.
Since only provider configuration was removed (no resources changed), upgrading should not require state manipulation. However, we recommend running `terraform plan` after upgrading to confirm no unexpected changes before applying.
| <aname="input_accepter_allow_remote_vpc_dns_resolution"></a> [accepter\_allow\_remote\_vpc\_dns\_resolution](#input\_accepter\_allow\_remote\_vpc\_dns\_resolution)| Allow accepter VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the requester VPC |`bool`|`true`| no |
327
-
| <aname="input_accepter_aws_access_key"></a> [accepter\_aws\_access\_key](#input\_accepter\_aws\_access\_key)| Access key id to use in accepter account |`string`|`null`| no |
328
-
| <aname="input_accepter_aws_assume_role_arn"></a> [accepter\_aws\_assume\_role\_arn](#input\_accepter\_aws\_assume\_role\_arn)| Accepter AWS Assume Role ARN |`string`|`null`| no |
329
-
| <aname="input_accepter_aws_profile"></a> [accepter\_aws\_profile](#input\_accepter\_aws\_profile)| Profile used to assume accepter\_aws\_assume\_role\_arn |`string`|`""`| no |
330
-
| <aname="input_accepter_aws_secret_key"></a> [accepter\_aws\_secret\_key](#input\_accepter\_aws\_secret\_key)| Secret access key to use in accepter account |`string`|`null`| no |
331
-
| <aname="input_accepter_aws_token"></a> [accepter\_aws\_token](#input\_accepter\_aws\_token)| Session token for validating temporary credentials |`string`|`null`| no |
332
346
| <aname="input_accepter_enabled"></a> [accepter\_enabled](#input\_accepter\_enabled)| Flag to enable/disable the accepter side of the peering connection |`bool`|`true`| no |
| <aname="input_accepter_subnet_tags"></a> [accepter\_subnet\_tags](#input\_accepter\_subnet\_tags)| Only add peer routes to accepter VPC route tables of subnets matching these tags |`map(string)`|`{}`| no |
335
348
| <aname="input_accepter_vpc_id"></a> [accepter\_vpc\_id](#input\_accepter\_vpc\_id)| Accepter VPC ID filter |`string`|`""`| no |
336
349
| <aname="input_accepter_vpc_tags"></a> [accepter\_vpc\_tags](#input\_accepter\_vpc\_tags)| Accepter VPC Tags filter |`map(string)`|`{}`| no |
@@ -354,16 +367,9 @@ For more information on IAM policies and permissions for VPC peering, see [Creat
354
367
| <aname="input_namespace"></a> [namespace](#input\_namespace)| ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique |`string`|`null`| no |
355
368
| <aname="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars)| Terraform regular expression (regex) string.<br/>Characters matching the regex will be removed from the ID elements.<br/>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. |`string`|`null`| no |
356
369
| <aname="input_requester_allow_remote_vpc_dns_resolution"></a> [requester\_allow\_remote\_vpc\_dns\_resolution](#input\_requester\_allow\_remote\_vpc\_dns\_resolution)| Allow requester VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the accepter VPC |`bool`|`true`| no |
357
-
| <aname="input_requester_aws_access_key"></a> [requester\_aws\_access\_key](#input\_requester\_aws\_access\_key)| Access key id to use in requester account |`string`|`null`| no |
| <aname="input_requester_aws_profile"></a> [requester\_aws\_profile](#input\_requester\_aws\_profile)| Profile used to assume requester\_aws\_assume\_role\_arn |`string`|`""`| no |
360
-
| <aname="input_requester_aws_secret_key"></a> [requester\_aws\_secret\_key](#input\_requester\_aws\_secret\_key)| Secret access key to use in requester account |`string`|`null`| no |
361
-
| <aname="input_requester_aws_token"></a> [requester\_aws\_token](#input\_requester\_aws\_token)| Session token for validating temporary credentials |`string`|`null`| no |
| <aname="input_requester_subnet_tags"></a> [requester\_subnet\_tags](#input\_requester\_subnet\_tags)| Only add peer routes to requester VPC route tables of subnets matching these tags |`map(string)`|`{}`| no |
364
371
| <aname="input_requester_vpc_id"></a> [requester\_vpc\_id](#input\_requester\_vpc\_id)| Requester VPC ID filter |`string`|`""`| no |
365
372
| <aname="input_requester_vpc_tags"></a> [requester\_vpc\_tags](#input\_requester\_vpc\_tags)| Requester VPC Tags filter |`map(string)`|`{}`| no |
366
-
| <aname="input_skip_metadata_api_check"></a> [skip\_metadata\_api\_check](#input\_skip\_metadata\_api\_check)| Don't use the credentials of EC2 instance profile |`bool`|`false`| no |
367
373
| <aname="input_stage"></a> [stage](#input\_stage)| ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' |`string`|`null`| no |
368
374
| <aname="input_tags"></a> [tags](#input\_tags)| Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br/>Neither the tag keys nor the tag values will be modified by this module. |`map(string)`|`{}`| no |
369
375
| <aname="input_tenant"></a> [tenant](#input\_tenant)| ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for |`string`|`null`| no |
0 commit comments