From 88980dc99ceaf09543ab08ff242459c436303d59 Mon Sep 17 00:00:00 2001 From: Edgar Costa Date: Thu, 30 May 2024 20:45:49 -0300 Subject: [PATCH] adding the variables back --- bootstrap/terraform/main.tf | 9 ++++----- bootstrap/terraform/variables.tf | 24 ++++++++++++++++++++++++ bootstrap/terraform/versions.tf | 7 +++++++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/bootstrap/terraform/main.tf b/bootstrap/terraform/main.tf index a39f4760..3253aeaa 100644 --- a/bootstrap/terraform/main.tf +++ b/bootstrap/terraform/main.tf @@ -43,11 +43,10 @@ data "aws_caller_identity" "current" {} data "aws_availability_zones" "available" {} locals { - name = "crossplane-blueprints" - region = "us-east-1" + name = var.name + region = var.region - cluster_version = "1.30" - capacity_type = "SPOT" + cluster_version = var.cluster_version cluster_name = local.name vpc_name = local.name @@ -122,7 +121,7 @@ module "eks" { eks_managed_node_groups = { initial = { instance_types = ["m6i.large", "m5.large", "m5n.large", "m5zn.large"] - capacity_type = local.capacity_type # defaults to SPOT + capacity_type = var.capacity_type # defaults to SPOT min_size = 1 max_size = 5 desired_size = 3 diff --git a/bootstrap/terraform/variables.tf b/bootstrap/terraform/variables.tf index dcb32b0f..110197fe 100644 --- a/bootstrap/terraform/variables.tf +++ b/bootstrap/terraform/variables.tf @@ -1,6 +1,30 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 +variable "region" { + description = "AWS region" + type = string + default = "us-east-1" +} + +variable "name" { + description = "EKS Cluster Name and the VPC name" + type = string + default = "crossplane-blueprints" +} + +variable "cluster_version" { + type = string + description = "Kubernetes Version" + default = "1.30" +} + +variable "capacity_type" { + type = string + description = "Capacity SPOT or ON_DEMAND" + default = "SPOT" +} + variable "enable_upjet_aws_provider" { type = bool description = "Installs the upjet aws provider" diff --git a/bootstrap/terraform/versions.tf b/bootstrap/terraform/versions.tf index 0982c820..b82daba3 100644 --- a/bootstrap/terraform/versions.tf +++ b/bootstrap/terraform/versions.tf @@ -22,4 +22,11 @@ terraform { version = ">= 2.13" } } + + # ## Used for end-to-end testing on project; update to suit your needs + # backend "s3" { + # bucket = "terraform-crossplane-on-eks-github-actions-state" + # region = "us-east-1" + # key = "e2e/bootstrap/terraform/terraform.tfstate" + # } }