Skip to content

Allow to more easily set up multiple VPCs in the same account and region - #30

Merged
flichtenheld merged 2 commits into
mainfrom
test-setup
Jul 30, 2026
Merged

Allow to more easily set up multiple VPCs in the same account and region#30
flichtenheld merged 2 commits into
mainfrom
test-setup

Conversation

@flichtenheld

Copy link
Copy Markdown
Member

No description provided.

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_name variable and use it as the VPC module basename instead of the hardcoded "production".
  • Add a Deployment tag (from var.deployment) to key EC2 instances for clearer identification.
  • Update run_t_clients.sh to 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.

Comment thread t_server/tofu/openvpn_test_env/main.tf
…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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.deployment is 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"

@flichtenheld
flichtenheld merged commit f2870d8 into main Jul 30, 2026
1 check passed
@flichtenheld
flichtenheld deleted the test-setup branch July 30, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants