Commit e8a43eee authored by Chris Merrett's avatar Chris Merrett

Worker lifecycle and permissions additions

parent 140c11e0
Pipeline #5391 passed with stage
in 16 seconds
......@@ -75,10 +75,12 @@ data "aws_iam_policy_document" "workers_autoscaling" {
actions = [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
"autoscaling:GetAsgForInstance",
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:UpdateAutoScalingGroup",
"ec2:DescribeLaunchTemplateVersions",
]
......
......@@ -7,6 +7,10 @@ resource "aws_launch_configuration" "workers" {
name_prefix = "${var.cluster_name}-eks-workers-"
security_groups = ["${aws_security_group.workers.id}"]
user_data_base64 = "${base64encode(data.template_file.workers_userdata.rendered)}"
lifecycle {
create_before_destroy = true
}
}
resource "aws_autoscaling_group" "workers" {
......@@ -40,6 +44,10 @@ resource "aws_autoscaling_group" "workers" {
value = "owned"
propagate_at_launch = true
}
lifecycle {
ignore_changes = ["desired_capacity"]
}
}
resource "aws_security_group" "workers" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment