diff --git a/.gitlab-ci/terraform.yml b/.gitlab-ci/terraform.yml index 3ab6d636325c3fc621b230d843ffa0ab2c9735e5..d2ec67c696bfeebb312729cd474dfcdda4899090 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 2d9850d4d2104fee938f37bca20c0ae73919dc56..72aa27c79d7e2116a0b518dde41cf98772012cce 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 4395e7132030d8aebfba8c5d0b6f2b5e7c10ef70..ca56b1a92826ad43e222d72e67eb6393ab88c27e 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 fea460ce5f9fae0d544903d5f43aa692d84d4a98..de058a1809d4441ec6dde79cccce601ba3342d8c 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 84635edae24f6edd6ddb14da0d5ba20b37c40aa9..19d165f04c305944308af0962498772dd123a7dc 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 7628996ccf933bc8328745a45bc25ef0ff14dbc9..25613f438fab56806a53373aa5f900bccc505f57 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 0000000000000000000000000000000000000000..6c942790da8e7c15c82a55463526de10cefe23ed --- /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 0000000000000000000000000000000000000000..b7bf5a9cde3701cb538d7b7b87385c867f832e5c --- /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 0000000000000000000000000000000000000000..6c942790da8e7c15c82a55463526de10cefe23ed --- /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 48b2ea88de23bc3e1c54c9464bdca7a8e16efc00..c608b2523fe05fad7c2c8da8cac06ad892fd04c1 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 0000000000000000000000000000000000000000..9541063a2f1af59e5a80473484fcf12f891df92f --- /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 ac97c6ac8e7c1ce3bd191e54af4c6c57fa93643e..d222f2bddb5038af0e892b7ade11cfc676480d6d 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" + } + } }