Skip to content

Commit 40747b4

Browse files
committed
terraform/Azure: Use "output yaml" for the EBS volume iops setting
Remove the line in terraform.Makefile that sets "terraform_aws_ebs_volume_iops" and just pass it directly from Kconfig via an "output yaml" directive. We can also remove NEEDS_IOPS and simply detect whether the output variable was defined or not when building the terraform.tfvars file. Signed-off-by: Chuck Lever <[email protected]>
1 parent 4baf73f commit 40747b4

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ aws_enable_ebs = "{{ terraform_aws_enable_ebs | lower }}"
88
aws_ebs_volumes_per_instance = "{{ terraform_aws_ebs_volumes_per_instance }}"
99
aws_ebs_volume_size = "{{ terraform_aws_ebs_volume_size }}"
1010
aws_ebs_volume_type = "{{ terraform_aws_ebs_volume_type }}"
11-
{% if terraform_aws_ebs_volume_needs_iops %}
11+
{% if terraform_aws_ebs_volume_iops is defined %}
1212
aws_ebs_volume_iops = {{ terraform_aws_ebs_volume_iops }}
1313
{% endif %}
1414

scripts/terraform.Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ ifeq (y,$(CONFIG_TERRAFORM_AWS))
5151
ifeq (y,$(CONFIG_TERRAFORM_AWS_ENABLE_EBS_VOLUMES))
5252
TERRAFORM_EXTRA_VARS += terraform_aws_enable_ebs='True'
5353
TERRAFORM_EXTRA_VARS += terraform_aws_ebs_volume_size=$(subst ",,$(CONFIG_TERRAFORM_TERRAFORM_AWS_EBS_VOLUME_SIZE))
54-
ifeq (y,$(CONFIG_TERRAFORM_AWS_EBS_VOLUME_NEEDS_IOPS))
55-
TERRAFORM_EXTRA_VARS += terraform_aws_ebs_volume_needs_iops=true
56-
TERRAFORM_EXTRA_VARS += terraform_aws_ebs_volume_iops=$(subst ",,$(CONFIG_TERRAFORM_AWS_EBS_VOLUME_IOPS))
57-
else
58-
TERRAFORM_EXTRA_VARS += terraform_aws_ebs_volume_needs_iops=false
59-
endif
6054
endif # CONFIG_TERRAFORM_AWS_ENABLE_EBS_VOLUMES
6155

6256
endif

terraform/aws/kconfigs/Kconfig.storage

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,17 @@ config TERRAFORM_AWS_EBS_VOLUME_TYPE
9696
default "io1" if TERRAFORM_AWS_EBS_VOLUME_TYPE_IO1
9797
default "io2" if TERRAFORM_AWS_EBS_VOLUME_TYPE_IO2
9898

99-
config TERRAFORM_AWS_EBS_VOLUME_NEEDS_IOPS
100-
bool
101-
default n if TERRAFORM_AWS_EBS_VOLUME_TYPE_GP2
102-
default n if TERRAFORM_AWS_EBS_VOLUME_TYPE_GP3
103-
default y if TERRAFORM_AWS_EBS_VOLUME_TYPE_IO1
104-
default y if TERRAFORM_AWS_EBS_VOLUME_TYPE_IO2
105-
106-
if TERRAFORM_AWS_EBS_VOLUME_NEEDS_IOPS
99+
if TERRAFORM_AWS_EBS_VOLUME_TYPE_GP3 || TERRAFORM_AWS_EBS_VOLUME_TYPE_IO1 || TERRAFORM_AWS_EBS_VOLUME_TYPE_IO2
107100

108101
config TERRAFORM_AWS_EBS_VOLUME_IOPS
109102
int "IOPS provisioned for EBS volumes"
103+
output yaml
104+
default 3000
110105
help
111106
This setting specifies the IOPS to be provisioned for each
112107
extra EBS volume.
113108

114-
endif
109+
endif # TERRAFORM_AWS_EBS_VOLUME_TYPE_GP3 || TERRAFORM_AWS_EBS_ ...
115110

116111
choice
117112
prompt "Volume size for all EBS volumes"

0 commit comments

Comments
 (0)