From dbe9e75262098a457782876445f3e58ece638997 Mon Sep 17 00:00:00 2001 From: Maksym Vlasov Date: Wed, 1 Nov 2023 16:17:10 +0200 Subject: [PATCH] fix: block_device_mappings required optional fields (#127) * fix: block_device_mappings required optional fields As per the code in main.tf, all these stuff are optional https://github.com/cloudposse/terraform-aws-ec2-autoscale-group/blob/b757eb9037b9eae3235522800530117e66d535b2/main.tf#L6-L24 * docs --- README.md | 2 +- docs/terraform.md | 2 +- variables.tf | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index bfdbb8d..30df19f 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,7 @@ Available targets: | [associate\_public\_ip\_address](#input\_associate\_public\_ip\_address) | Associate a public IP address with an instance in a VPC | `bool` | `false` | no | | [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no | | [autoscaling\_policies\_enabled](#input\_autoscaling\_policies\_enabled) | Whether to create `aws_autoscaling_policy` and `aws_cloudwatch_metric_alarm` resources to control Auto Scaling | `bool` | `true` | no | -| [block\_device\_mappings](#input\_block\_device\_mappings) | Specify volumes to attach to the instance besides the volumes specified by the AMI |
list(object({
device_name = string
no_device = bool
virtual_name = string
ebs = object({
delete_on_termination = bool
encrypted = bool
iops = number
throughput = number
kms_key_id = string
snapshot_id = string
volume_size = number
volume_type = string
})
}))
| `[]` | no | +| [block\_device\_mappings](#input\_block\_device\_mappings) | Specify volumes to attach to the instance besides the volumes specified by the AMI |
list(object({
device_name = optional(string)
no_device = optional(bool)
virtual_name = optional(string)
ebs = object({
delete_on_termination = optional(bool)
encrypted = optional(bool)
iops = optional(number)
throughput = optional(number)
kms_key_id = optional(string)
snapshot_id = optional(string)
volume_size = optional(number)
volume_type = optional(string)
})
}))
| `[]` | no | | [capacity\_rebalance](#input\_capacity\_rebalance) | Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled. | `bool` | `false` | no | | [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` |
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}
| no | | [cpu\_utilization\_high\_evaluation\_periods](#input\_cpu\_utilization\_high\_evaluation\_periods) | The number of periods over which data is compared to the specified threshold | `number` | `2` | no | diff --git a/docs/terraform.md b/docs/terraform.md index 0b300b0..24f5ea3 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -36,7 +36,7 @@ | [associate\_public\_ip\_address](#input\_associate\_public\_ip\_address) | Associate a public IP address with an instance in a VPC | `bool` | `false` | no | | [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no | | [autoscaling\_policies\_enabled](#input\_autoscaling\_policies\_enabled) | Whether to create `aws_autoscaling_policy` and `aws_cloudwatch_metric_alarm` resources to control Auto Scaling | `bool` | `true` | no | -| [block\_device\_mappings](#input\_block\_device\_mappings) | Specify volumes to attach to the instance besides the volumes specified by the AMI |
list(object({
device_name = string
no_device = bool
virtual_name = string
ebs = object({
delete_on_termination = bool
encrypted = bool
iops = number
throughput = number
kms_key_id = string
snapshot_id = string
volume_size = number
volume_type = string
})
}))
| `[]` | no | +| [block\_device\_mappings](#input\_block\_device\_mappings) | Specify volumes to attach to the instance besides the volumes specified by the AMI |
list(object({
device_name = optional(string)
no_device = optional(bool)
virtual_name = optional(string)
ebs = object({
delete_on_termination = optional(bool)
encrypted = optional(bool)
iops = optional(number)
throughput = optional(number)
kms_key_id = optional(string)
snapshot_id = optional(string)
volume_size = optional(number)
volume_type = optional(string)
})
}))
| `[]` | no | | [capacity\_rebalance](#input\_capacity\_rebalance) | Indicates whether capacity rebalance is enabled. Otherwise, capacity rebalance is disabled. | `bool` | `false` | no | | [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` |
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}
| no | | [cpu\_utilization\_high\_evaluation\_periods](#input\_cpu\_utilization\_high\_evaluation\_periods) | The number of periods over which data is compared to the specified threshold | `number` | `2` | no | diff --git a/variables.tf b/variables.tf index 6f5c20c..b4752ed 100644 --- a/variables.tf +++ b/variables.tf @@ -73,18 +73,18 @@ variable "block_device_mappings" { description = "Specify volumes to attach to the instance besides the volumes specified by the AMI" type = list(object({ - device_name = string - no_device = bool - virtual_name = string + device_name = optional(string) + no_device = optional(bool) + virtual_name = optional(string) ebs = object({ - delete_on_termination = bool - encrypted = bool - iops = number - throughput = number - kms_key_id = string - snapshot_id = string - volume_size = number - volume_type = string + delete_on_termination = optional(bool) + encrypted = optional(bool) + iops = optional(number) + throughput = optional(number) + kms_key_id = optional(string) + snapshot_id = optional(string) + volume_size = optional(number) + volume_type = optional(string) }) }))