Skip to content

Commit 1a9f5c6

Browse files
committed
terraform/AWS: Remove terraform_aws_enable_ebs_volumes
Setting the "volumes per instance" value is already what the scripting does underneath Kconfig. It's less complex to expose that setting to Kconfig users and get rid of "Enable EBS". Signed-off-by: Chuck Lever <[email protected]>
1 parent 434668e commit 1a9f5c6

File tree

9 files changed

+11
-31
lines changed

9 files changed

+11
-31
lines changed

playbooks/roles/gen_tfvars/defaults/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ terraform_private_net_enabled: "false"
1717
terraform_private_net_prefix: ""
1818
terraform_private_net_mask: 0
1919

20-
terraform_aws_enable_ebs: False
21-
2220
terraform_oci_region: "invalid"
2321
terraform_oci_tenancy_ocid: "invalid"
2422
terraform_oci_user_ocid: "invalid"

playbooks/roles/gen_tfvars/templates/aws/terraform.tfvars.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ aws_availability_zone = "{{ terraform_aws_av_zone }}"
44
aws_name_search = "{{ terraform_aws_ns }}"
55
aws_ami_owner = "{{ terraform_aws_ami_owner }}"
66
aws_instance_type = "{{ terraform_aws_instance_type }}"
7-
aws_enable_ebs = "{{ terraform_aws_enable_ebs | lower }}"
87
aws_ebs_volumes_per_instance = "{{ terraform_aws_ebs_volumes_per_instance }}"
98
aws_ebs_volume_size = {{ terraform_aws_ebs_volume_size }}
109
aws_ebs_volume_type = "{{ terraform_aws_ebs_volume_type }}"

scripts/terraform.Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ KDEVOPS_MRPROPER += $(KDEVOPS_NODES)
4747

4848
DEFAULT_DEPS_REQS_EXTRA_VARS += $(KDEVOPS_TFVARS)
4949

50-
ifeq (y,$(CONFIG_TERRAFORM_AWS))
51-
ifeq (y,$(CONFIG_TERRAFORM_AWS_ENABLE_EBS_VOLUMES))
52-
TERRAFORM_EXTRA_VARS += terraform_aws_enable_ebs='True'
53-
endif # CONFIG_TERRAFORM_AWS_ENABLE_EBS_VOLUMES
54-
55-
endif
56-
5750
ifeq (y,$(CONFIG_TERRAFORM_OCI))
5851
TERRAFORM_EXTRA_VARS += terraform_oci_region=$(subst ",,$(CONFIG_TERRAFORM_OCI_REGION))
5952
TERRAFORM_EXTRA_VARS += terraform_oci_tenancy_ocid=$(subst ",,$(CONFIG_TERRAFORM_OCI_TENANCY_OCID))

terraform/aws/kconfigs/Kconfig.storage

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
config TERRAFORM_AWS_ENABLE_EBS_VOLUMES
2-
bool "Enable EBS volumes"
3-
help
4-
Enable this to enable EBS volumes.
5-
6-
if TERRAFORM_AWS_ENABLE_EBS_VOLUMES
7-
81
choice
92
prompt "Number of EBS volumes"
103
default TERRAFORM_AWS_EBS_VOLUMES_PER_INSTANCE_4
114

5+
config TERRAFORM_AWS_EBS_VOLUMES_PER_INSTANCE_0
6+
bool "0"
7+
128
config TERRAFORM_AWS_EBS_VOLUMES_PER_INSTANCE_1
139
bool "1"
1410

@@ -44,6 +40,7 @@ endchoice
4440
config TERRAFORM_AWS_EBS_VOLUMES_PER_INSTANCE
4541
int
4642
output yaml
43+
default 0 if TERRAFORM_AWS_EBS_VOLUMES_PER_INSTANCE_0
4744
default 1 if TERRAFORM_AWS_EBS_VOLUMES_PER_INSTANCE_1
4845
default 2 if TERRAFORM_AWS_EBS_VOLUMES_PER_INSTANCE_2
4946
default 3 if TERRAFORM_AWS_EBS_VOLUMES_PER_INSTANCE_3
@@ -190,8 +187,6 @@ config TERRAFORM_AWS_EBS_VOLUME_SIZE
190187
default 3078 if TERRAFORM_AWS_EBS_VOLUME_SIZE_3078G
191188
default 4096 if TERRAFORM_AWS_EBS_VOLUME_SIZE_4096G
192189

193-
endif # TERRAFORM_AWS_ENABLE_EBS_VOLUMES
194-
195190
config TERRAFORM_AWS_DATA_VOLUME_DEVICE_FILE_NAME
196191
string
197192
default "/dev/nvme1n1"

terraform/aws/kconfigs/instance-types/Kconfig.c7a

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ choice
44
prompt "AWS instance size"
55
default TERRAFORM_AWS_INSTANCE_SIZE_C7A_8XLARGE
66
help
7-
Add storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
8-
option and adjusting the size and number of additional devices.
7+
Add storage by increasing the number of EBS volumes per
8+
instance.
99

1010
config TERRAFORM_AWS_INSTANCE_SIZE_C7A_8XLARGE
1111
bool "c7a.8xlarge"

terraform/aws/kconfigs/instance-types/Kconfig.m5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ choice
44
prompt "AWS instance type"
55
default TERRAFORM_AWS_INSTANCE_SIZE_M5AD_4XLARGE
66
help
7-
Add storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
8-
option and adjusting the size and number of additional devices.
7+
Add storage by increasing the number of EBS volumes per
8+
instance.
99

1010
config TERRAFORM_AWS_INSTANCE_SIZE_M5AD_LARGE
1111
bool "m5ad.large"

terraform/aws/kconfigs/instance-types/Kconfig.m7a

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ choice
44
prompt "AWS instance type"
55
default TERRAFORM_AWS_INSTANCE_SIZE_M7A_XLARGE
66
help
7-
Add storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
8-
option and adjusting the size and number of additional devices.
7+
Add storage by increasing the number of EBS volumes per
8+
instance.
99

1010
config TERRAFORM_AWS_INSTANCE_SIZE_M7A_MEDIUM
1111
bool "m7a.medium"

terraform/aws/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ resource "aws_instance" "kdevops_instance" {
139139
}
140140

141141
module "kdevops_ebs_volumes" {
142-
count = var.aws_enable_ebs == "true" ? local.kdevops_num_boxes : 0
142+
count = var.aws_ebs_volumes_per_instance > 0 ? local.kdevops_num_boxes : 0
143143
source = "./kdevops_ebs_volumes"
144144
vol_availability_zone = var.aws_availability_zone
145145
vol_count = var.aws_ebs_volumes_per_instance

terraform/aws/vars.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ variable "aws_instance_type" {
5555
type = string
5656
}
5757

58-
variable "aws_enable_ebs" {
59-
description = "Whether or not to enable EBS"
60-
type = string
61-
}
62-
6358
variable "aws_ebs_volumes_per_instance" {
6459
description = "Number of EBS volumes to create per instance"
6560
type = number

0 commit comments

Comments
 (0)