Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update bastion machine type to variable in AWS HA terraform #47297

Merged
merged 5 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
17 changes: 17 additions & 0 deletions examples/aws/terraform/ha-autoscale-cluster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
# This should match to the AMI instance architecture type, Arm or x86
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
TF_VAR_auth_instance_type ?= m7g.large

# Instance types used for proxy auto scale groups
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
# This should match to the AMI instance architecture type, Arm or x86
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
TF_VAR_proxy_instance_type =? m7g.large

# Instance types used for teleport nodes auto scale groups
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
# This should match to the AMI instance architecture type, Arm or x86
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
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
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
TF_VAR_bastion_instance_type ?= t4g.medium
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved

# Route 53 zone to use, should be the zone registered in AWS, e.g. example.com
TF_VAR_route53_zone ?=

Expand Down
16 changes: 16 additions & 0 deletions examples/aws/terraform/ha-autoscale-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-16.4.2-arm64"

# Instance types used for authentication servers auto scale group
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
# This should match to the AMI instance architecture type, Arm or x86
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
TF_VAR_auth_instance_type ?= m7g.large

# Instance types used for proxy auto scale groups
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
# This should match to the AMI instance architecture type, Arm or x86
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
TF_VAR_proxy_instance_type =? m7g.large

# Instance types used for teleport nodes auto scale groups
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
# This should match to the AMI instance architecture type, Arm or x86
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
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
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
TF_VAR_bastion_instance_type ?= t4g.medium
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved

# AWS SSH key name to provision in installed instances, should be available in the region
export TF_VAR_key_name="example"

Expand Down
2 changes: 1 addition & 1 deletion examples/aws/terraform/ha-autoscale-cluster/bastion.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions examples/aws/terraform/ha-autoscale-cluster/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
stevenGravy marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

In the interest of having a more "friendly" experience for new users, maybe we could default this to null, then conditionally set the instance type deployed based off of the AMI architecture from data.aws_ami.base?

Copy link
Contributor

Choose a reason for hiding this comment

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

I really like this idea, but think it's probably better implemented in a future PR as it'll require a fair bit more testing.

}

// SSH key name to provision instances withx
variable "key_name" {
type = string
Expand Down
Loading