Merge pull request #83 from joonjeong/master

add spot_price option to aws_launch_configuration
This commit is contained in:
Brandon J. O'Connor
2018-08-12 23:28:16 -07:00
committed by GitHub
3 changed files with 3 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
### Added
- A useful addition (slam dunk, @self 🔥)
- add spot_price option to aws_launch_configuration
### Changed

View File

@@ -86,6 +86,7 @@ variable "workers_group_defaults" {
asg_max_size = "3" # Maximum worker capacity in the autoscaling group.
asg_min_size = "1" # Minimum worker capacity in the autoscaling group.
instance_type = "m4.large" # Size of the workers instances.
spot_price = "" # Cost of spot instance.
root_volume_size = "20" # root volume size of workers instances.
root_volume_type = "gp2" # root volume type of workers instances, can be 'standard', 'gp2', or 'io1'
root_iops = "0" # The amount of provisioned IOPS. This must be set with a volume_type of "io1".

View File

@@ -30,6 +30,7 @@ resource "aws_launch_configuration" "workers" {
key_name = "${lookup(var.worker_groups[count.index], "key_name", lookup(var.workers_group_defaults, "key_name"))}"
user_data_base64 = "${base64encode(element(data.template_file.userdata.*.rendered, count.index))}"
ebs_optimized = "${lookup(var.worker_groups[count.index], "ebs_optimized", lookup(local.ebs_optimized, lookup(var.worker_groups[count.index], "instance_type", lookup(var.workers_group_defaults, "instance_type")), false))}"
spot_price = "${lookup(var.worker_groups[count.index], "spot_price", lookup(var.workers_group_defaults, "spot_price"))}"
count = "${var.worker_group_count}"
lifecycle {