diff --git a/.gitlab-ci/terraform.yml b/.gitlab-ci/terraform.yml index 3ab6d6363..d2ec67c69 100644 --- a/.gitlab-ci/terraform.yml +++ b/.gitlab-ci/terraform.yml @@ -74,6 +74,48 @@ tf-validate-aws: PROVIDER: aws CLUSTER: $CI_COMMIT_REF_NAME +tf-0.13.x-validate-openstack: + extends: .terraform_validate + variables: + TF_VERSION: 0.13.5 + PROVIDER: openstack + CLUSTER: $CI_COMMIT_REF_NAME + +tf-0.13.x-validate-packet: + extends: .terraform_validate + variables: + TF_VERSION: 0.13.5 + PROVIDER: packet + CLUSTER: $CI_COMMIT_REF_NAME + +tf-0.13.x-validate-aws: + extends: .terraform_validate + variables: + TF_VERSION: 0.13.5 + PROVIDER: aws + CLUSTER: $CI_COMMIT_REF_NAME + +tf-0.14.x-validate-openstack: + extends: .terraform_validate + variables: + TF_VERSION: 0.14.3 + PROVIDER: openstack + CLUSTER: $CI_COMMIT_REF_NAME + +tf-0.14.x-validate-packet: + extends: .terraform_validate + variables: + TF_VERSION: 0.14.3 + PROVIDER: packet + CLUSTER: $CI_COMMIT_REF_NAME + +tf-0.14.x-validate-aws: + extends: .terraform_validate + variables: + TF_VERSION: 0.14.3 + PROVIDER: aws + CLUSTER: $CI_COMMIT_REF_NAME + # tf-packet-ubuntu16-default: # extends: .terraform_apply # variables: diff --git a/contrib/terraform/aws/create-infrastructure.tf b/contrib/terraform/aws/create-infrastructure.tf index 2d9850d4d..72aa27c79 100644 --- a/contrib/terraform/aws/create-infrastructure.tf +++ b/contrib/terraform/aws/create-infrastructure.tf @@ -63,7 +63,7 @@ resource "aws_instance" "bastion-server" { tags = merge(var.default_tags, map( "Name", "kubernetes-${var.aws_cluster_name}-bastion-${count.index}", - "Cluster", "${var.aws_cluster_name}", + "Cluster", var.aws_cluster_name, "Role", "bastion-${var.aws_cluster_name}-${count.index}" )) } diff --git a/contrib/terraform/aws/modules/elb/variables.tf b/contrib/terraform/aws/modules/elb/variables.tf index 4395e7132..ca56b1a92 100644 --- a/contrib/terraform/aws/modules/elb/variables.tf +++ b/contrib/terraform/aws/modules/elb/variables.tf @@ -16,15 +16,15 @@ variable "k8s_secure_api_port" { variable "aws_avail_zones" { description = "Availability Zones Used" - type = "list" + type = list(string) } variable "aws_subnet_ids_public" { description = "IDs of Public Subnets" - type = "list" + type = list(string) } variable "default_tags" { description = "Tags for all resources" - type = "map" + type = map(string) } diff --git a/contrib/terraform/aws/modules/vpc/variables.tf b/contrib/terraform/aws/modules/vpc/variables.tf index fea460ce5..de058a180 100644 --- a/contrib/terraform/aws/modules/vpc/variables.tf +++ b/contrib/terraform/aws/modules/vpc/variables.tf @@ -8,20 +8,20 @@ variable "aws_cluster_name" { variable "aws_avail_zones" { description = "AWS Availability Zones Used" - type = "list" + type = list(string) } variable "aws_cidr_subnets_private" { description = "CIDR Blocks for private subnets in Availability zones" - type = "list" + type = list(string) } variable "aws_cidr_subnets_public" { description = "CIDR Blocks for public subnets in Availability zones" - type = "list" + type = list(string) } variable "default_tags" { description = "Default tags for all resources" - type = "map" + type = map(string) } diff --git a/contrib/terraform/aws/variables.tf b/contrib/terraform/aws/variables.tf index 84635edae..19d165f04 100644 --- a/contrib/terraform/aws/variables.tf +++ b/contrib/terraform/aws/variables.tf @@ -44,12 +44,12 @@ variable "aws_vpc_cidr_block" { variable "aws_cidr_subnets_private" { description = "CIDR Blocks for private subnets in Availability Zones" - type = "list" + type = list(string) } variable "aws_cidr_subnets_public" { description = "CIDR Blocks for public subnets in Availability Zones" - type = "list" + type = list(string) } //AWS EC2 Settings @@ -101,7 +101,7 @@ variable "k8s_secure_api_port" { variable "default_tags" { description = "Default tags for all resources" - type = "map" + type = map(string) } variable "inventory_file" { diff --git a/contrib/terraform/openstack/kubespray.tf b/contrib/terraform/openstack/kubespray.tf index 7628996cc..25613f438 100644 --- a/contrib/terraform/openstack/kubespray.tf +++ b/contrib/terraform/openstack/kubespray.tf @@ -1,7 +1,3 @@ -provider "openstack" { - version = "~> 1.17" -} - module "network" { source = "./modules/network" diff --git a/contrib/terraform/openstack/modules/compute/versions.tf b/contrib/terraform/openstack/modules/compute/versions.tf new file mode 100644 index 000000000..6c942790d --- /dev/null +++ b/contrib/terraform/openstack/modules/compute/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + openstack = { + source = "terraform-provider-openstack/openstack" + } + } + required_version = ">= 0.12.26" +} diff --git a/contrib/terraform/openstack/modules/ips/versions.tf b/contrib/terraform/openstack/modules/ips/versions.tf new file mode 100644 index 000000000..b7bf5a9cd --- /dev/null +++ b/contrib/terraform/openstack/modules/ips/versions.tf @@ -0,0 +1,11 @@ +terraform { + required_providers { + null = { + source = "hashicorp/null" + } + openstack = { + source = "terraform-provider-openstack/openstack" + } + } + required_version = ">= 0.12.26" +} diff --git a/contrib/terraform/openstack/modules/network/versions.tf b/contrib/terraform/openstack/modules/network/versions.tf new file mode 100644 index 000000000..6c942790d --- /dev/null +++ b/contrib/terraform/openstack/modules/network/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + openstack = { + source = "terraform-provider-openstack/openstack" + } + } + required_version = ">= 0.12.26" +} diff --git a/contrib/terraform/openstack/variables.tf b/contrib/terraform/openstack/variables.tf index 48b2ea88d..c608b2523 100644 --- a/contrib/terraform/openstack/variables.tf +++ b/contrib/terraform/openstack/variables.tf @@ -152,7 +152,7 @@ variable "subnet_cidr" { variable "dns_nameservers" { description = "An array of DNS name server names used by hosts in this subnet." - type = list + type = list(string) default = [] } @@ -211,13 +211,13 @@ variable "k8s_allowed_egress_ips" { } variable "master_allowed_ports" { - type = list + type = list(any) default = [] } variable "worker_allowed_ports" { - type = list + type = list(any) default = [ { diff --git a/contrib/terraform/openstack/versions.tf b/contrib/terraform/openstack/versions.tf new file mode 100644 index 000000000..9541063a2 --- /dev/null +++ b/contrib/terraform/openstack/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_providers { + openstack = { + source = "terraform-provider-openstack/openstack" + version = "~> 1.17" + } + } + required_version = ">= 0.12.26" +} diff --git a/contrib/terraform/packet/versions.tf b/contrib/terraform/packet/versions.tf index ac97c6ac8..d222f2bdd 100644 --- a/contrib/terraform/packet/versions.tf +++ b/contrib/terraform/packet/versions.tf @@ -1,4 +1,9 @@ terraform { required_version = ">= 0.12" + required_providers { + packet = { + source = "terraform-providers/packet" + } + } }