github.com/SUSE/skuba@v1.4.17/ci/infra/aws/master-instance.tf (about) 1 resource "aws_instance" "control_plane" { 2 ami = data.susepubliccloud_image_ids.sles15sp1_chost_byos.ids[0] 3 associate_public_ip_address = true 4 count = var.masters 5 instance_type = var.master_size 6 key_name = aws_key_pair.kube.key_name 7 source_dest_check = false 8 subnet_id = aws_subnet.public.id 9 user_data = data.template_cloudinit_config.cfg.rendered 10 iam_instance_profile = length(var.iam_profile_master) == 0 ? local.aws_iam_instance_profile_master_terraform : var.iam_profile_master 11 12 depends_on = [ 13 aws_internet_gateway.platform, 14 aws_iam_instance_profile.master, 15 ] 16 17 tags = merge( 18 local.tags, 19 { 20 "Name" = "${var.stack_name}-master-${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.master.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