Skip to content

Commit

Permalink
Merge pull request #5 from isovalent/add-bastion-vars
Browse files Browse the repository at this point in the history
Add additional vars to bastion
  • Loading branch information
darox committed Feb 16, 2023
2 parents 1ff50cd + 7c4c165 commit d50df2f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ module "bastion" {
source = "cloudposse/ec2-bastion-server/aws"
version = "0.30.1"

ami_filter = { name = [var.bastion_host_ami_name_filter] }
ami_owners = var.bastion_host_ami_owners
ami = var.bastion_host_ami_id
associate_public_ip_address = var.bastion_host_assign_public_ip
enabled = var.bastion_host_enabled
instance_type = var.bastion_host_instance_type
key_name = aws_key_pair.bastion[0].key_name
name = "${var.name}-bastion"
security_groups = var.bastion_host_extra_security_groups
Expand Down
25 changes: 25 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ variable "additional_public_subnets" {
}))
}

variable "bastion_host_ami_name_filter" {
description = "The AMI filter to use for the bastion host's AMI."
type = string
default = "amzn2-ami-hvm-2.*-x86_64-ebs"

}

variable "bastion_host_ami_owners" {
description = "The list of owners used to select the AMI."
type = list(string)
default = ["amazon"]
}

variable "bastion_host_ami_id" {
type = string
description = "The ID of the AIM to use for the instance. Setting this will ignore `bastion_host_ami_name_filter` and `bastion_host_ami_owners`."
default = null
}

variable "bastion_host_assign_public_ip" {
default = false
description = "Whether to assign a public IP address to the bastion host."
Expand All @@ -62,6 +81,12 @@ variable "bastion_host_extra_security_groups" {
type = list(string)
}

variable "bastion_host_instance_type" {
type = string
default = "t2.micro"
description = "The instance type to use for the bastion host."
}

variable "bastion_host_ssh_public_key" {
default = ""
description = "If specified, will be used as the public SSH key for the bastion host."
Expand Down

0 comments on commit d50df2f

Please sign in to comment.