From 117d0eec5dd39afbfef0b4480e9c12529443df55 Mon Sep 17 00:00:00 2001 From: gar Date: Wed, 6 Oct 2021 12:08:27 -0700 Subject: [PATCH] Removing dev --- terraform-environments/aws/dev/10-vpc/main.tf | 39 --------- .../aws/dev/10-vpc/outputs.tf | 19 ---- .../aws/dev/10-vpc/variables.tf | 18 ---- .../aws/dev/20-eks/README.md | 43 ---------- terraform-environments/aws/dev/20-eks/main.tf | 86 ------------------- .../aws/dev/20-eks/outputs.tf | 15 ---- .../aws/dev/20-eks/variables.tf | 18 ---- 7 files changed, 238 deletions(-) delete mode 100644 terraform-environments/aws/dev/10-vpc/main.tf delete mode 100644 terraform-environments/aws/dev/10-vpc/outputs.tf delete mode 100644 terraform-environments/aws/dev/10-vpc/variables.tf delete mode 100644 terraform-environments/aws/dev/20-eks/README.md delete mode 100644 terraform-environments/aws/dev/20-eks/main.tf delete mode 100644 terraform-environments/aws/dev/20-eks/outputs.tf delete mode 100644 terraform-environments/aws/dev/20-eks/variables.tf diff --git a/terraform-environments/aws/dev/10-vpc/main.tf b/terraform-environments/aws/dev/10-vpc/main.tf deleted file mode 100644 index 6ffde5564..000000000 --- a/terraform-environments/aws/dev/10-vpc/main.tf +++ /dev/null @@ -1,39 +0,0 @@ -terraform { - required_providers { - aws = { - source = "hashicorp/aws" - version = ">= 3.37.0" - } - # random = { - # source = "hashicorp/random" - # } - } - - backend "remote" { - organization = "managedkube" - - workspaces { - name = "kubernetes-ops-staging-10-vpc" - } - } -} - -provider "aws" { - region = var.aws_region -} - -# -# VPC -# -module "vpc" { - source = "github.com/ManagedKube/kubernetes-ops//terraform-modules/aws/vpc?ref=v1.0.18" - - aws_region = var.aws_region - azs = ["us-east-1a", "us-east-1b", "us-east-1c"] - vpc_cidr = "10.0.0.0/16" - private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] - public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"] - environment_name = var.environment_name - cluster_name = var.environment_name - tags = var.tags -} diff --git a/terraform-environments/aws/dev/10-vpc/outputs.tf b/terraform-environments/aws/dev/10-vpc/outputs.tf deleted file mode 100644 index 3182200b0..000000000 --- a/terraform-environments/aws/dev/10-vpc/outputs.tf +++ /dev/null @@ -1,19 +0,0 @@ -output "vpc_id" { - description = "The ID of the VPC" - value = module.vpc.vpc_id -} - -output "private_subnets" { - description = "A list of private subnets" - value = module.vpc.private_subnets -} - -output "public_subnets" { - description = "A list of public subnets" - value = module.vpc.public_subnets -} - -output "k8s_subnets" { - description = "A list of k8s subnets" - value = module.vpc.k8s_subnets -} diff --git a/terraform-environments/aws/dev/10-vpc/variables.tf b/terraform-environments/aws/dev/10-vpc/variables.tf deleted file mode 100644 index eb37fe8c6..000000000 --- a/terraform-environments/aws/dev/10-vpc/variables.tf +++ /dev/null @@ -1,18 +0,0 @@ -variable "aws_region" { - default = "us-east-1" -} - -variable "environment_name" { - default = "dev" -} - -variable "tags" { - type = map(any) - default = { - ops_env = "dev" - ops_managed_by = "terraform", - ops_source_repo = "kubernetes-ops", - ops_source_repo_path = "terraform-environments/aws/dev", - ops_owners = "devops", - } -} diff --git a/terraform-environments/aws/dev/20-eks/README.md b/terraform-environments/aws/dev/20-eks/README.md deleted file mode 100644 index 64e5c1e10..000000000 --- a/terraform-environments/aws/dev/20-eks/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# eks - -Builds and EKS cluster using this module: https://github.com/terraform-aws-modules/terraform-aws-eks - -## AWS CLI Authentication - -### Setup your local SSO AWS CLI Profile -Doc: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html - -This will startup the config walk through -``` -aws configure sso -``` - -Config params: -* The start URL: https://d-90676a13de.awsapps.com/start -* CLI profile name: `gem-dev` - * name it something simple - -Set your env to use this profile: -``` -export AWS_PROFILE=gem-dev -``` - -Now you can run any AWS CLI commands and it will use this profile as the authentication mechanism. - -## Subsequent AWS CLI Login - -``` -aws sso login --profile gem-dev -``` - -## Post cluster creation - -list clusters -``` -aws eks --region us-east-1 list-clusters -``` - -Get kubeconfig -``` -aws eks --region us-east-1 update-kubeconfig --name dev --profile gem-dev -``` diff --git a/terraform-environments/aws/dev/20-eks/main.tf b/terraform-environments/aws/dev/20-eks/main.tf deleted file mode 100644 index 160feca2b..000000000 --- a/terraform-environments/aws/dev/20-eks/main.tf +++ /dev/null @@ -1,86 +0,0 @@ -terraform { - required_providers { - aws = { - source = "hashicorp/aws" - version = ">= 3.37.0" - } - random = { - source = "hashicorp/random" - } - } - - backend "remote" { - organization = "managedkube" - - workspaces { - name = "kubernetes-ops-staging-20-eks" - } - } -} - -provider "aws" { - region = var.aws_region -} - -data "terraform_remote_state" "vpc" { - backend = "remote" - config = { - organization = "managedkube" - workspaces = { - name = "kubernetes-ops-staging-10-vpc" - } - } -} - -# -# EKS -# -module "eks" { - source = "github.com/ManagedKube/kubernetes-ops//terraform-modules/aws/eks?ref=v1.0.18" - - aws_region = var.aws_region - tags = var.tags - - cluster_name = var.environment_name - - vpc_id = data.terraform_remote_state.vpc.outputs.vpc_id - k8s_subnets = data.terraform_remote_state.vpc.outputs.k8s_subnets - public_subnets = data.terraform_remote_state.vpc.outputs.public_subnets - - cluster_version = "1.18" - cluster_endpoint_public_access = true - cluster_endpoint_public_access_cidrs = [ - "0.0.0.0/0" - ] - - map_roles = [ - { - rolearn = "arn:aws:iam::66666666666:role/role1" - username = "role1" - groups = ["system:masters"] - }, - ] - map_users = [ - { - userarn = "arn:aws:iam::725654443526:user/username" - username = "username" - groups = ["system:masters"] - }, - ] - - node_groups = { - ng1 = { - disk_size = 20 - desired_capacity = 2 - max_capacity = 4 - min_capacity = 1 - instance_types = ["t3.small"] - additional_tags = var.tags - k8s_labels = {} - } - } - - # depends_on = [ - # module.vpc - # ] -} diff --git a/terraform-environments/aws/dev/20-eks/outputs.tf b/terraform-environments/aws/dev/20-eks/outputs.tf deleted file mode 100644 index 025a0a0b8..000000000 --- a/terraform-environments/aws/dev/20-eks/outputs.tf +++ /dev/null @@ -1,15 +0,0 @@ -output "cluster_endpoint" { - value = module.eks.cluster_endpoint -} - -output "cluster_certificate_authority_data" { - value = module.eks.cluster_certificate_authority_data -} - -output "cluster_id" { - value = module.eks.cluster_id -} - -output "cluster_oidc_issuer_url" { - value = module.eks.cluster_oidc_issuer_url -} diff --git a/terraform-environments/aws/dev/20-eks/variables.tf b/terraform-environments/aws/dev/20-eks/variables.tf deleted file mode 100644 index eb37fe8c6..000000000 --- a/terraform-environments/aws/dev/20-eks/variables.tf +++ /dev/null @@ -1,18 +0,0 @@ -variable "aws_region" { - default = "us-east-1" -} - -variable "environment_name" { - default = "dev" -} - -variable "tags" { - type = map(any) - default = { - ops_env = "dev" - ops_managed_by = "terraform", - ops_source_repo = "kubernetes-ops", - ops_source_repo_path = "terraform-environments/aws/dev", - ops_owners = "devops", - } -}