From 2ef9e82d71336e2f2957b1fc843d80001695084c Mon Sep 17 00:00:00 2001 From: Michal Wieczorek Date: Mon, 3 Aug 2020 10:53:26 +0200 Subject: [PATCH] Enable setting EBS size for bastion instance --- CHANGELOG/2020-08-03-ebs-size.yml | 4 ++++ main.tf | 10 ++++++++++ variables.tf | 12 +++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG/2020-08-03-ebs-size.yml diff --git a/CHANGELOG/2020-08-03-ebs-size.yml b/CHANGELOG/2020-08-03-ebs-size.yml new file mode 100644 index 0000000..ae57fca --- /dev/null +++ b/CHANGELOG/2020-08-03-ebs-size.yml @@ -0,0 +1,4 @@ +- type: changed + m: Enable setting EBS size for bastion instance + jira: PLAT-5131 + owner: mwieczorek diff --git a/main.tf b/main.tf index 9226249..4b34ac6 100755 --- a/main.tf +++ b/main.tf @@ -52,6 +52,16 @@ resource "aws_launch_template" "bastion-service-host" { ) } + block_device_mappings { + device_name = var.bastion_ebs_device_name + + ebs { + volume_size = var.bastion_ebs_size + volume_type = "gp2" + delete_on_termination = "true" + } + } + lifecycle { create_before_destroy = true } diff --git a/variables.tf b/variables.tf index c25a1d8..60502a8 100755 --- a/variables.tf +++ b/variables.tf @@ -209,5 +209,15 @@ variable "on_demand_base_capacity" { variable "delete_network_interface_on_termination" { description = "if network interface created for bastion host should be deleted when instance in terminated. Setting propagated to aws_launch_template.network_interfaces.delete_on_termination" - default = true + default = true +} + +variable "bastion_ebs_size" { + description = "Size of EBS attached to the bastion instance" + default = 8 +} + +variable "bastion_ebs_device_name" { + description = "Name of bastion instance block device" + default = "/dev/xvda" }