|
|
@ -20,7 +20,7 @@ module "aws-vpc" { |
|
|
|
|
|
|
|
aws_cluster_name = var.aws_cluster_name |
|
|
|
aws_vpc_cidr_block = var.aws_vpc_cidr_block |
|
|
|
aws_avail_zones = slice(data.aws_availability_zones.available.names, 0, length(var.aws_cidr_subnets_public) <= length(data.aws_availability_zones.available.names) ? length(var.aws_cidr_subnets_public) : length(data.aws_availability_zones.available.names)) |
|
|
|
aws_avail_zones = data.aws_availability_zones.available.names |
|
|
|
aws_cidr_subnets_private = var.aws_cidr_subnets_private |
|
|
|
aws_cidr_subnets_public = var.aws_cidr_subnets_public |
|
|
|
default_tags = var.default_tags |
|
|
@ -31,7 +31,7 @@ module "aws-elb" { |
|
|
|
|
|
|
|
aws_cluster_name = var.aws_cluster_name |
|
|
|
aws_vpc_id = module.aws-vpc.aws_vpc_id |
|
|
|
aws_avail_zones = slice(data.aws_availability_zones.available.names, 0, length(var.aws_cidr_subnets_public) <= length(data.aws_availability_zones.available.names) ? length(var.aws_cidr_subnets_public) : length(data.aws_availability_zones.available.names)) |
|
|
|
aws_avail_zones = data.aws_availability_zones.available.names |
|
|
|
aws_subnet_ids_public = module.aws-vpc.aws_subnet_ids_public |
|
|
|
aws_elb_api_port = var.aws_elb_api_port |
|
|
|
k8s_secure_api_port = var.k8s_secure_api_port |
|
|
@ -54,7 +54,6 @@ resource "aws_instance" "bastion-server" { |
|
|
|
instance_type = var.aws_bastion_size |
|
|
|
count = var.aws_bastion_num |
|
|
|
associate_public_ip_address = true |
|
|
|
availability_zone = element(slice(data.aws_availability_zones.available.names, 0, length(var.aws_cidr_subnets_public) <= length(data.aws_availability_zones.available.names) ? length(var.aws_cidr_subnets_public) : length(data.aws_availability_zones.available.names)), count.index) |
|
|
|
subnet_id = element(module.aws-vpc.aws_subnet_ids_public, count.index) |
|
|
|
|
|
|
|
vpc_security_group_ids = module.aws-vpc.aws_security_group |
|
|
@ -79,8 +78,7 @@ resource "aws_instance" "k8s-master" { |
|
|
|
|
|
|
|
count = var.aws_kube_master_num |
|
|
|
|
|
|
|
availability_zone = element(slice(data.aws_availability_zones.available.names, 0, length(var.aws_cidr_subnets_public) <= length(data.aws_availability_zones.available.names) ? length(var.aws_cidr_subnets_public) : length(data.aws_availability_zones.available.names)), count.index) |
|
|
|
subnet_id = element(module.aws-vpc.aws_subnet_ids_private, count.index) |
|
|
|
subnet_id = element(module.aws-vpc.aws_subnet_ids_private, count.index) |
|
|
|
|
|
|
|
vpc_security_group_ids = module.aws-vpc.aws_security_group |
|
|
|
|
|
|
@ -110,8 +108,7 @@ resource "aws_instance" "k8s-etcd" { |
|
|
|
|
|
|
|
count = var.aws_etcd_num |
|
|
|
|
|
|
|
availability_zone = element(slice(data.aws_availability_zones.available.names, 0, length(var.aws_cidr_subnets_public) <= length(data.aws_availability_zones.available.names) ? length(var.aws_cidr_subnets_public) : length(data.aws_availability_zones.available.names)), count.index) |
|
|
|
subnet_id = element(module.aws-vpc.aws_subnet_ids_private, count.index) |
|
|
|
subnet_id = element(module.aws-vpc.aws_subnet_ids_private, count.index) |
|
|
|
|
|
|
|
vpc_security_group_ids = module.aws-vpc.aws_security_group |
|
|
|
|
|
|
@ -134,8 +131,7 @@ resource "aws_instance" "k8s-worker" { |
|
|
|
|
|
|
|
count = var.aws_kube_worker_num |
|
|
|
|
|
|
|
availability_zone = element(slice(data.aws_availability_zones.available.names, 0, length(var.aws_cidr_subnets_public) <= length(data.aws_availability_zones.available.names) ? length(var.aws_cidr_subnets_public) : length(data.aws_availability_zones.available.names)), count.index) |
|
|
|
subnet_id = element(module.aws-vpc.aws_subnet_ids_private, count.index) |
|
|
|
subnet_id = element(module.aws-vpc.aws_subnet_ids_private, count.index) |
|
|
|
|
|
|
|
vpc_security_group_ids = module.aws-vpc.aws_security_group |
|
|
|
|
|
|
|