locals {
  cluster_name                      = "dev.datasaker.io"
  master_autoscaling_group_ids      = [aws_autoscaling_group.master-ap-northeast-2a-masters-dev-datasaker-io.id, aws_autoscaling_group.master-ap-northeast-2b-masters-dev-datasaker-io.id, aws_autoscaling_group.master-ap-northeast-2c-masters-dev-datasaker-io.id]
  master_security_group_ids         = [aws_security_group.masters-dev-datasaker-io.id]
  masters_role_arn                  = aws_iam_role.masters-dev-datasaker-io.arn
  masters_role_name                 = aws_iam_role.masters-dev-datasaker-io.name
  node_autoscaling_group_ids        = [aws_autoscaling_group.dev-data-a-dev-datasaker-io.id, aws_autoscaling_group.dev-data-b-dev-datasaker-io.id, aws_autoscaling_group.dev-data-c-dev-datasaker-io.id, aws_autoscaling_group.dev-mgmt-a-dev-datasaker-io.id, aws_autoscaling_group.dev-mgmt-b-dev-datasaker-io.id, aws_autoscaling_group.dev-process-a-dev-datasaker-io.id, aws_autoscaling_group.dev-process-b-dev-datasaker-io.id, aws_autoscaling_group.dev-process-c-dev-datasaker-io.id]
  node_security_group_ids           = [aws_security_group.nodes-dev-datasaker-io.id]
  node_subnet_ids                   = ["subnet-05672a669943fc12f", "subnet-0940fd78504acbbde", "subnet-0c875e254456809f7"]
  nodes_role_arn                    = aws_iam_role.nodes-dev-datasaker-io.arn
  nodes_role_name                   = aws_iam_role.nodes-dev-datasaker-io.name
  region                            = "ap-northeast-2"
  subnet_ap-northeast-2a_id         = "subnet-0c875e254456809f7"
  subnet_ap-northeast-2b_id         = "subnet-05672a669943fc12f"
  subnet_ap-northeast-2c_id         = "subnet-0940fd78504acbbde"
  subnet_ids                        = ["subnet-05672a669943fc12f", "subnet-0940fd78504acbbde", "subnet-0a5d787353f874684", "subnet-0c875e254456809f7", "subnet-0de55619bee2411f8", "subnet-0ee26ffc561efb292"]
  subnet_utility-ap-northeast-2a_id = "subnet-0de55619bee2411f8"
  subnet_utility-ap-northeast-2b_id = "subnet-0a5d787353f874684"
  subnet_utility-ap-northeast-2c_id = "subnet-0ee26ffc561efb292"
  vpc_id                            = "vpc-0b6e0b906c678a22f"
}

output "cluster_name" {
  value = "dev.datasaker.io"
}

output "master_autoscaling_group_ids" {
  value = [aws_autoscaling_group.master-ap-northeast-2a-masters-dev-datasaker-io.id, aws_autoscaling_group.master-ap-northeast-2b-masters-dev-datasaker-io.id, aws_autoscaling_group.master-ap-northeast-2c-masters-dev-datasaker-io.id]
}

output "master_security_group_ids" {
  value = [aws_security_group.masters-dev-datasaker-io.id]
}

output "masters_role_arn" {
  value = aws_iam_role.masters-dev-datasaker-io.arn
}

output "masters_role_name" {
  value = aws_iam_role.masters-dev-datasaker-io.name
}

output "node_autoscaling_group_ids" {
  value = [aws_autoscaling_group.dev-data-a-dev-datasaker-io.id, aws_autoscaling_group.dev-data-b-dev-datasaker-io.id, aws_autoscaling_group.dev-data-c-dev-datasaker-io.id, aws_autoscaling_group.dev-mgmt-a-dev-datasaker-io.id, aws_autoscaling_group.dev-mgmt-b-dev-datasaker-io.id, aws_autoscaling_group.dev-process-a-dev-datasaker-io.id, aws_autoscaling_group.dev-process-b-dev-datasaker-io.id, aws_autoscaling_group.dev-process-c-dev-datasaker-io.id]
}

output "node_security_group_ids" {
  value = [aws_security_group.nodes-dev-datasaker-io.id]
}

output "node_subnet_ids" {
  value = ["subnet-05672a669943fc12f", "subnet-0940fd78504acbbde", "subnet-0c875e254456809f7"]
}

output "nodes_role_arn" {
  value = aws_iam_role.nodes-dev-datasaker-io.arn
}

output "nodes_role_name" {
  value = aws_iam_role.nodes-dev-datasaker-io.name
}

output "region" {
  value = "ap-northeast-2"
}

output "subnet_ap-northeast-2a_id" {
  value = "subnet-0c875e254456809f7"
}

output "subnet_ap-northeast-2b_id" {
  value = "subnet-05672a669943fc12f"
}

output "subnet_ap-northeast-2c_id" {
  value = "subnet-0940fd78504acbbde"
}

output "subnet_ids" {
  value = ["subnet-05672a669943fc12f", "subnet-0940fd78504acbbde", "subnet-0a5d787353f874684", "subnet-0c875e254456809f7", "subnet-0de55619bee2411f8", "subnet-0ee26ffc561efb292"]
}

output "subnet_utility-ap-northeast-2a_id" {
  value = "subnet-0de55619bee2411f8"
}

output "subnet_utility-ap-northeast-2b_id" {
  value = "subnet-0a5d787353f874684"
}

output "subnet_utility-ap-northeast-2c_id" {
  value = "subnet-0ee26ffc561efb292"
}

output "vpc_id" {
  value = "vpc-0b6e0b906c678a22f"
}

provider "aws" {
  region = "ap-northeast-2"
}

provider "aws" {
  alias  = "files"
  region = "ap-northeast-2"
}

resource "aws_autoscaling_group" "dev-data-a-dev-datasaker-io" {
  enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
  launch_template {
    id      = aws_launch_template.dev-data-a-dev-datasaker-io.id
    version = aws_launch_template.dev-data-a-dev-datasaker-io.latest_version
  }
  max_instance_lifetime = 0
  max_size              = 1
  metrics_granularity   = "1Minute"
  min_size              = 1
  name                  = "dev-data-a.dev.datasaker.io"
  protect_from_scale_in = false
  tag {
    key                 = "KubernetesCluster"
    propagate_at_launch = true
    value               = "dev.datasaker.io"
  }
  tag {
    key                 = "Name"
    propagate_at_launch = true
    value               = "dev-data-a.dev.datasaker.io"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"
    propagate_at_launch = true
    value               = "data"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-data-a"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"
    propagate_at_launch = true
    value               = "node"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/role/node"
    propagate_at_launch = true
    value               = "1"
  }
  tag {
    key                 = "kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-data-a"
  }
  tag {
    key                 = "kubernetes.io/cluster/dev.datasaker.io"
    propagate_at_launch = true
    value               = "owned"
  }
  vpc_zone_identifier = ["subnet-0c875e254456809f7"]
}

resource "aws_autoscaling_group" "dev-data-b-dev-datasaker-io" {
  enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
  launch_template {
    id      = aws_launch_template.dev-data-b-dev-datasaker-io.id
    version = aws_launch_template.dev-data-b-dev-datasaker-io.latest_version
  }
  max_instance_lifetime = 0
  max_size              = 1
  metrics_granularity   = "1Minute"
  min_size              = 1
  name                  = "dev-data-b.dev.datasaker.io"
  protect_from_scale_in = false
  tag {
    key                 = "KubernetesCluster"
    propagate_at_launch = true
    value               = "dev.datasaker.io"
  }
  tag {
    key                 = "Name"
    propagate_at_launch = true
    value               = "dev-data-b.dev.datasaker.io"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"
    propagate_at_launch = true
    value               = "data"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-data-b"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"
    propagate_at_launch = true
    value               = "node"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/role/node"
    propagate_at_launch = true
    value               = "1"
  }
  tag {
    key                 = "kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-data-b"
  }
  tag {
    key                 = "kubernetes.io/cluster/dev.datasaker.io"
    propagate_at_launch = true
    value               = "owned"
  }
  vpc_zone_identifier = ["subnet-05672a669943fc12f"]
}

resource "aws_autoscaling_group" "dev-data-c-dev-datasaker-io" {
  enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
  launch_template {
    id      = aws_launch_template.dev-data-c-dev-datasaker-io.id
    version = aws_launch_template.dev-data-c-dev-datasaker-io.latest_version
  }
  max_instance_lifetime = 0
  max_size              = 1
  metrics_granularity   = "1Minute"
  min_size              = 1
  name                  = "dev-data-c.dev.datasaker.io"
  protect_from_scale_in = false
  tag {
    key                 = "KubernetesCluster"
    propagate_at_launch = true
    value               = "dev.datasaker.io"
  }
  tag {
    key                 = "Name"
    propagate_at_launch = true
    value               = "dev-data-c.dev.datasaker.io"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"
    propagate_at_launch = true
    value               = "data"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-data-c"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"
    propagate_at_launch = true
    value               = "node"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/role/node"
    propagate_at_launch = true
    value               = "1"
  }
  tag {
    key                 = "kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-data-c"
  }
  tag {
    key                 = "kubernetes.io/cluster/dev.datasaker.io"
    propagate_at_launch = true
    value               = "owned"
  }
  vpc_zone_identifier = ["subnet-0940fd78504acbbde"]
}

resource "aws_autoscaling_group" "dev-mgmt-a-dev-datasaker-io" {
  enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
  launch_template {
    id      = aws_launch_template.dev-mgmt-a-dev-datasaker-io.id
    version = aws_launch_template.dev-mgmt-a-dev-datasaker-io.latest_version
  }
  max_instance_lifetime = 0
  max_size              = 1
  metrics_granularity   = "1Minute"
  min_size              = 1
  name                  = "dev-mgmt-a.dev.datasaker.io"
  protect_from_scale_in = false
  tag {
    key                 = "KubernetesCluster"
    propagate_at_launch = true
    value               = "dev.datasaker.io"
  }
  tag {
    key                 = "Name"
    propagate_at_launch = true
    value               = "dev-mgmt-a.dev.datasaker.io"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"
    propagate_at_launch = true
    value               = "mgmt"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-mgmt-a"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"
    propagate_at_launch = true
    value               = "node"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/role/node"
    propagate_at_launch = true
    value               = "1"
  }
  tag {
    key                 = "kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-mgmt-a"
  }
  tag {
    key                 = "kubernetes.io/cluster/dev.datasaker.io"
    propagate_at_launch = true
    value               = "owned"
  }
  vpc_zone_identifier = ["subnet-0c875e254456809f7"]
}

resource "aws_autoscaling_group" "dev-mgmt-b-dev-datasaker-io" {
  enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
  launch_template {
    id      = aws_launch_template.dev-mgmt-b-dev-datasaker-io.id
    version = aws_launch_template.dev-mgmt-b-dev-datasaker-io.latest_version
  }
  max_instance_lifetime = 0
  max_size              = 1
  metrics_granularity   = "1Minute"
  min_size              = 1
  name                  = "dev-mgmt-b.dev.datasaker.io"
  protect_from_scale_in = false
  tag {
    key                 = "KubernetesCluster"
    propagate_at_launch = true
    value               = "dev.datasaker.io"
  }
  tag {
    key                 = "Name"
    propagate_at_launch = true
    value               = "dev-mgmt-b.dev.datasaker.io"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"
    propagate_at_launch = true
    value               = "mgmt"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-mgmt-b"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"
    propagate_at_launch = true
    value               = "node"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/role/node"
    propagate_at_launch = true
    value               = "1"
  }
  tag {
    key                 = "kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-mgmt-b"
  }
  tag {
    key                 = "kubernetes.io/cluster/dev.datasaker.io"
    propagate_at_launch = true
    value               = "owned"
  }
  vpc_zone_identifier = ["subnet-05672a669943fc12f"]
}

resource "aws_autoscaling_group" "dev-process-a-dev-datasaker-io" {
  enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
  launch_template {
    id      = aws_launch_template.dev-process-a-dev-datasaker-io.id
    version = aws_launch_template.dev-process-a-dev-datasaker-io.latest_version
  }
  max_instance_lifetime = 0
  max_size              = 1
  metrics_granularity   = "1Minute"
  min_size              = 1
  name                  = "dev-process-a.dev.datasaker.io"
  protect_from_scale_in = false
  tag {
    key                 = "KubernetesCluster"
    propagate_at_launch = true
    value               = "dev.datasaker.io"
  }
  tag {
    key                 = "Name"
    propagate_at_launch = true
    value               = "dev-process-a.dev.datasaker.io"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"
    propagate_at_launch = true
    value               = "process"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-process-a"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"
    propagate_at_launch = true
    value               = "node"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/role/node"
    propagate_at_launch = true
    value               = "1"
  }
  tag {
    key                 = "kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-process-a"
  }
  tag {
    key                 = "kubernetes.io/cluster/dev.datasaker.io"
    propagate_at_launch = true
    value               = "owned"
  }
  vpc_zone_identifier = ["subnet-0c875e254456809f7"]
}

resource "aws_autoscaling_group" "dev-process-b-dev-datasaker-io" {
  enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
  launch_template {
    id      = aws_launch_template.dev-process-b-dev-datasaker-io.id
    version = aws_launch_template.dev-process-b-dev-datasaker-io.latest_version
  }
  max_instance_lifetime = 0
  max_size              = 1
  metrics_granularity   = "1Minute"
  min_size              = 1
  name                  = "dev-process-b.dev.datasaker.io"
  protect_from_scale_in = false
  tag {
    key                 = "KubernetesCluster"
    propagate_at_launch = true
    value               = "dev.datasaker.io"
  }
  tag {
    key                 = "Name"
    propagate_at_launch = true
    value               = "dev-process-b.dev.datasaker.io"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"
    propagate_at_launch = true
    value               = "process"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-process-b"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"
    propagate_at_launch = true
    value               = "node"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/role/node"
    propagate_at_launch = true
    value               = "1"
  }
  tag {
    key                 = "kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-process-b"
  }
  tag {
    key                 = "kubernetes.io/cluster/dev.datasaker.io"
    propagate_at_launch = true
    value               = "owned"
  }
  vpc_zone_identifier = ["subnet-0c875e254456809f7"]
}

resource "aws_autoscaling_group" "dev-process-c-dev-datasaker-io" {
  enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
  launch_template {
    id      = aws_launch_template.dev-process-c-dev-datasaker-io.id
    version = aws_launch_template.dev-process-c-dev-datasaker-io.latest_version
  }
  max_instance_lifetime = 0
  max_size              = 1
  metrics_granularity   = "1Minute"
  min_size              = 1
  name                  = "dev-process-c.dev.datasaker.io"
  protect_from_scale_in = false
  tag {
    key                 = "KubernetesCluster"
    propagate_at_launch = true
    value               = "dev.datasaker.io"
  }
  tag {
    key                 = "Name"
    propagate_at_launch = true
    value               = "dev-process-c.dev.datasaker.io"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"
    propagate_at_launch = true
    value               = "process"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-process-c"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"
    propagate_at_launch = true
    value               = "node"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/role/node"
    propagate_at_launch = true
    value               = "1"
  }
  tag {
    key                 = "kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "dev-process-c"
  }
  tag {
    key                 = "kubernetes.io/cluster/dev.datasaker.io"
    propagate_at_launch = true
    value               = "owned"
  }
  vpc_zone_identifier = ["subnet-0c875e254456809f7"]
}

resource "aws_autoscaling_group" "master-ap-northeast-2a-masters-dev-datasaker-io" {
  enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
  launch_template {
    id      = aws_launch_template.master-ap-northeast-2a-masters-dev-datasaker-io.id
    version = aws_launch_template.master-ap-northeast-2a-masters-dev-datasaker-io.latest_version
  }
  load_balancers        = [aws_elb.api-dev-datasaker-io.id]
  max_instance_lifetime = 0
  max_size              = 1
  metrics_granularity   = "1Minute"
  min_size              = 1
  name                  = "master-ap-northeast-2a.masters.dev.datasaker.io"
  protect_from_scale_in = false
  tag {
    key                 = "KubernetesCluster"
    propagate_at_launch = true
    value               = "dev.datasaker.io"
  }
  tag {
    key                 = "Name"
    propagate_at_launch = true
    value               = "master-ap-northeast-2a.masters.dev.datasaker.io"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "master-ap-northeast-2a"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"
    propagate_at_launch = true
    value               = "master"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/role/master"
    propagate_at_launch = true
    value               = "1"
  }
  tag {
    key                 = "kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "master-ap-northeast-2a"
  }
  tag {
    key                 = "kubernetes.io/cluster/dev.datasaker.io"
    propagate_at_launch = true
    value               = "owned"
  }
  vpc_zone_identifier = ["subnet-0c875e254456809f7"]
}

resource "aws_autoscaling_group" "master-ap-northeast-2b-masters-dev-datasaker-io" {
  enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
  launch_template {
    id      = aws_launch_template.master-ap-northeast-2b-masters-dev-datasaker-io.id
    version = aws_launch_template.master-ap-northeast-2b-masters-dev-datasaker-io.latest_version
  }
  load_balancers        = [aws_elb.api-dev-datasaker-io.id]
  max_instance_lifetime = 0
  max_size              = 1
  metrics_granularity   = "1Minute"
  min_size              = 1
  name                  = "master-ap-northeast-2b.masters.dev.datasaker.io"
  protect_from_scale_in = false
  tag {
    key                 = "KubernetesCluster"
    propagate_at_launch = true
    value               = "dev.datasaker.io"
  }
  tag {
    key                 = "Name"
    propagate_at_launch = true
    value               = "master-ap-northeast-2b.masters.dev.datasaker.io"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "master-ap-northeast-2b"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"
    propagate_at_launch = true
    value               = "master"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/role/master"
    propagate_at_launch = true
    value               = "1"
  }
  tag {
    key                 = "kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "master-ap-northeast-2b"
  }
  tag {
    key                 = "kubernetes.io/cluster/dev.datasaker.io"
    propagate_at_launch = true
    value               = "owned"
  }
  vpc_zone_identifier = ["subnet-05672a669943fc12f"]
}

resource "aws_autoscaling_group" "master-ap-northeast-2c-masters-dev-datasaker-io" {
  enabled_metrics = ["GroupDesiredCapacity", "GroupInServiceInstances", "GroupMaxSize", "GroupMinSize", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"]
  launch_template {
    id      = aws_launch_template.master-ap-northeast-2c-masters-dev-datasaker-io.id
    version = aws_launch_template.master-ap-northeast-2c-masters-dev-datasaker-io.latest_version
  }
  load_balancers        = [aws_elb.api-dev-datasaker-io.id]
  max_instance_lifetime = 0
  max_size              = 1
  metrics_granularity   = "1Minute"
  min_size              = 1
  name                  = "master-ap-northeast-2c.masters.dev.datasaker.io"
  protect_from_scale_in = false
  tag {
    key                 = "KubernetesCluster"
    propagate_at_launch = true
    value               = "dev.datasaker.io"
  }
  tag {
    key                 = "Name"
    propagate_at_launch = true
    value               = "master-ap-northeast-2c.masters.dev.datasaker.io"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "master-ap-northeast-2c"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"
    propagate_at_launch = true
    value               = "master"
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers"
    propagate_at_launch = true
    value               = ""
  }
  tag {
    key                 = "k8s.io/role/master"
    propagate_at_launch = true
    value               = "1"
  }
  tag {
    key                 = "kops.k8s.io/instancegroup"
    propagate_at_launch = true
    value               = "master-ap-northeast-2c"
  }
  tag {
    key                 = "kubernetes.io/cluster/dev.datasaker.io"
    propagate_at_launch = true
    value               = "owned"
  }
  vpc_zone_identifier = ["subnet-0940fd78504acbbde"]
}

resource "aws_ebs_volume" "a-etcd-events-dev-datasaker-io" {
  availability_zone = "ap-northeast-2a"
  encrypted         = true
  iops              = 3000
  size              = 20
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "a.etcd-events.dev.datasaker.io"
    "k8s.io/etcd/events"                     = "a/a,b,c"
    "k8s.io/role/master"                     = "1"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
  throughput = 125
  type       = "gp3"
}

resource "aws_ebs_volume" "a-etcd-main-dev-datasaker-io" {
  availability_zone = "ap-northeast-2a"
  encrypted         = true
  iops              = 3000
  size              = 20
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "a.etcd-main.dev.datasaker.io"
    "k8s.io/etcd/main"                       = "a/a,b,c"
    "k8s.io/role/master"                     = "1"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
  throughput = 125
  type       = "gp3"
}

resource "aws_ebs_volume" "b-etcd-events-dev-datasaker-io" {
  availability_zone = "ap-northeast-2b"
  encrypted         = true
  iops              = 3000
  size              = 20
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "b.etcd-events.dev.datasaker.io"
    "k8s.io/etcd/events"                     = "b/a,b,c"
    "k8s.io/role/master"                     = "1"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
  throughput = 125
  type       = "gp3"
}

resource "aws_ebs_volume" "b-etcd-main-dev-datasaker-io" {
  availability_zone = "ap-northeast-2b"
  encrypted         = true
  iops              = 3000
  size              = 20
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "b.etcd-main.dev.datasaker.io"
    "k8s.io/etcd/main"                       = "b/a,b,c"
    "k8s.io/role/master"                     = "1"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
  throughput = 125
  type       = "gp3"
}

resource "aws_ebs_volume" "c-etcd-events-dev-datasaker-io" {
  availability_zone = "ap-northeast-2c"
  encrypted         = true
  iops              = 3000
  size              = 20
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "c.etcd-events.dev.datasaker.io"
    "k8s.io/etcd/events"                     = "c/a,b,c"
    "k8s.io/role/master"                     = "1"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
  throughput = 125
  type       = "gp3"
}

resource "aws_ebs_volume" "c-etcd-main-dev-datasaker-io" {
  availability_zone = "ap-northeast-2c"
  encrypted         = true
  iops              = 3000
  size              = 20
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "c.etcd-main.dev.datasaker.io"
    "k8s.io/etcd/main"                       = "c/a,b,c"
    "k8s.io/role/master"                     = "1"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
  throughput = 125
  type       = "gp3"
}

resource "aws_elb" "api-dev-datasaker-io" {
  connection_draining         = true
  connection_draining_timeout = 300
  cross_zone_load_balancing   = false
  health_check {
    healthy_threshold   = 2
    interval            = 10
    target              = "SSL:443"
    timeout             = 5
    unhealthy_threshold = 2
  }
  idle_timeout = 300
  listener {
    instance_port     = 443
    instance_protocol = "TCP"
    lb_port           = 443
    lb_protocol       = "TCP"
  }
  name            = "api-dev-datasaker-io-ru2qna"
  security_groups = [aws_security_group.api-elb-dev-datasaker-io.id]
  subnets         = ["subnet-0a5d787353f874684", "subnet-0de55619bee2411f8", "subnet-0ee26ffc561efb292"]
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "api.dev.datasaker.io"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
}

resource "aws_iam_instance_profile" "masters-dev-datasaker-io" {
  name = "masters.dev.datasaker.io"
  role = aws_iam_role.masters-dev-datasaker-io.name
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "masters.dev.datasaker.io"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
}

resource "aws_iam_instance_profile" "nodes-dev-datasaker-io" {
  name = "nodes.dev.datasaker.io"
  role = aws_iam_role.nodes-dev-datasaker-io.name
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "nodes.dev.datasaker.io"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
}

resource "aws_iam_role" "masters-dev-datasaker-io" {
  assume_role_policy = file("${path.module}/data/aws_iam_role_masters.dev.datasaker.io_policy")
  name               = "masters.dev.datasaker.io"
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "masters.dev.datasaker.io"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
}

resource "aws_iam_role" "nodes-dev-datasaker-io" {
  assume_role_policy = file("${path.module}/data/aws_iam_role_nodes.dev.datasaker.io_policy")
  name               = "nodes.dev.datasaker.io"
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "nodes.dev.datasaker.io"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
}

resource "aws_iam_role_policy" "masters-dev-datasaker-io" {
  name   = "masters.dev.datasaker.io"
  policy = file("${path.module}/data/aws_iam_role_policy_masters.dev.datasaker.io_policy")
  role   = aws_iam_role.masters-dev-datasaker-io.name
}

resource "aws_iam_role_policy" "nodes-dev-datasaker-io" {
  name   = "nodes.dev.datasaker.io"
  policy = file("${path.module}/data/aws_iam_role_policy_nodes.dev.datasaker.io_policy")
  role   = aws_iam_role.nodes-dev-datasaker-io.name
}

resource "aws_key_pair" "kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6" {
  key_name   = "kubernetes.dev.datasaker.io-c8:01:5e:c8:c1:4f:2a:1b:71:6c:21:3a:5c:04:7b:d6"
  public_key = file("${path.module}/data/aws_key_pair_kubernetes.dev.datasaker.io-c8015ec8c14f2a1b716c213a5c047bd6_public_key")
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "dev.datasaker.io"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
}

resource "aws_launch_template" "dev-data-a-dev-datasaker-io" {
  block_device_mappings {
    device_name = "/dev/sda1"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 128
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.nodes-dev-datasaker-io.id
  }
  image_id      = "ami-0ea5eb4b05645aa8a"
  instance_type = "m5.4xlarge"
  key_name      = aws_key_pair.kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "disabled"
    http_put_response_hop_limit = 1
    http_tokens                 = "optional"
  }
  monitoring {
    enabled = false
  }
  name = "dev-data-a.dev.datasaker.io"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 0
    security_groups             = [aws_security_group.nodes-dev-datasaker-io.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-data-a.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "data"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-data-a"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-data-a"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-data-a.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "data"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-data-a"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-data-a"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                          = "dev.datasaker.io"
    "Name"                                                                       = "dev-data-a.dev.datasaker.io"
    "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "data"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-data-a"
    "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
    "k8s.io/role/node"                                                           = "1"
    "kops.k8s.io/instancegroup"                                                  = "dev-data-a"
    "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_dev-data-a.dev.datasaker.io_user_data")
}

resource "aws_launch_template" "dev-data-b-dev-datasaker-io" {
  block_device_mappings {
    device_name = "/dev/sda1"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 128
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.nodes-dev-datasaker-io.id
  }
  image_id      = "ami-0ea5eb4b05645aa8a"
  instance_type = "m5.4xlarge"
  key_name      = aws_key_pair.kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "disabled"
    http_put_response_hop_limit = 1
    http_tokens                 = "optional"
  }
  monitoring {
    enabled = false
  }
  name = "dev-data-b.dev.datasaker.io"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 0
    security_groups             = [aws_security_group.nodes-dev-datasaker-io.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-data-b.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "data"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-data-b"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-data-b"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-data-b.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "data"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-data-b"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-data-b"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                          = "dev.datasaker.io"
    "Name"                                                                       = "dev-data-b.dev.datasaker.io"
    "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "data"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-data-b"
    "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
    "k8s.io/role/node"                                                           = "1"
    "kops.k8s.io/instancegroup"                                                  = "dev-data-b"
    "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_dev-data-b.dev.datasaker.io_user_data")
}

resource "aws_launch_template" "dev-data-c-dev-datasaker-io" {
  block_device_mappings {
    device_name = "/dev/sda1"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 128
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.nodes-dev-datasaker-io.id
  }
  image_id      = "ami-0ea5eb4b05645aa8a"
  instance_type = "m5.4xlarge"
  key_name      = aws_key_pair.kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "disabled"
    http_put_response_hop_limit = 1
    http_tokens                 = "optional"
  }
  monitoring {
    enabled = false
  }
  name = "dev-data-c.dev.datasaker.io"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 0
    security_groups             = [aws_security_group.nodes-dev-datasaker-io.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-data-c.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "data"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-data-c"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-data-c"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-data-c.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "data"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-data-c"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-data-c"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                          = "dev.datasaker.io"
    "Name"                                                                       = "dev-data-c.dev.datasaker.io"
    "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "data"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-data-c"
    "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
    "k8s.io/role/node"                                                           = "1"
    "kops.k8s.io/instancegroup"                                                  = "dev-data-c"
    "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_dev-data-c.dev.datasaker.io_user_data")
}

resource "aws_launch_template" "dev-mgmt-a-dev-datasaker-io" {
  block_device_mappings {
    device_name = "/dev/sda1"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 128
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.nodes-dev-datasaker-io.id
  }
  image_id      = "ami-0ea5eb4b05645aa8a"
  instance_type = "c5.xlarge"
  key_name      = aws_key_pair.kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "disabled"
    http_put_response_hop_limit = 1
    http_tokens                 = "optional"
  }
  monitoring {
    enabled = false
  }
  name = "dev-mgmt-a.dev.datasaker.io"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 0
    security_groups             = [aws_security_group.nodes-dev-datasaker-io.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-mgmt-a.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "mgmt"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-mgmt-a"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-mgmt-a"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-mgmt-a.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "mgmt"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-mgmt-a"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-mgmt-a"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                          = "dev.datasaker.io"
    "Name"                                                                       = "dev-mgmt-a.dev.datasaker.io"
    "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "mgmt"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-mgmt-a"
    "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
    "k8s.io/role/node"                                                           = "1"
    "kops.k8s.io/instancegroup"                                                  = "dev-mgmt-a"
    "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_dev-mgmt-a.dev.datasaker.io_user_data")
}

resource "aws_launch_template" "dev-mgmt-b-dev-datasaker-io" {
  block_device_mappings {
    device_name = "/dev/sda1"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 128
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.nodes-dev-datasaker-io.id
  }
  image_id      = "ami-0ea5eb4b05645aa8a"
  instance_type = "c5.xlarge"
  key_name      = aws_key_pair.kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "disabled"
    http_put_response_hop_limit = 1
    http_tokens                 = "optional"
  }
  monitoring {
    enabled = false
  }
  name = "dev-mgmt-b.dev.datasaker.io"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 0
    security_groups             = [aws_security_group.nodes-dev-datasaker-io.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-mgmt-b.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "mgmt"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-mgmt-b"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-mgmt-b"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-mgmt-b.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "mgmt"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-mgmt-b"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-mgmt-b"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                          = "dev.datasaker.io"
    "Name"                                                                       = "dev-mgmt-b.dev.datasaker.io"
    "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "mgmt"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-mgmt-b"
    "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
    "k8s.io/role/node"                                                           = "1"
    "kops.k8s.io/instancegroup"                                                  = "dev-mgmt-b"
    "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_dev-mgmt-b.dev.datasaker.io_user_data")
}

resource "aws_launch_template" "dev-process-a-dev-datasaker-io" {
  block_device_mappings {
    device_name = "/dev/sda1"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 128
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.nodes-dev-datasaker-io.id
  }
  image_id      = "ami-0ea5eb4b05645aa8a"
  instance_type = "c5.xlarge"
  key_name      = aws_key_pair.kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "disabled"
    http_put_response_hop_limit = 1
    http_tokens                 = "optional"
  }
  monitoring {
    enabled = false
  }
  name = "dev-process-a.dev.datasaker.io"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 0
    security_groups             = [aws_security_group.nodes-dev-datasaker-io.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-process-a.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "process"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-process-a"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-process-a"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-process-a.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "process"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-process-a"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-process-a"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                          = "dev.datasaker.io"
    "Name"                                                                       = "dev-process-a.dev.datasaker.io"
    "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "process"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-process-a"
    "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
    "k8s.io/role/node"                                                           = "1"
    "kops.k8s.io/instancegroup"                                                  = "dev-process-a"
    "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_dev-process-a.dev.datasaker.io_user_data")
}

resource "aws_launch_template" "dev-process-b-dev-datasaker-io" {
  block_device_mappings {
    device_name = "/dev/sda1"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 128
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.nodes-dev-datasaker-io.id
  }
  image_id      = "ami-0ea5eb4b05645aa8a"
  instance_type = "c5.xlarge"
  key_name      = aws_key_pair.kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "disabled"
    http_put_response_hop_limit = 1
    http_tokens                 = "optional"
  }
  monitoring {
    enabled = false
  }
  name = "dev-process-b.dev.datasaker.io"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 0
    security_groups             = [aws_security_group.nodes-dev-datasaker-io.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-process-b.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "process"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-process-b"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-process-b"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-process-b.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "process"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-process-b"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-process-b"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                          = "dev.datasaker.io"
    "Name"                                                                       = "dev-process-b.dev.datasaker.io"
    "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "process"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-process-b"
    "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
    "k8s.io/role/node"                                                           = "1"
    "kops.k8s.io/instancegroup"                                                  = "dev-process-b"
    "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_dev-process-b.dev.datasaker.io_user_data")
}

resource "aws_launch_template" "dev-process-c-dev-datasaker-io" {
  block_device_mappings {
    device_name = "/dev/sda1"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 128
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.nodes-dev-datasaker-io.id
  }
  image_id      = "ami-0ea5eb4b05645aa8a"
  instance_type = "c5.xlarge"
  key_name      = aws_key_pair.kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "disabled"
    http_put_response_hop_limit = 1
    http_tokens                 = "optional"
  }
  monitoring {
    enabled = false
  }
  name = "dev-process-c.dev.datasaker.io"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 0
    security_groups             = [aws_security_group.nodes-dev-datasaker-io.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-process-c.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "process"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-process-c"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-process-c"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                          = "dev.datasaker.io"
      "Name"                                                                       = "dev-process-c.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "process"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-process-c"
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "dev-process-c"
      "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                          = "dev.datasaker.io"
    "Name"                                                                       = "dev-process-c.dev.datasaker.io"
    "k8s.io/cluster-autoscaler/node-template/label/datasaker/group"              = "process"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"    = "dev-process-c"
    "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"           = "node"
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
    "k8s.io/role/node"                                                           = "1"
    "kops.k8s.io/instancegroup"                                                  = "dev-process-c"
    "kubernetes.io/cluster/dev.datasaker.io"                                     = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_dev-process-c.dev.datasaker.io_user_data")
}

resource "aws_launch_template" "master-ap-northeast-2a-masters-dev-datasaker-io" {
  block_device_mappings {
    device_name = "/dev/sda1"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 50
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.masters-dev-datasaker-io.id
  }
  image_id      = "ami-0ea5eb4b05645aa8a"
  instance_type = "t3.small"
  key_name      = aws_key_pair.kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "disabled"
    http_put_response_hop_limit = 3
    http_tokens                 = "required"
  }
  monitoring {
    enabled = false
  }
  name = "master-ap-northeast-2a.masters.dev.datasaker.io"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 0
    security_groups             = [aws_security_group.masters-dev-datasaker-io.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                                                     = "dev.datasaker.io"
      "Name"                                                                                                  = "master-ap-northeast-2a.masters.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"                               = "master-ap-northeast-2a"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"                         = ""
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"                                      = "master"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"                   = ""
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"                          = ""
      "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = ""
      "k8s.io/role/master"                                                                                    = "1"
      "kops.k8s.io/instancegroup"                                                                             = "master-ap-northeast-2a"
      "kubernetes.io/cluster/dev.datasaker.io"                                                                = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                                                     = "dev.datasaker.io"
      "Name"                                                                                                  = "master-ap-northeast-2a.masters.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"                               = "master-ap-northeast-2a"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"                         = ""
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"                                      = "master"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"                   = ""
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"                          = ""
      "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = ""
      "k8s.io/role/master"                                                                                    = "1"
      "kops.k8s.io/instancegroup"                                                                             = "master-ap-northeast-2a"
      "kubernetes.io/cluster/dev.datasaker.io"                                                                = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                                                     = "dev.datasaker.io"
    "Name"                                                                                                  = "master-ap-northeast-2a.masters.dev.datasaker.io"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"                               = "master-ap-northeast-2a"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"                         = ""
    "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"                                      = "master"
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"                   = ""
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"                          = ""
    "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = ""
    "k8s.io/role/master"                                                                                    = "1"
    "kops.k8s.io/instancegroup"                                                                             = "master-ap-northeast-2a"
    "kubernetes.io/cluster/dev.datasaker.io"                                                                = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_master-ap-northeast-2a.masters.dev.datasaker.io_user_data")
}

resource "aws_launch_template" "master-ap-northeast-2b-masters-dev-datasaker-io" {
  block_device_mappings {
    device_name = "/dev/sda1"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 50
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.masters-dev-datasaker-io.id
  }
  image_id      = "ami-0ea5eb4b05645aa8a"
  instance_type = "t3.small"
  key_name      = aws_key_pair.kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "disabled"
    http_put_response_hop_limit = 3
    http_tokens                 = "required"
  }
  monitoring {
    enabled = false
  }
  name = "master-ap-northeast-2b.masters.dev.datasaker.io"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 0
    security_groups             = [aws_security_group.masters-dev-datasaker-io.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                                                     = "dev.datasaker.io"
      "Name"                                                                                                  = "master-ap-northeast-2b.masters.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"                               = "master-ap-northeast-2b"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"                         = ""
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"                                      = "master"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"                   = ""
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"                          = ""
      "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = ""
      "k8s.io/role/master"                                                                                    = "1"
      "kops.k8s.io/instancegroup"                                                                             = "master-ap-northeast-2b"
      "kubernetes.io/cluster/dev.datasaker.io"                                                                = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                                                     = "dev.datasaker.io"
      "Name"                                                                                                  = "master-ap-northeast-2b.masters.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"                               = "master-ap-northeast-2b"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"                         = ""
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"                                      = "master"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"                   = ""
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"                          = ""
      "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = ""
      "k8s.io/role/master"                                                                                    = "1"
      "kops.k8s.io/instancegroup"                                                                             = "master-ap-northeast-2b"
      "kubernetes.io/cluster/dev.datasaker.io"                                                                = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                                                     = "dev.datasaker.io"
    "Name"                                                                                                  = "master-ap-northeast-2b.masters.dev.datasaker.io"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"                               = "master-ap-northeast-2b"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"                         = ""
    "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"                                      = "master"
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"                   = ""
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"                          = ""
    "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = ""
    "k8s.io/role/master"                                                                                    = "1"
    "kops.k8s.io/instancegroup"                                                                             = "master-ap-northeast-2b"
    "kubernetes.io/cluster/dev.datasaker.io"                                                                = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_master-ap-northeast-2b.masters.dev.datasaker.io_user_data")
}

resource "aws_launch_template" "master-ap-northeast-2c-masters-dev-datasaker-io" {
  block_device_mappings {
    device_name = "/dev/sda1"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 50
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.masters-dev-datasaker-io.id
  }
  image_id      = "ami-0ea5eb4b05645aa8a"
  instance_type = "t3.small"
  key_name      = aws_key_pair.kubernetes-dev-datasaker-io-c8015ec8c14f2a1b716c213a5c047bd6.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "disabled"
    http_put_response_hop_limit = 3
    http_tokens                 = "required"
  }
  monitoring {
    enabled = false
  }
  name = "master-ap-northeast-2c.masters.dev.datasaker.io"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 0
    security_groups             = [aws_security_group.masters-dev-datasaker-io.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                                                     = "dev.datasaker.io"
      "Name"                                                                                                  = "master-ap-northeast-2c.masters.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"                               = "master-ap-northeast-2c"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"                         = ""
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"                                      = "master"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"                   = ""
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"                          = ""
      "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = ""
      "k8s.io/role/master"                                                                                    = "1"
      "kops.k8s.io/instancegroup"                                                                             = "master-ap-northeast-2c"
      "kubernetes.io/cluster/dev.datasaker.io"                                                                = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                                                     = "dev.datasaker.io"
      "Name"                                                                                                  = "master-ap-northeast-2c.masters.dev.datasaker.io"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"                               = "master-ap-northeast-2c"
      "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"                         = ""
      "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"                                      = "master"
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"                   = ""
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"                          = ""
      "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = ""
      "k8s.io/role/master"                                                                                    = "1"
      "kops.k8s.io/instancegroup"                                                                             = "master-ap-northeast-2c"
      "kubernetes.io/cluster/dev.datasaker.io"                                                                = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                                                     = "dev.datasaker.io"
    "Name"                                                                                                  = "master-ap-northeast-2c.masters.dev.datasaker.io"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/instancegroup"                               = "master-ap-northeast-2c"
    "k8s.io/cluster-autoscaler/node-template/label/kops.k8s.io/kops-controller-pki"                         = ""
    "k8s.io/cluster-autoscaler/node-template/label/kubernetes.io/role"                                      = "master"
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/control-plane"                   = ""
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/master"                          = ""
    "k8s.io/cluster-autoscaler/node-template/label/node.kubernetes.io/exclude-from-external-load-balancers" = ""
    "k8s.io/role/master"                                                                                    = "1"
    "kops.k8s.io/instancegroup"                                                                             = "master-ap-northeast-2c"
    "kubernetes.io/cluster/dev.datasaker.io"                                                                = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_master-ap-northeast-2c.masters.dev.datasaker.io_user_data")
}

resource "aws_route53_record" "api-dev-datasaker-io" {
  alias {
    evaluate_target_health = false
    name                   = aws_elb.api-dev-datasaker-io.dns_name
    zone_id                = aws_elb.api-dev-datasaker-io.zone_id
  }
  name    = "api.dev.datasaker.io"
  type    = "A"
  zone_id = "/hostedzone/Z072735718G25WNVKU834"
}

resource "aws_s3_object" "cluster-completed-spec" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_cluster-completed.spec_content")
  key                    = "dev.datasaker.io/cluster-completed.spec"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "dev-datasaker-io-addons-aws-ebs-csi-driver-addons-k8s-io-k8s-1-17" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_dev.datasaker.io-addons-aws-ebs-csi-driver.addons.k8s.io-k8s-1.17_content")
  key                    = "dev.datasaker.io/addons/aws-ebs-csi-driver.addons.k8s.io/k8s-1.17.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "dev-datasaker-io-addons-bootstrap" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_dev.datasaker.io-addons-bootstrap_content")
  key                    = "dev.datasaker.io/addons/bootstrap-channel.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "dev-datasaker-io-addons-coredns-addons-k8s-io-k8s-1-12" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_dev.datasaker.io-addons-coredns.addons.k8s.io-k8s-1.12_content")
  key                    = "dev.datasaker.io/addons/coredns.addons.k8s.io/k8s-1.12.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "dev-datasaker-io-addons-dns-controller-addons-k8s-io-k8s-1-12" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_dev.datasaker.io-addons-dns-controller.addons.k8s.io-k8s-1.12_content")
  key                    = "dev.datasaker.io/addons/dns-controller.addons.k8s.io/k8s-1.12.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "dev-datasaker-io-addons-kops-controller-addons-k8s-io-k8s-1-16" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_dev.datasaker.io-addons-kops-controller.addons.k8s.io-k8s-1.16_content")
  key                    = "dev.datasaker.io/addons/kops-controller.addons.k8s.io/k8s-1.16.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "dev-datasaker-io-addons-kubelet-api-rbac-addons-k8s-io-k8s-1-9" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_dev.datasaker.io-addons-kubelet-api.rbac.addons.k8s.io-k8s-1.9_content")
  key                    = "dev.datasaker.io/addons/kubelet-api.rbac.addons.k8s.io/k8s-1.9.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "dev-datasaker-io-addons-leader-migration-rbac-addons-k8s-io-k8s-1-23" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_dev.datasaker.io-addons-leader-migration.rbac.addons.k8s.io-k8s-1.23_content")
  key                    = "dev.datasaker.io/addons/leader-migration.rbac.addons.k8s.io/k8s-1.23.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "dev-datasaker-io-addons-limit-range-addons-k8s-io" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_dev.datasaker.io-addons-limit-range.addons.k8s.io_content")
  key                    = "dev.datasaker.io/addons/limit-range.addons.k8s.io/v1.5.0.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "dev-datasaker-io-addons-networking-projectcalico-org-k8s-1-22" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_dev.datasaker.io-addons-networking.projectcalico.org-k8s-1.22_content")
  key                    = "dev.datasaker.io/addons/networking.projectcalico.org/k8s-1.22.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "dev-datasaker-io-addons-storage-aws-addons-k8s-io-v1-15-0" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_dev.datasaker.io-addons-storage-aws.addons.k8s.io-v1.15.0_content")
  key                    = "dev.datasaker.io/addons/storage-aws.addons.k8s.io/v1.15.0.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "etcd-cluster-spec-events" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_etcd-cluster-spec-events_content")
  key                    = "dev.datasaker.io/backups/etcd/events/control/etcd-cluster-spec"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "etcd-cluster-spec-main" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_etcd-cluster-spec-main_content")
  key                    = "dev.datasaker.io/backups/etcd/main/control/etcd-cluster-spec"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "kops-version-txt" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_kops-version.txt_content")
  key                    = "dev.datasaker.io/kops-version.txt"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "manifests-etcdmanager-events" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_manifests-etcdmanager-events_content")
  key                    = "dev.datasaker.io/manifests/etcd/events.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "manifests-etcdmanager-main" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_manifests-etcdmanager-main_content")
  key                    = "dev.datasaker.io/manifests/etcd/main.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "manifests-static-kube-apiserver-healthcheck" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_manifests-static-kube-apiserver-healthcheck_content")
  key                    = "dev.datasaker.io/manifests/static/kube-apiserver-healthcheck.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "nodeupconfig-dev-data-a" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_nodeupconfig-dev-data-a_content")
  key                    = "dev.datasaker.io/igconfig/node/dev-data-a/nodeupconfig.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "nodeupconfig-dev-data-b" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_nodeupconfig-dev-data-b_content")
  key                    = "dev.datasaker.io/igconfig/node/dev-data-b/nodeupconfig.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "nodeupconfig-dev-data-c" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_nodeupconfig-dev-data-c_content")
  key                    = "dev.datasaker.io/igconfig/node/dev-data-c/nodeupconfig.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "nodeupconfig-dev-mgmt-a" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_nodeupconfig-dev-mgmt-a_content")
  key                    = "dev.datasaker.io/igconfig/node/dev-mgmt-a/nodeupconfig.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "nodeupconfig-dev-mgmt-b" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_nodeupconfig-dev-mgmt-b_content")
  key                    = "dev.datasaker.io/igconfig/node/dev-mgmt-b/nodeupconfig.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "nodeupconfig-dev-process-a" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_nodeupconfig-dev-process-a_content")
  key                    = "dev.datasaker.io/igconfig/node/dev-process-a/nodeupconfig.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "nodeupconfig-dev-process-b" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_nodeupconfig-dev-process-b_content")
  key                    = "dev.datasaker.io/igconfig/node/dev-process-b/nodeupconfig.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "nodeupconfig-dev-process-c" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_nodeupconfig-dev-process-c_content")
  key                    = "dev.datasaker.io/igconfig/node/dev-process-c/nodeupconfig.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "nodeupconfig-master-ap-northeast-2a" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_nodeupconfig-master-ap-northeast-2a_content")
  key                    = "dev.datasaker.io/igconfig/master/master-ap-northeast-2a/nodeupconfig.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "nodeupconfig-master-ap-northeast-2b" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_nodeupconfig-master-ap-northeast-2b_content")
  key                    = "dev.datasaker.io/igconfig/master/master-ap-northeast-2b/nodeupconfig.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_s3_object" "nodeupconfig-master-ap-northeast-2c" {
  bucket                 = "clusters.dev.datasaker.io"
  content                = file("${path.module}/data/aws_s3_object_nodeupconfig-master-ap-northeast-2c_content")
  key                    = "dev.datasaker.io/igconfig/master/master-ap-northeast-2c/nodeupconfig.yaml"
  provider               = aws.files
  server_side_encryption = "AES256"
}

resource "aws_security_group" "api-elb-dev-datasaker-io" {
  description = "Security group for api ELB"
  name        = "api-elb.dev.datasaker.io"
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "api-elb.dev.datasaker.io"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
  vpc_id = "vpc-0b6e0b906c678a22f"
}

resource "aws_security_group" "masters-dev-datasaker-io" {
  description = "Security group for masters"
  name        = "masters.dev.datasaker.io"
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "masters.dev.datasaker.io"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
  vpc_id = "vpc-0b6e0b906c678a22f"
}

resource "aws_security_group" "nodes-dev-datasaker-io" {
  description = "Security group for nodes"
  name        = "nodes.dev.datasaker.io"
  tags = {
    "KubernetesCluster"                      = "dev.datasaker.io"
    "Name"                                   = "nodes.dev.datasaker.io"
    "kubernetes.io/cluster/dev.datasaker.io" = "owned"
  }
  vpc_id = "vpc-0b6e0b906c678a22f"
}

resource "aws_security_group_rule" "from-0-0-0-0--0-ingress-tcp-22to22-masters-dev-datasaker-io" {
  cidr_blocks       = ["0.0.0.0/0"]
  from_port         = 22
  protocol          = "tcp"
  security_group_id = aws_security_group.masters-dev-datasaker-io.id
  to_port           = 22
  type              = "ingress"
}

resource "aws_security_group_rule" "from-0-0-0-0--0-ingress-tcp-22to22-nodes-dev-datasaker-io" {
  cidr_blocks       = ["0.0.0.0/0"]
  from_port         = 22
  protocol          = "tcp"
  security_group_id = aws_security_group.nodes-dev-datasaker-io.id
  to_port           = 22
  type              = "ingress"
}

resource "aws_security_group_rule" "from-0-0-0-0--0-ingress-tcp-443to443-api-elb-dev-datasaker-io" {
  cidr_blocks       = ["0.0.0.0/0"]
  from_port         = 443
  protocol          = "tcp"
  security_group_id = aws_security_group.api-elb-dev-datasaker-io.id
  to_port           = 443
  type              = "ingress"
}

resource "aws_security_group_rule" "from-__--0-ingress-tcp-22to22-masters-dev-datasaker-io" {
  from_port         = 22
  ipv6_cidr_blocks  = ["::/0"]
  protocol          = "tcp"
  security_group_id = aws_security_group.masters-dev-datasaker-io.id
  to_port           = 22
  type              = "ingress"
}

resource "aws_security_group_rule" "from-__--0-ingress-tcp-22to22-nodes-dev-datasaker-io" {
  from_port         = 22
  ipv6_cidr_blocks  = ["::/0"]
  protocol          = "tcp"
  security_group_id = aws_security_group.nodes-dev-datasaker-io.id
  to_port           = 22
  type              = "ingress"
}

resource "aws_security_group_rule" "from-__--0-ingress-tcp-443to443-api-elb-dev-datasaker-io" {
  from_port         = 443
  ipv6_cidr_blocks  = ["::/0"]
  protocol          = "tcp"
  security_group_id = aws_security_group.api-elb-dev-datasaker-io.id
  to_port           = 443
  type              = "ingress"
}

resource "aws_security_group_rule" "from-api-elb-dev-datasaker-io-egress-all-0to0-0-0-0-0--0" {
  cidr_blocks       = ["0.0.0.0/0"]
  from_port         = 0
  protocol          = "-1"
  security_group_id = aws_security_group.api-elb-dev-datasaker-io.id
  to_port           = 0
  type              = "egress"
}

resource "aws_security_group_rule" "from-api-elb-dev-datasaker-io-egress-all-0to0-__--0" {
  from_port         = 0
  ipv6_cidr_blocks  = ["::/0"]
  protocol          = "-1"
  security_group_id = aws_security_group.api-elb-dev-datasaker-io.id
  to_port           = 0
  type              = "egress"
}

resource "aws_security_group_rule" "from-masters-dev-datasaker-io-egress-all-0to0-0-0-0-0--0" {
  cidr_blocks       = ["0.0.0.0/0"]
  from_port         = 0
  protocol          = "-1"
  security_group_id = aws_security_group.masters-dev-datasaker-io.id
  to_port           = 0
  type              = "egress"
}

resource "aws_security_group_rule" "from-masters-dev-datasaker-io-egress-all-0to0-__--0" {
  from_port         = 0
  ipv6_cidr_blocks  = ["::/0"]
  protocol          = "-1"
  security_group_id = aws_security_group.masters-dev-datasaker-io.id
  to_port           = 0
  type              = "egress"
}

resource "aws_security_group_rule" "from-masters-dev-datasaker-io-ingress-all-0to0-masters-dev-datasaker-io" {
  from_port                = 0
  protocol                 = "-1"
  security_group_id        = aws_security_group.masters-dev-datasaker-io.id
  source_security_group_id = aws_security_group.masters-dev-datasaker-io.id
  to_port                  = 0
  type                     = "ingress"
}

resource "aws_security_group_rule" "from-masters-dev-datasaker-io-ingress-all-0to0-nodes-dev-datasaker-io" {
  from_port                = 0
  protocol                 = "-1"
  security_group_id        = aws_security_group.nodes-dev-datasaker-io.id
  source_security_group_id = aws_security_group.masters-dev-datasaker-io.id
  to_port                  = 0
  type                     = "ingress"
}

resource "aws_security_group_rule" "from-nodes-dev-datasaker-io-egress-all-0to0-0-0-0-0--0" {
  cidr_blocks       = ["0.0.0.0/0"]
  from_port         = 0
  protocol          = "-1"
  security_group_id = aws_security_group.nodes-dev-datasaker-io.id
  to_port           = 0
  type              = "egress"
}

resource "aws_security_group_rule" "from-nodes-dev-datasaker-io-egress-all-0to0-__--0" {
  from_port         = 0
  ipv6_cidr_blocks  = ["::/0"]
  protocol          = "-1"
  security_group_id = aws_security_group.nodes-dev-datasaker-io.id
  to_port           = 0
  type              = "egress"
}

resource "aws_security_group_rule" "from-nodes-dev-datasaker-io-ingress-4-0to0-masters-dev-datasaker-io" {
  from_port                = 0
  protocol                 = "4"
  security_group_id        = aws_security_group.masters-dev-datasaker-io.id
  source_security_group_id = aws_security_group.nodes-dev-datasaker-io.id
  to_port                  = 65535
  type                     = "ingress"
}

resource "aws_security_group_rule" "from-nodes-dev-datasaker-io-ingress-all-0to0-nodes-dev-datasaker-io" {
  from_port                = 0
  protocol                 = "-1"
  security_group_id        = aws_security_group.nodes-dev-datasaker-io.id
  source_security_group_id = aws_security_group.nodes-dev-datasaker-io.id
  to_port                  = 0
  type                     = "ingress"
}

resource "aws_security_group_rule" "from-nodes-dev-datasaker-io-ingress-tcp-1to2379-masters-dev-datasaker-io" {
  from_port                = 1
  protocol                 = "tcp"
  security_group_id        = aws_security_group.masters-dev-datasaker-io.id
  source_security_group_id = aws_security_group.nodes-dev-datasaker-io.id
  to_port                  = 2379
  type                     = "ingress"
}

resource "aws_security_group_rule" "from-nodes-dev-datasaker-io-ingress-tcp-2382to4000-masters-dev-datasaker-io" {
  from_port                = 2382
  protocol                 = "tcp"
  security_group_id        = aws_security_group.masters-dev-datasaker-io.id
  source_security_group_id = aws_security_group.nodes-dev-datasaker-io.id
  to_port                  = 4000
  type                     = "ingress"
}

resource "aws_security_group_rule" "from-nodes-dev-datasaker-io-ingress-tcp-4003to65535-masters-dev-datasaker-io" {
  from_port                = 4003
  protocol                 = "tcp"
  security_group_id        = aws_security_group.masters-dev-datasaker-io.id
  source_security_group_id = aws_security_group.nodes-dev-datasaker-io.id
  to_port                  = 65535
  type                     = "ingress"
}

resource "aws_security_group_rule" "from-nodes-dev-datasaker-io-ingress-udp-1to65535-masters-dev-datasaker-io" {
  from_port                = 1
  protocol                 = "udp"
  security_group_id        = aws_security_group.masters-dev-datasaker-io.id
  source_security_group_id = aws_security_group.nodes-dev-datasaker-io.id
  to_port                  = 65535
  type                     = "ingress"
}

resource "aws_security_group_rule" "https-elb-to-master" {
  from_port                = 443
  protocol                 = "tcp"
  security_group_id        = aws_security_group.masters-dev-datasaker-io.id
  source_security_group_id = aws_security_group.api-elb-dev-datasaker-io.id
  to_port                  = 443
  type                     = "ingress"
}

resource "aws_security_group_rule" "icmp-pmtu-api-elb-0-0-0-0--0" {
  cidr_blocks       = ["0.0.0.0/0"]
  from_port         = 3
  protocol          = "icmp"
  security_group_id = aws_security_group.api-elb-dev-datasaker-io.id
  to_port           = 4
  type              = "ingress"
}

resource "aws_security_group_rule" "icmpv6-pmtu-api-elb-__--0" {
  from_port         = -1
  ipv6_cidr_blocks  = ["::/0"]
  protocol          = "icmpv6"
  security_group_id = aws_security_group.api-elb-dev-datasaker-io.id
  to_port           = -1
  type              = "ingress"
}

terraform {
  required_version = ">= 0.15.0"
  required_providers {
    aws = {
      "configuration_aliases" = [aws.files]
      "source"                = "hashicorp/aws"
      "version"               = ">= 4.0.0"
    }
  }
}
