Skip to content

Commit

Permalink
Upgrade AWS root volume to gp3 (it's cheaper) (#77)
Browse files Browse the repository at this point in the history
* Upgrade AWS root volume type to gp3 (it's cheaper)

* terraform fmt

* Quotes
  • Loading branch information
Katie Keel authored Jan 5, 2023
1 parent 533a622 commit 988bc6c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
8 changes: 8 additions & 0 deletions aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ Type: `string`

Default: `"true"`

#### root\_volume\_type

Description: The root volume type for the bastion instance.

Type: `string`

Default: `"gp3"`

#### ssh\_cidr\_blocks

Description: A list of CIDRs allowed to SSH to the bastion. Override the module default by specifying an empty list, []
Expand Down
4 changes: 2 additions & 2 deletions aws/auto-scaling.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ resource "aws_autoscaling_group" "bastion" {
dynamic "tag" {
for_each = var.extra_asg_tags
content {
key = tag.value["key"]
value = tag.value["value"]
key = tag.value["key"]
value = tag.value["value"]
propagate_at_launch = tag.value["propagate_at_launch"]
}
}
Expand Down
10 changes: 8 additions & 2 deletions aws/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ variable "encrypt_root_volume" {
}

variable "extra_asg_tags" {
type = list
type = list
description = "Extra tags for the bastion autoscaling group"
default = []
default = []
}

variable "root_volume_type" {
type = string
description = "The root volume type for the bastion instance"
default = "gp3"
}
5 changes: 3 additions & 2 deletions aws/launchconfig.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ resource "aws_launch_configuration" "bastion" {
associate_public_ip_address = "true"

user_data_base64 = base64gzip(data.template_file.bastion_user_data.rendered)
key_name = length(aws_key_pair.bastion) > 0 ? aws_key_pair.bastion[0].id : null
key_name = length(aws_key_pair.bastion) > 0 ? aws_key_pair.bastion[0].id : null

root_block_device {
encrypted = var.encrypt_root_volume
encrypted = var.encrypt_root_volume
volume_type = var.root_volume_type
}

lifecycle {
Expand Down

0 comments on commit 988bc6c

Please sign in to comment.