From db33995e480b0e03dd532af308723cf85fe64cb4 Mon Sep 17 00:00:00 2001 From: Steven Martin Date: Mon, 7 Oct 2024 15:59:10 -0400 Subject: [PATCH 1/4] update bastion machine type to variable in AWS HA terraform --- examples/aws/terraform/ha-autoscale-cluster/bastion.tf | 2 +- examples/aws/terraform/ha-autoscale-cluster/vars.tf | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/aws/terraform/ha-autoscale-cluster/bastion.tf b/examples/aws/terraform/ha-autoscale-cluster/bastion.tf index 26d9d6f376396..3d26ef7f07a5c 100644 --- a/examples/aws/terraform/ha-autoscale-cluster/bastion.tf +++ b/examples/aws/terraform/ha-autoscale-cluster/bastion.tf @@ -5,7 +5,7 @@ resource "aws_instance" "bastion" { count = "1" ami = data.aws_ami.base.id - instance_type = "t4g.medium" + instance_type = var.bastion_instance_type key_name = var.key_name associate_public_ip_address = true source_dest_check = false diff --git a/examples/aws/terraform/ha-autoscale-cluster/vars.tf b/examples/aws/terraform/ha-autoscale-cluster/vars.tf index 27d381e750a04..735e327d8a8e2 100644 --- a/examples/aws/terraform/ha-autoscale-cluster/vars.tf +++ b/examples/aws/terraform/ha-autoscale-cluster/vars.tf @@ -38,6 +38,12 @@ variable "node_instance_type" { default = "t4g.medium" } +// Instance type used for bastion server +variable "bastion_instance_type" { + type = string + default = "t4g.medium" +} + // SSH key name to provision instances withx variable "key_name" { type = string From 8517fc99554526dedd6b1c9d31f308c1ab094520 Mon Sep 17 00:00:00 2001 From: Steven Martin Date: Mon, 7 Oct 2024 17:34:37 -0400 Subject: [PATCH 2/4] Include instance type variables in README and Makefile for AWS HA terraform --- .../aws/terraform/ha-autoscale-cluster/Makefile | 17 +++++++++++++++++ .../terraform/ha-autoscale-cluster/README.md | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/examples/aws/terraform/ha-autoscale-cluster/Makefile b/examples/aws/terraform/ha-autoscale-cluster/Makefile index db17ff2d3a96d..7a5d7c605dc7e 100644 --- a/examples/aws/terraform/ha-autoscale-cluster/Makefile +++ b/examples/aws/terraform/ha-autoscale-cluster/Makefile @@ -21,6 +21,23 @@ TF_VAR_license_path ?= # FIPS 140-2 images are also available for Enterprise customers, look for '-fips' on the end of the AMI's name TF_VAR_ami_name ?= + +# Instance types used for authentication servers auto scale group +# This should match to the AMI instance architecture type, Arm or x86 +TF_VAR_auth_instance_type ?= m7g.large + +# Instance types used for proxy auto scale groups +# This should match to the AMI instance architecture type, Arm or x86 +TF_VAR_proxy_instance_type =? m7g.large + +# Instance types used for teleport nodes auto scale groups +# This should match to the AMI instance architecture type, Arm or x86 +TF_VAR_node_instance_type ?= t4g.medium + +# Instance type used for bastion server +# This should match to the AMI instance architecture type, Arm or x86 +TF_VAR_bastion_instance_type ?= t4g.medium + # Route 53 zone to use, should be the zone registered in AWS, e.g. example.com TF_VAR_route53_zone ?= diff --git a/examples/aws/terraform/ha-autoscale-cluster/README.md b/examples/aws/terraform/ha-autoscale-cluster/README.md index fb0353a49dc0a..57c7b85dcb744 100644 --- a/examples/aws/terraform/ha-autoscale-cluster/README.md +++ b/examples/aws/terraform/ha-autoscale-cluster/README.md @@ -48,6 +48,22 @@ export TF_VAR_cluster_name="teleport.example.com" # FIPS 140-2 images are also available for Enterprise customers, look for '-fips' on the end of the AMI's name export TF_VAR_ami_name="teleport-ent-14.3.3-arm64" +# Instance types used for authentication servers auto scale group +# This should match to the AMI instance architecture type, Arm or x86 +TF_VAR_auth_instance_type ?= m7g.large + +# Instance types used for proxy auto scale groups +# This should match to the AMI instance architecture type, Arm or x86 +TF_VAR_proxy_instance_type =? m7g.large + +# Instance types used for teleport nodes auto scale groups +# This should match to the AMI instance architecture type, Arm or x86 +TF_VAR_node_instance_type ?= t4g.medium + +# Instance type used for bastion server +# This should match to the AMI instance architecture type, Arm or x86 +TF_VAR_bastion_instance_type ?= t4g.medium + # AWS SSH key name to provision in installed instances, should be available in the region export TF_VAR_key_name="example" From 7a9ae4eee0c5c70130d8bbece838fd4373a9e658 Mon Sep 17 00:00:00 2001 From: Steven Martin Date: Tue, 8 Oct 2024 09:20:20 -0400 Subject: [PATCH 3/4] update comments and spacing for aws ha terraform Co-authored-by: Gus Luxton --- .../aws/terraform/ha-autoscale-cluster/Makefile | 16 ++++++++-------- .../aws/terraform/ha-autoscale-cluster/README.md | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/aws/terraform/ha-autoscale-cluster/Makefile b/examples/aws/terraform/ha-autoscale-cluster/Makefile index 7a5d7c605dc7e..01a4276b09729 100644 --- a/examples/aws/terraform/ha-autoscale-cluster/Makefile +++ b/examples/aws/terraform/ha-autoscale-cluster/Makefile @@ -22,21 +22,21 @@ TF_VAR_license_path ?= TF_VAR_ami_name ?= -# Instance types used for authentication servers auto scale group -# This should match to the AMI instance architecture type, Arm or x86 +# Instance types used for authentication server auto scaling group +# This should match to the AMI instance architecture type, ARM or x86 TF_VAR_auth_instance_type ?= m7g.large -# Instance types used for proxy auto scale groups -# This should match to the AMI instance architecture type, Arm or x86 +# Instance types used for proxy server auto scaling group +# This should match to the AMI instance architecture type, ARM or x86 TF_VAR_proxy_instance_type =? m7g.large -# Instance types used for teleport nodes auto scale groups -# This should match to the AMI instance architecture type, Arm or x86 +# Instance types used for Teleport node auto scaling group +# This should match to the AMI instance architecture type, ARM or x86 TF_VAR_node_instance_type ?= t4g.medium # Instance type used for bastion server -# This should match to the AMI instance architecture type, Arm or x86 -TF_VAR_bastion_instance_type ?= t4g.medium +# This should match to the AMI instance architecture type, ARM or x86 +TF_VAR_bastion_instance_type ?= t4g.medium # Route 53 zone to use, should be the zone registered in AWS, e.g. example.com TF_VAR_route53_zone ?= diff --git a/examples/aws/terraform/ha-autoscale-cluster/README.md b/examples/aws/terraform/ha-autoscale-cluster/README.md index 57c7b85dcb744..923e8ee44f81d 100644 --- a/examples/aws/terraform/ha-autoscale-cluster/README.md +++ b/examples/aws/terraform/ha-autoscale-cluster/README.md @@ -48,21 +48,21 @@ export TF_VAR_cluster_name="teleport.example.com" # FIPS 140-2 images are also available for Enterprise customers, look for '-fips' on the end of the AMI's name export TF_VAR_ami_name="teleport-ent-14.3.3-arm64" -# Instance types used for authentication servers auto scale group -# This should match to the AMI instance architecture type, Arm or x86 +# Instance types used for authentication server auto scaling group +# This should match to the AMI instance architecture type, ARM or x86 TF_VAR_auth_instance_type ?= m7g.large -# Instance types used for proxy auto scale groups -# This should match to the AMI instance architecture type, Arm or x86 +# Instance types used for proxy auto scaling group +# This should match to the AMI instance architecture type, ARM or x86 TF_VAR_proxy_instance_type =? m7g.large -# Instance types used for teleport nodes auto scale groups -# This should match to the AMI instance architecture type, Arm or x86 +# Instance types used for Teleport node auto scaling group +# This should match to the AMI instance architecture type, ARM or x86 TF_VAR_node_instance_type ?= t4g.medium # Instance type used for bastion server -# This should match to the AMI instance architecture type, Arm or x86 -TF_VAR_bastion_instance_type ?= t4g.medium +# This should match to the AMI instance architecture type, ARM or x86 +TF_VAR_bastion_instance_type ?= t4g.medium # AWS SSH key name to provision in installed instances, should be available in the region export TF_VAR_key_name="example" From 1cec004971ff75355c0650ff7d31a12334b85af2 Mon Sep 17 00:00:00 2001 From: Steven Martin Date: Tue, 8 Oct 2024 09:59:07 -0400 Subject: [PATCH 4/4] fix variable assignment for Makefile,README in aws ha terraform --- examples/aws/terraform/ha-autoscale-cluster/Makefile | 2 +- examples/aws/terraform/ha-autoscale-cluster/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/aws/terraform/ha-autoscale-cluster/Makefile b/examples/aws/terraform/ha-autoscale-cluster/Makefile index 01a4276b09729..04c1848ec74a8 100644 --- a/examples/aws/terraform/ha-autoscale-cluster/Makefile +++ b/examples/aws/terraform/ha-autoscale-cluster/Makefile @@ -28,7 +28,7 @@ TF_VAR_auth_instance_type ?= m7g.large # Instance types used for proxy server auto scaling group # This should match to the AMI instance architecture type, ARM or x86 -TF_VAR_proxy_instance_type =? m7g.large +TF_VAR_proxy_instance_type ?= m7g.large # Instance types used for Teleport node auto scaling group # This should match to the AMI instance architecture type, ARM or x86 diff --git a/examples/aws/terraform/ha-autoscale-cluster/README.md b/examples/aws/terraform/ha-autoscale-cluster/README.md index 923e8ee44f81d..ac724d7f6083f 100644 --- a/examples/aws/terraform/ha-autoscale-cluster/README.md +++ b/examples/aws/terraform/ha-autoscale-cluster/README.md @@ -54,7 +54,7 @@ TF_VAR_auth_instance_type ?= m7g.large # Instance types used for proxy auto scaling group # This should match to the AMI instance architecture type, ARM or x86 -TF_VAR_proxy_instance_type =? m7g.large +TF_VAR_proxy_instance_type ?= m7g.large # Instance types used for Teleport node auto scaling group # This should match to the AMI instance architecture type, ARM or x86