feat: IMDSv2 metadata configuration in Launch Templates (#938)

NOTES: Addition of the IMDSv2 metadata configuration block to Launch Templates will cause a diff to be generated for existing Launch Templates on first Terraform apply. The defaults match existing behaviour.
This commit is contained in:
Daniel Quackenbush
2020-07-12 12:25:48 -04:00
committed by GitHub
parent b0ebef69b3
commit 23ad497557
4 changed files with 33 additions and 12 deletions

View File

@@ -278,6 +278,24 @@ resource "aws_launch_template" "workers_launch_template" {
)
)
metadata_options {
http_endpoint = lookup(
var.worker_groups_launch_template[count.index],
"metadata_http_endpoint",
local.workers_group_defaults["metadata_http_endpoint"],
)
http_tokens = lookup(
var.worker_groups_launch_template[count.index],
"metadata_http_tokens",
local.workers_group_defaults["metadata_http_tokens"],
)
http_put_response_hop_limit = lookup(
var.worker_groups_launch_template[count.index],
"metadata_http_put_response_hop_limit",
local.workers_group_defaults["metadata_http_put_response_hop_limit"],
)
}
credit_specification {
cpu_credits = lookup(
var.worker_groups_launch_template[count.index],