Skip to content

Commit

Permalink
Issue #30: Revamp terraform folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
SonOfLope committed Feb 7, 2024
1 parent 4c772aa commit e65df77
Show file tree
Hide file tree
Showing 16 changed files with 98 additions and 167 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Infrastructure integration workflow
---
name: Infra integration workflow

on:

Check warning on line 4 in .github/workflows/workflow.yaml

View workflow job for this annotation

GitHub Actions / yaml-check / yaml-lint-check

4:1 [truthy] truthy value should be one of [false, true]
pull_request:
Expand All @@ -8,9 +9,10 @@ on:
- synchronize

jobs:

markdown-check:
uses:
ai-cfia/github-workflows/.github/workflows/workflow-markdown-check.yml@76-as-a-devops-i-would-like-to-fix-the-markdown-lint-workflow
ai-cfia/github-workflows/.github/workflows/workflow-markdown-check.yml@main

yaml-check:
uses:
Expand Down
102 changes: 0 additions & 102 deletions .terraform.lock.hcl

This file was deleted.

8 changes: 5 additions & 3 deletions apply-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ stages:
inputs:
provider: 'azurerm'
command: 'init'
workingDirectory: '$(System.DefaultWorkingDirectory)/terraform'
workingDirectory:
'$(System.DefaultWorkingDirectory)/terraform/staging'
backendServiceArm: '$(serviceConnectionName)'
backendAzureRmResourceGroupName: '$(resourceGroupName)'
backendAzureRmStorageAccountName: '$(storageAccountName)'
Expand All @@ -34,7 +35,8 @@ stages:
inputs:
provider: 'azurerm'
command: 'plan'
workingDirectory: '$(System.DefaultWorkingDirectory)/terraform'
workingDirectory:
'$(System.DefaultWorkingDirectory)/terraform/staging'
environmentServiceNameAzureRM: '$(serviceConnectionName)'

- stage: Apply
Expand All @@ -57,5 +59,5 @@ stages:
provider: 'azurerm'
command: 'apply'
workingDirectory:
'$(System.DefaultWorkingDirectory)/terraform'
'$(System.DefaultWorkingDirectory)/terraform/staging'
environmentServiceNameAzureRM: '$(serviceConnectionName)'
21 changes: 0 additions & 21 deletions main.tf

This file was deleted.

34 changes: 0 additions & 34 deletions providers.tf

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ terraform {

provider "google" {
project = var.project_id
region = var.region
region = var.region
}
File renamed without changes.
26 changes: 26 additions & 0 deletions terraform/prod/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# terraform {

# required_version = ">= 1.1.0"

# backend "azurerm" {
# resource_group_name = "rg-ai-cfia-terraform-state"
# storage_account_name = "tfcfiastate"
# container_name = "infra-terraform-state"
# key = "tf/terraform.tfstate"
# }

# required_providers {
# azurerm = {
# source = "hashicorp/azurerm"
# version = "~> 3.25"
# }
# kubernetes = {
# source = "hashicorp/kubernetes"
# version = "2.24.0"
# }
# }
# }

# provider "azurerm" {
# features {}
# }
58 changes: 58 additions & 0 deletions terraform/staging/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
terraform {

backend "azurerm" {
resource_group_name = "rg-ai-cfia-terraform-state"
storage_account_name = "tfcfiastate"
container_name = "infra-terraform-state"
key = "tf/terraform.tfstate"
}

# backend "gcs" {
# bucket = "terraform-tfstate-gcp-storage"
# prefix = "terraform/state"
# }

required_providers {
google = {
source = "hashicorp/google"
version = "~> 5.0"
}
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.25"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.24.0"
}
# aws = {
# source = "hashicorp/aws"
# version = "~> 3.0"
# }
}
}

provider "azurerm" {
features {}
}

# provider "google" {
# project = "spartan-rhino-408115"
# region = "northamerica-northeast1"
# }

# provider "kubernetes" {
# config_path = "~/.kube/config"
# config_context = var.kube_ctx
# }

# module "gcp-kubernetes-cluster-0" {
# source = "./terraform/gcp-kubernetes-cluster"

# cluster_name = "acia-cfia"
# project_id = "spartan-rhino-408115"

# region = "northamerica-northeast1"
# location_1 = "northamerica-northeast1-a"
# location_2 = "northamerica-northeast1-b"
# }
4 changes: 4 additions & 0 deletions terraform/staging/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
variable "kube_ctx" {
description = "The kubernetes cluster context."
type = string
}
4 changes: 0 additions & 4 deletions variables.tf

This file was deleted.

0 comments on commit e65df77

Please sign in to comment.