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" { ...@@ -75,10 +75,12 @@ data "aws_iam_policy_document" "workers_autoscaling" {
actions = [ actions = [
"autoscaling:DescribeAutoScalingGroups", "autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances", "autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags", "autoscaling:DescribeTags",
"autoscaling:GetAsgForInstance",
"autoscaling:SetDesiredCapacity", "autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup", "autoscaling:TerminateInstanceInAutoScalingGroup",
"autoscaling:DescribeLaunchConfigurations", "autoscaling:UpdateAutoScalingGroup",
"ec2:DescribeLaunchTemplateVersions", "ec2:DescribeLaunchTemplateVersions",
] ]
......
...@@ -7,6 +7,10 @@ resource "aws_launch_configuration" "workers" { ...@@ -7,6 +7,10 @@ resource "aws_launch_configuration" "workers" {
name_prefix = "${var.cluster_name}-eks-workers-" name_prefix = "${var.cluster_name}-eks-workers-"
security_groups = ["${aws_security_group.workers.id}"] security_groups = ["${aws_security_group.workers.id}"]
user_data_base64 = "${base64encode(data.template_file.workers_userdata.rendered)}" user_data_base64 = "${base64encode(data.template_file.workers_userdata.rendered)}"
lifecycle {
create_before_destroy = true
}
} }
resource "aws_autoscaling_group" "workers" { resource "aws_autoscaling_group" "workers" {
...@@ -40,6 +44,10 @@ resource "aws_autoscaling_group" "workers" { ...@@ -40,6 +44,10 @@ resource "aws_autoscaling_group" "workers" {
value = "owned" value = "owned"
propagate_at_launch = true propagate_at_launch = true
} }
lifecycle {
ignore_changes = ["desired_capacity"]
}
} }
resource "aws_security_group" "workers" { 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