Skip to content
Open
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
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to advanced git</title>
</head>
<body>
<h1>Git playground. Welcome all</h1>
</body>
</html>
Empty file added script.js
Empty file.
4 changes: 4 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
h1{
color: aquamarine;
font: italic;
}
61 changes: 61 additions & 0 deletions terraform/.github/workflow/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Vprofile IAC"
on:
push:
branches:
- main
- stage
paths:
- terraform/**
pull_request:
branches:
- main
paths:
- terraform/**

env:
# Credentials for deployment to AWS
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# S3 bucket for the Terraform state
BUCKET_TF_STATE: ${{ secrets.BUCKET_TF_STATE}}
AWS_REGION: eu-central-1
EKS_CLUSTER: vprofile-eks

jobs:
terraform:
name: "Apply terraform code changes"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./terraform

steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Setup Terraform with specified version on the runner
uses: hashicorp/setup-terraform@v2
#with:
# terraform_version: 1.6.3

- name: Terraform init
id: init
run: terraform init -backend-config="bucket=$BUCKET_TF_STATE"

- name: Terraform format
id: fmt
run: terraform fmt -check

- name: Terraform validate
id: validate
run: terraform validate

- name: Terraform plan
id: plan
run: terraform plan -no-color -input=false -out planfile
continue-on-error: true

- name: Terraform plan status
if: steps.plan.outcome == 'failure'
run: exit 1
6 changes: 3 additions & 3 deletions terraform/eks-cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module "eks" {
version = "19.19.1"

cluster_name = local.cluster_name
cluster_version = "1.27"
cluster_version = "1.31"

vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
Expand All @@ -21,8 +21,8 @@ module "eks" {
instance_types = ["t3.small"]

min_size = 1
max_size = 3
desired_size = 2
max_size = 2
desired_size = 1
}

two = {
Expand Down
4 changes: 1 addition & 3 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ data "aws_availability_zones" "available" {}

locals {
cluster_name = var.clusterName
}

##
}
2 changes: 1 addition & 1 deletion terraform/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ terraform {
backend "s3" {
bucket = "gitopsterrastate"
key = "terraform.tfstate"
region = "us-east-2"
region = "eu-central-1"
}

required_version = "~> 1.6.3"
Expand Down
2 changes: 1 addition & 1 deletion terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variable "region" {
description = "AWS region"
type = string
default = "us-east-2"
default = "eu-central-1"
}

variable "clusterName" {
Expand Down
1 change: 1 addition & 0 deletions terraform/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module "vpc" {
cidr = "172.20.0.0/16"
azs = slice(data.aws_availability_zones.available.names, 0, 3)

#This is just for tryout.
private_subnets = ["172.20.1.0/24", "172.20.2.0/24", "172.20.3.0/24"]
public_subnets = ["172.20.4.0/24", "172.20.5.0/24", "172.20.6.0/24"]

Expand Down