Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,45 @@
# Talos / Kubernetes credentials
talos/talosconfig
talos/kubeconfig
talos/controlplane.yaml
talos/worker.yaml
talos/*.pem
talos/*.key
talos/*.crt
talos/*.csr
talos/support-*.zip
talos_backup_*/talos_backup_*/talos_backup_*/

# Local Kubectl
.kube/
*.log


# Terraform
.terraform/
*.tfstate*
.crash
*.lock.hcl
*.tfstate.backup
.terraform.lock.hcl

crash.log
*.tfvars
*.tfvars.json

# AWS credentials
*.pem
*.key

# Editor files
# file editors
.DS_Store
.idea/
.vscode/
*.swp


kubeconfig*
cilium-quick-install.yaml
talos_backup_*/
*.backup
*.tfstate
*.tfstate.*
1 change: 0 additions & 1 deletion core/backend/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ terraform {
version = "~> 5.60"
}
}
backend "s3" {}
}
provider "aws" {
region = "us-east-1"
Expand Down
4 changes: 2 additions & 2 deletions core/vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ module "vpc" {
private_subnets = var.private_subnet_cidrs

# Enable NAT Gateway for outbound traffic from private subnets
enable_nat_gateway = true
enable_nat_gateway = false

# Create one NAT Gateway per AZ for high availability
single_nat_gateway = false
one_nat_gateway_per_az = true
one_nat_gateway_per_az = false

# Enable DNS hostnames and DNS resolution support within the VPC
enable_dns_hostnames = true
Expand Down
12 changes: 1 addition & 11 deletions core/vpc/versions.tf
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
terraform {
required_version = ">= 1.6.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.60"
}
}
backend "s3" {
bucket = "shopstack-dev-tfstate"
key = "shopstack/dev/terraform.tfstate"
region = "us-east-1"
dynamodb_table = "shopstack-dev-tflock"
encrypt = true
}
}

provider "aws" {
region = var.region
}
17 changes: 0 additions & 17 deletions eks/aws-auth-patch.yaml

This file was deleted.

44 changes: 0 additions & 44 deletions eks/main.tf

This file was deleted.

15 changes: 0 additions & 15 deletions eks/outputs.tf

This file was deleted.

30 changes: 0 additions & 30 deletions eks/variables.tf

This file was deleted.

4 changes: 2 additions & 2 deletions envs/dev/backend.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
terraform {
backend "s3" {
bucket = "terraform-state-shopstack-770132776547"
bucket = "shopstack-dev-tfstate"
key = "envs/dev/terraform.tfstate"
region = "us-east-1"
dynamodb_table = "terraform-locks"
dynamodb_table = "shopstack-dev-tflock"
encrypt = true
}
}
19 changes: 18 additions & 1 deletion envs/dev/main.tf
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
locals { tags = { Project = "ShopStack", Env = "dev" } }
locals {
project = "shopstack"
env = "dev"
}

module "network" {
source = "../../vpc"

project = local.project
env = local.env
region = "us-east-1"
vpc_cidr = "10.0.0.0/16"
azs = ["us-east-1a", "us-east-1b"]
public_subnet_cidrs = ["10.0.0.0/24", "10.0.1.0/24"]
private_subnet_cidrs = ["10.0.10.0/24", "10.0.11.0/24"]
}


1 change: 1 addition & 0 deletions envs/dev/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# no outputs yet
11 changes: 9 additions & 2 deletions envs/dev/versions.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
terraform {
required_version = ">= 1.6.0"

required_providers {
aws = { source = "hashicorp/aws", version = "~> 5.0" }
aws = {
source = "hashicorp/aws"
version = "~> 5.60"
}
}
}
provider "aws" { region = "us-east-1" }

provider "aws" {
region = "us-east-1"
}
Binary file added talos/etcd_snapshot.db
Binary file not shown.
11 changes: 11 additions & 0 deletions talos/machineconfig_export.yaml

Large diffs are not rendered by default.

Empty file added talos/node_config.yaml
Empty file.
Empty file added talos/node_machineconfig.yaml
Empty file.
5 changes: 5 additions & 0 deletions talos/ntp.patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
machine:
time:
servers:
- time.google.com
- pool.ntp.org
24 changes: 24 additions & 0 deletions vpc/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
provider "aws" {
region = var.region
}

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.8.1"

name = "${var.project}-${var.env}-vpc"
cidr = var.vpc_cidr

azs = var.azs
public_subnets = var.public_subnet_cidrs
private_subnets = var.private_subnet_cidrs

# Mantenerlo barato / simple
enable_nat_gateway = false
single_nat_gateway = false

tags = {
Project = var.project
Env = var.env
}
}
11 changes: 11 additions & 0 deletions vpc/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
output "vpc_id" {
value = module.vpc.vpc_id
}

output "public_subnets" {
value = module.vpc.public_subnets
}

output "private_subnets" {
value = module.vpc.private_subnets
}
27 changes: 27 additions & 0 deletions vpc/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
variable "project" {
type = string
}

variable "env" {
type = string
}

variable "region" {
type = string
}

variable "vpc_cidr" {
type = string
}

variable "azs" {
type = list(string)
}

variable "public_subnet_cidrs" {
type = list(string)
}

variable "private_subnet_cidrs" {
type = list(string)
}
10 changes: 10 additions & 0 deletions vpc/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_version = ">= 1.5.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}