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

Changes root volume default-type to gp3 #72

Closed
wants to merge 9 commits into from
2 changes: 1 addition & 1 deletion iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resource "aws_iam_instance_profile" "default" {

resource "aws_iam_role" "default" {
count = (module.this.enabled && local.instance_profile_count == 0) ? 0 : 1
name = module.this.id
name = "${module.this.id}-${data.aws_region}"
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe we'd accept this change as 1) I don't believe this would be a valid reference (i.e. it would fail) and 2) the develop can add the region (or region identifier) to their name via the context variables that make up module.this.id.

Can you please remove this and the rename from default => current before we potentially move this PR forward?

Copy link
Author

Choose a reason for hiding this comment

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

Didn't mean for this to be included. This PR was based on our master & not the volume-type specific branch.

I've based a PR on that branch & "started over" here: #77

path = "/"
tags = module.this.tags

Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ locals {
) : null
}

data "aws_region" "default" {}
data "aws_region" "current" {}

data "aws_ami" "default" {
most_recent = "true"
Expand Down Expand Up @@ -77,6 +77,7 @@ resource "aws_instance" "default" {
root_block_device {
encrypted = var.root_block_device_encrypted
volume_size = var.root_block_device_volume_size
volume_type = var.root_block_device_volume_type
}

# Optional block; skipped if var.ebs_block_device_volume_size is zero
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ variable "root_block_device_volume_size" {
description = "The volume size (in GiB) to provision for the root block device. It cannot be smaller than the AMI it refers to."
}

variable "root_block_device_volume_type" {
type = string
default = "gp3"
description = "The volume type."
Copy link
Member

Choose a reason for hiding this comment

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

Can you please list the valid values here? Or if this module requires 0.13+ then please include a validation block to ensure the user is only passing in accepted values.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, done in PR #77.

Closing this PR because it included incomplete edits from a different feature.

}

variable "disable_api_termination" {
type = bool
description = "Enable EC2 Instance Termination Protection"
Expand Down