Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow snapshot_id to be specified for additional_ebs_volumes #1431

Merged
merged 3 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ locals {
service_linked_role_arn = "" # Arn of custom service linked role that Auto Scaling group will use. Useful when you have encrypted EBS
termination_policies = [] # A list of policies to decide how the instances in the auto scale group should be terminated.
platform = var.default_platform # Platform of workers. Either "linux" or "windows".
additional_ebs_volumes = [] # A list of additional volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), volume_size, volume_type, iops, throughput, encrypted, kms_key_id (only on launch-template), delete_on_termination. Optional values are grabbed from root volume or from defaults
additional_ebs_volumes = [] # A list of additional volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), volume_size, volume_type, iops, throughput, encrypted, kms_key_id (only on launch-template), delete_on_termination, snapshot_id. Optional values are grabbed from root volume or from defaults
additional_instance_store_volumes = [] # A list of additional instance store (local disk) volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), virtual_name.
warm_pool = null # If this block is configured, add a Warm Pool to the specified Auto Scaling group.
timeouts = {} # A map of timeouts for create/update/delete operations
snapshot_id = null # A custom snapshot ID.

# Settings for launch templates
root_block_device_name = concat(data.aws_ami.eks_worker.*.root_device_name, [""])[0] # Root device name for Linux workers. If not provided, will assume default Linux AMI was used.
Expand Down
5 changes: 5 additions & 0 deletions workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ resource "aws_launch_configuration" "workers" {
"encrypted",
local.workers_group_defaults["root_encrypted"],
)
snapshot_id = lookup(
block_device_mappings.value,
"snapshot_id",
local.workers_group_defaults["snapshot_id"],
)
delete_on_termination = lookup(ebs_block_device.value, "delete_on_termination", true)
}
}
Expand Down
5 changes: 5 additions & 0 deletions workers_launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,11 @@ resource "aws_launch_template" "workers_launch_template" {
"kms_key_id",
local.workers_group_defaults["root_kms_key_id"],
)
snapshot_id = lookup(
block_device_mappings.value,
"snapshot_id",
local.workers_group_defaults["snapshot_id"],
)
delete_on_termination = lookup(block_device_mappings.value, "delete_on_termination", true)
}
}
Expand Down