From 438a7b3ee64a0dceded3a245065cc062c55434a7 Mon Sep 17 00:00:00 2001 From: Spencer Tuft Date: Thu, 17 Jun 2021 16:48:19 -0600 Subject: [PATCH] Allow different instance types, change default to t3 --- README.md | 2 +- main.tf | 2 +- variables.tf | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f3d89cd..734605d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ provider "aws" { } module "bastion" { - source = "github.com/byu-oit/terraform-aws-bastion.git?ref=v2.0.1" + source = "github.com/byu-oit/terraform-aws-bastion.git?ref=v2.1.0" env = "prd" vpc_vpn_to_campus = true netid = "mynetid" diff --git a/main.tf b/main.tf index c73620b..e759d52 100644 --- a/main.tf +++ b/main.tf @@ -25,7 +25,7 @@ data "aws_ssm_parameter" "ami" { resource "aws_instance" "bastion" { ami = data.aws_ssm_parameter.ami.value - instance_type = "t2.micro" + instance_type = var.instance_type key_name = aws_key_pair.key.key_name subnet_id = module.acs["${var.subnet_type}_subnet_ids"][0] vpc_security_group_ids = [aws_security_group.sg.id] diff --git a/variables.tf b/variables.tf index e808f08..371d5fc 100644 --- a/variables.tf +++ b/variables.tf @@ -29,3 +29,9 @@ variable "subnet_type" { default = "public" description = "Which subnet type should the bastion launch in? (e.g. public, private, data)" } + +variable "instance_type" { + type = string + default = "t3.micro" + description = "The EC2 instance type to deploy (defaults to t3.micro)" +}