Skip to content

Commit

Permalink
Merge branch 'spot-instance' of github.com:sighupio/fury-eks-installe…
Browse files Browse the repository at this point in the history
…r into spot-instance
  • Loading branch information
lzecca78 committed Aug 4, 2021
2 parents 2254d76 + 8f1d146 commit 72e6693
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/eks/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ locals {
"security_group_id" : element(aws_security_group.node_pool.*.id, index(var.node_pools.*.name, worker.name)),
"min_size" : worker.min_size,
"max_size" : worker.max_size,
// we make the double of the current given spot_price to avoid any price volatily.
"spot_instance_price": worker.spot_instance ? element(data.aws_ec2_spot_price.current.*.spot_price , index(var.node_pools.*.name, worker.name)) * 2 : "",
"instance_type" : worker.instance_type,
"tags" : [for tag_key, tag_value in merge(merge(local.default_node_tags, var.tags), worker.tags) : { "key" : tag_key, "value" : tag_value, "propagate_at_launch" : true }],
Expand Down Expand Up @@ -70,7 +71,6 @@ module "cluster" {
root_volume_size = lookup(node_pool, "volume_size")
key_name = aws_key_pair.nodes.key_name
public_ip = false
// adding 20% more of get price in order to avoid price volatily
spot_price = lookup(node_pool, "spot_instance_price" )
subnets = lookup(node_pool, "subnetworks")
additional_security_group_ids = [aws_security_group.nodes.id, lookup(node_pool, "security_group_id")]
Expand Down

0 comments on commit 72e6693

Please sign in to comment.