Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fff1aa9
Update Makefile, Makefile, Makefile, and 3 more files
armdupre Jun 29, 2026
f811862
Update cloud-init.yml, cloud-init.yml, cloud-init.yml, and 3 more files
armdupre Jun 29, 2026
6444feb
Update locals.tf, locals.tf, locals.tf, and 3 more files
armdupre Jun 29, 2026
e15b7e8
Update main.tf, main.tf, main.tf, and 3 more files
armdupre Jun 29, 2026
05df5c2
Update terraform.optional.auto.tfvars, terraform.optional.auto.tfvars…
armdupre Jun 29, 2026
bdd3478
Update variables.tf, variables.tf, variables.tf, and 3 more files
armdupre Jun 29, 2026
f8ee7c4
Update vpc.tf, vpc.tf, vpc.tf, and 1 more file
armdupre Jun 29, 2026
edb1537
Initial Checkin.
armdupre Jun 29, 2026
5e47079
Update Makefile, Makefile, Makefile, and 3 more files
armdupre Jul 5, 2026
8c7b97e
Update main.tf, main.tf, main.tf, and 2 more files
armdupre Jul 5, 2026
4c4231e
Update variables.tf, variables.tf, variables.tf, and 3 more files
armdupre Jul 5, 2026
b3fcaf6
Update vnet.tf, main.tf, vnet.tf, and 3 more files
armdupre Jul 5, 2026
1a146fb
Update .gitignore
armdupre Jul 5, 2026
6ef2fdc
Initial Checkin.
armdupre Jul 5, 2026
99aee72
Update Makefile, Makefile, Makefile, and 1 more file
armdupre Jul 5, 2026
21fc925
Update main.tf, main.tf, main.tf, and 1 more file
armdupre Jul 5, 2026
0b70549
Update output.tf, vpc.tf, vpc.tf, and 1 more file
armdupre Jul 5, 2026
c7421f6
Update Makefile, Makefile, Makefile, and 3 more files
armdupre Jul 7, 2026
12e641d
Update Makefile
armdupre Jul 7, 2026
1b4eda3
Update variables.tf
armdupre Jul 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
terraform.auto.tfvars
backend.tf
.sshkey.pem

terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
SHELL := /bin/bash
.SHELLFLAGS := -euo pipefail -c

TF_DATA_DIR := /tmp/tfdata-$(notdir $(CURDIR))
export TF_DATA_DIR

TF := time terraform
TF_FLAGS := -auto-approve

aws: install all

Expand All @@ -16,34 +23,45 @@ endif
endif

version:
time terraform version
@echo "=== $(TF) version ==="
$(TF) version

init:
time terraform init
@echo "=== $(TF) init ==="
$(TF) init

validate:
time terraform validate
@echo "=== $(TF) validate ==="
$(TF) validate

update:
time terraform get -update
@echo "=== $(TF) update ==="
$(TF) get -update

plan:
time terraform plan
@echo "=== $(TF) plan ==="
$(TF) plan

apply:
time terraform apply -auto-approve
@echo "=== $(TF) apply ==="
$(TF) apply $(TF_FLAGS)

destroy:
time terraform destroy -auto-approve
@echo "=== $(TF) destroy ==="
$(TF) destroy $(TF_FLAGS)

output:
time terraform output
@echo "=== $(TF) output ==="
$(TF) output

ssh:
time terraform output SshKey | tail -n +3 | head -n-3 | sed "s/^[ \t]*//" > .sshkey.pem
@echo "=== $(TF) ssh ==="
$(TF) output SshKey | tail -n +3 | head -n-3 | sed "s/^[ \t]*//" > .sshkey.pem
chmod 400 .sshkey.pem

state:
time terraform state list
@echo "=== $(TF) state ==="
$(TF) state list

connect: connect-app

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ write_files:
defer: true
runcmd:
- chmod 755 /home/${UserName}/.ssh
- chown ${UserName}:${UserName} /home/${UserName}/.ssh
- chown ${UserName}:${UserName} /home/${UserName}/.ssh
output:
all: "| tee -a /var/log/terraform-cloud-init-output.log"
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ locals {
Preamble = "${local.UserLoginTag}-${local.UserProjectTag}-${local.AppTag}"
PrivateSubnetAvailabilityZone = var.PrivateSubnetAvailabilityZone
PublicSubnetAvailabilityZone = var.PublicSubnetAvailabilityZone
Region = data.aws_region.current.id
Region = data.aws_region.current.region
SshKeyAlgorithm = "RSA"
SshKeyName = "${local.Preamble}-ssh-key"
SshKeyRsaBits = "4096"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "App" {
source = "git::https://github.com/Keysight/terraform-aws-module-bps-app.git?ref=26.0.0"
source = "git::https://github.com/Keysight/terraform-aws-module-bps-app.git?ref=26.1.0"
Eth0SecurityGroupId = module.Vpc.PublicSecurityGroup.id
Eth0SubnetId = module.Vpc.PublicSubnet.id
InstanceType = local.AppInstanceType
Expand All @@ -13,7 +13,7 @@ module "App" {
}

module "Agent1" {
source = "git::https://github.com/Keysight/terraform-aws-module-bps-agent.git?ref=26.0.0"
source = "git::https://github.com/Keysight/terraform-aws-module-bps-agent.git?ref=26.1.0"
Eth0SecurityGroupId = module.Vpc.PublicSecurityGroup.id
Eth0SubnetId = module.Vpc.PublicSubnet.id
Eth1SecurityGroupId = module.Vpc.PrivateSecurityGroup.id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AgentInstanceType = "c6in.xlarge"
# AgentInstanceType = "c5n.xlarge"
# ApiMaxRetries = 1
# AppInstanceType = "c5.xlarge"
# InboundIPv4CidrBlocks = [ "0.0.0.0/0" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variable "AgentInstanceType" {
default = "c6in.xlarge"
default = "c5n.xlarge"
description = "Instance type of Agent VM"
type = string
validation {
Expand Down Expand Up @@ -44,6 +44,7 @@ variable "PrivateSubnetAvailabilityZone" {

variable "PublicSubnetAvailabilityZone" {
default = "us-east-1a"
description = "AZ id associated with the public subnet"
type = string
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "Vpc" {
source = "git::https://github.com/Keysight/terraform-aws-module-1-vpc-1-public-subnet-1-private-subnet.git?ref=26.0.0"
source = "git::https://github.com/Keysight/terraform-aws-module-1-vpc-1-public-subnet-1-private-subnet.git?ref=26.1.0"
InboundIPv4CidrBlocks = local.InboundIPv4CidrBlocks
PrivateSubnetAvailabilityZone = local.PrivateSubnetAvailabilityZone
PublicSubnetAvailabilityZone = local.PublicSubnetAvailabilityZone
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
SHELL := /bin/bash
.SHELLFLAGS := -euo pipefail -c

TF_DATA_DIR := /tmp/tfdata-$(notdir $(CURDIR))
export TF_DATA_DIR

TF := time terraform
TF_FLAGS := -auto-approve

aws: install all

Expand All @@ -16,34 +23,45 @@ endif
endif

version:
time terraform version
@echo "=== $(TF) version ==="
$(TF) version

init:
time terraform init
@echo "=== $(TF) init ==="
$(TF) init

validate:
time terraform validate
@echo "=== $(TF) validate ==="
$(TF) validate

update:
time terraform get -update
@echo "=== $(TF) update ==="
$(TF) get -update

plan:
time terraform plan
@echo "=== $(TF) plan ==="
$(TF) plan

apply:
time terraform apply -auto-approve
@echo "=== $(TF) apply ==="
$(TF) apply $(TF_FLAGS)

destroy:
time terraform destroy -auto-approve
@echo "=== $(TF) destroy ==="
$(TF) destroy $(TF_FLAGS)

output:
time terraform output
@echo "=== $(TF) output ==="
$(TF) output

ssh:
time terraform output SshKey | tail -n +3 | head -n-3 | sed "s/^[ \t]*//" > .sshkey.pem
@echo "=== $(TF) ssh ==="
$(TF) output SshKey | tail -n +3 | head -n-3 | sed "s/^[ \t]*//" > .sshkey.pem
chmod 400 .sshkey.pem

state:
time terraform state list
@echo "=== $(TF) state ==="
$(TF) state list

connect: connect-app

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ write_files:
defer: true
runcmd:
- chmod 755 /home/${UserName}/.ssh
- chown ${UserName}:${UserName} /home/${UserName}/.ssh
- chown ${UserName}:${UserName} /home/${UserName}/.ssh
output:
all: "| tee -a /var/log/terraform-cloud-init-output.log"
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ locals {
Private1SubnetAvailabilityZone = var.Private1SubnetAvailabilityZone
Private2SubnetAvailabilityZone = var.Private2SubnetAvailabilityZone
PublicSubnetAvailabilityZone = var.PublicSubnetAvailabilityZone
Region = data.aws_region.current.id
Region = data.aws_region.current.region
SshKeyAlgorithm = "RSA"
SshKeyName = "${local.Preamble}-ssh-key"
SshKeyRsaBits = "4096"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "App" {
source = "git::https://github.com/Keysight/terraform-aws-module-bps-app.git?ref=26.0.0"
source = "git::https://github.com/Keysight/terraform-aws-module-bps-app.git?ref=26.1.0"
Eth0SecurityGroupId = module.Vpc.PublicSecurityGroup.id
Eth0SubnetId = module.Vpc.PublicSubnet.id
InstanceType = local.AppInstanceType
Expand All @@ -13,7 +13,7 @@ module "App" {
}

module "Agent1" {
source = "git::https://github.com/Keysight/terraform-aws-module-bps-agent.git?ref=26.0.0"
source = "git::https://github.com/Keysight/terraform-aws-module-bps-agent.git?ref=26.1.0"
Eth0SecurityGroupId = module.Vpc.PublicSecurityGroup.id
Eth0SubnetId = module.Vpc.PublicSubnet.id
Eth1SecurityGroupId = module.Vpc.PrivateSecurityGroup.id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AgentInstanceType = "c6in.xlarge"
# AgentInstanceType = "c5n.xlarge"
# ApiMaxRetries = 1
# AppInstanceType = "c5.xlarge"
# InboundIPv4CidrBlocks = [ "0.0.0.0/0" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variable "AgentInstanceType" {
default = "c6in.xlarge"
default = "c5n.xlarge"
description = "Instance type of Agent VM"
type = string
validation {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "Vpc" {
source = "git::https://github.com/Keysight/terraform-aws-module-1-vpc-1-public-subnet-2-private-subnets.git?ref=26.0.0"
source = "git::https://github.com/Keysight/terraform-aws-module-1-vpc-1-public-subnet-2-private-subnets.git?ref=26.1.0"
InboundIPv4CidrBlocks = local.InboundIPv4CidrBlocks
Private1SubnetAvailabilityZone = local.Private1SubnetAvailabilityZone
Private2SubnetAvailabilityZone = local.Private2SubnetAvailabilityZone
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
SHELL := /bin/bash
.SHELLFLAGS := -euo pipefail -c

TF_DATA_DIR := /tmp/tfdata-$(notdir $(CURDIR))
export TF_DATA_DIR

TF := time terraform
TF_FLAGS := -auto-approve

aws: install all

Expand All @@ -16,34 +23,45 @@ endif
endif

version:
time terraform version
@echo "=== $(TF) version ==="
$(TF) version

init:
time terraform init
@echo "=== $(TF) init ==="
$(TF) init

validate:
time terraform validate
@echo "=== $(TF) validate ==="
$(TF) validate

update:
time terraform get -update
@echo "=== $(TF) update ==="
$(TF) get -update

plan:
time terraform plan
@echo "=== $(TF) plan ==="
$(TF) plan

apply:
time terraform apply -auto-approve
@echo "=== $(TF) apply ==="
$(TF) apply $(TF_FLAGS)

destroy:
time terraform destroy -auto-approve
@echo "=== $(TF) destroy ==="
$(TF) destroy $(TF_FLAGS)

output:
time terraform output
@echo "=== $(TF) output ==="
$(TF) output

ssh:
time terraform output SshKey | tail -n +3 | head -n-3 | sed "s/^[ \t]*//" > .sshkey.pem
@echo "=== $(TF) ssh ==="
$(TF) output SshKey | tail -n +3 | head -n-3 | sed "s/^[ \t]*//" > .sshkey.pem
chmod 400 .sshkey.pem

state:
time terraform state list
@echo "=== $(TF) state ==="
$(TF) state list

connect: connect-app

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ write_files:
defer: true
runcmd:
- chmod 755 /home/${UserName}/.ssh
- chown ${UserName}:${UserName} /home/${UserName}/.ssh
- chown ${UserName}:${UserName} /home/${UserName}/.ssh
output:
all: "| tee -a /var/log/terraform-cloud-init-output.log"
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ locals {
PrivateSubnetName = var.PrivateSubnetName
PublicSecurityGroupName = var.PublicSecurityGroupName
PublicSubnetName = var.PublicSubnetName
Region = data.aws_region.current.id
Region = data.aws_region.current.region
SshKeyAlgorithm = "RSA"
SshKeyName = "${local.Preamble}-ssh-key"
SshKeyRsaBits = "4096"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "App" {
source = "git::https://github.com/Keysight/terraform-aws-module-bps-app.git?ref=26.0.0"
source = "git::https://github.com/Keysight/terraform-aws-module-bps-app.git?ref=26.1.0"
Eth0SecurityGroupId = data.aws_security_group.PublicSecurityGroup.id
Eth0SubnetId = data.aws_subnet.PublicSubnet.id
InstanceType = local.AppInstanceType
Expand All @@ -10,7 +10,7 @@ module "App" {
}

module "Agent1" {
source = "git::https://github.com/Keysight/terraform-aws-module-bps-agent.git?ref=26.0.0"
source = "git::https://github.com/Keysight/terraform-aws-module-bps-agent.git?ref=26.1.0"
Eth0SecurityGroupId = data.aws_security_group.PublicSecurityGroup.id
Eth0SubnetId = data.aws_subnet.PublicSubnet.id
Eth1SecurityGroupId = data.aws_security_group.PrivateSecurityGroup.id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AgentInstanceType = "c6in.xlarge"
# AgentInstanceType = "c5n.xlarge"
# ApiMaxRetries = 1
# AppInstanceType = "c5.xlarge"
# Region = "us-east-1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variable "AgentInstanceType" {
default = "c6in.xlarge"
default = "c5n.xlarge"
description = "Instance type of Agent VM"
type = string
validation {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

while getopts i: flag
do
case "${flag}" in
i) PublicIp=${OPTARG};;
esac
done

aws ec2 describe-instances \
--filters "Name=instance-state-name,Values=running" "Name=network-interface.association.public-ip,Values=$PublicIp" \
--query "Reservations[].Instances[].[InstanceId,Tags[?Key=='Name'].Value|[0]]" \
--output table
AgentId=$(aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" "Name=network-interface.association.public-ip,Values=$PublicIp" --query "Reservations[].Instances[].[InstanceId,Tags[?Key=='Name'].Value|[0]]" --output json | jq .[0][0] --raw-output)
aws ssm start-session \
--target $AgentId
Loading