Allow to more easily set up multiple VPCs in the same account and region - #30
Merged
Conversation
The old code only worked for sequences of TESTGROUPS that started at 1 and had no holes. We're already forcing bash, so use associative array feature to store the JOBS information better. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the OpenTofu-based OpenVPN test environment easier to deploy multiple times within the same AWS account/region by parameterizing environment naming and improving test client job tracking.
Changes:
- Add a new
vpc_namevariable and use it as the VPC module basename instead of the hardcoded"production". - Add a
Deploymenttag (fromvar.deployment) to key EC2 instances for clearer identification. - Update
run_t_clients.shto track background SSH jobs by test group using an associative array for more reliable wait/log association.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| t_server/tofu/openvpn_test_env/variables.tf | Adds vpc_name input to control VPC naming. |
| t_server/tofu/openvpn_test_env/main.tf | Switches VPC module basename from a constant to var.vpc_name. |
| t_server/tofu/openvpn_test_env/tserver_rocky_9_amd64.tf | Adds Deployment tag to the tserver instance. |
| t_server/tofu/openvpn_test_env/tserver_client.tf | Adds Deployment tag to the client instance. |
| t_server/tofu/openvpn_test_env/tserver_anchor.tf | Adds Deployment tag to the anchor instance. |
| t_server/tofu/openvpn_test_env/input.auto.tfvars.sample | Documents vpc_name in the sample tfvars. |
| t_server/original/run_t_clients.sh | Improves job PID tracking by mapping test group → PID via an associative array. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ccount - Allow to rename the VPC if manage_vpc is true - Actually use the deployment variable to name things I decided to not use "deployment" for the vpc name directly though often you will probably want to sync them. Still it might be useful to not conflate them. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
t_server/tofu/openvpn_test_env/variables.tf:44
var.deploymentis no longer EC2-specific: it’s used for naming/tagging security groups (e.g.tserver_sg.tf,sg.tf) and the TGW attachment (tgw.tf). The variable description should be generalized so it doesn’t mislead users into thinking it only affects EC2 resources.
description = "Deployment name added to EC2 resource names"
uddr
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.