github.com/SUSE/skuba@v1.4.17/ci/infra/aws/worker-instance.tf (about) 1 resource "aws_instance" "nodes" { 2 ami = data.susepubliccloud_image_ids.sles15sp1_chost_byos.ids[0] 3 associate_public_ip_address = false 4 count = var.workers 5 instance_type = var.worker_size 6 key_name = aws_key_pair.kube.key_name 7 source_dest_check = false 8 user_data = data.template_cloudinit_config.cfg.rendered 9 iam_instance_profile = length(var.iam_profile_worker) == 0 ? local.aws_iam_instance_profile_worker_terraform : var.iam_profile_worker 10 subnet_id = aws_subnet.private.id 11 12 depends_on = [ 13 aws_route.private_nat_gateway, 14 aws_iam_instance_profile.worker, 15 ] 16 17 tags = merge( 18 local.tags, 19 { 20 "Name" = "${var.stack_name}-node-${count.index}" 21 "Class" = "Instance" 22 }, 23 ) 24 25 vpc_security_group_ids = [ 26 aws_security_group.egress.id, 27 aws_security_group.common.id, 28 aws_security_group.worker.id, 29 ] 30 31 lifecycle { 32 create_before_destroy = true 33 34 ignore_changes = [ami] 35 } 36 37 root_block_device { 38 volume_type = "gp2" 39 volume_size = 20 40 delete_on_termination = true 41 } 42 } 43