Skip to content

Commit

Permalink
Merge pull request #37 from ai-cfia/30-as-a-devops-i-would-like-to-re…
Browse files Browse the repository at this point in the history
…work-the-file-structure-in-this-directory

Issue #30: As a Devops, I would like to rework the file structure in this directory
  • Loading branch information
SonOfLope authored Feb 9, 2024
2 parents 4c772aa + 11b5ea7 commit 623b979
Show file tree
Hide file tree
Showing 16 changed files with 105 additions and 171 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Infrastructure integration workflow
---
name: Howard integration workflow

on:
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.

12 changes: 6 additions & 6 deletions apply-terraform.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
trigger:
branches:
include:
- main
- main

pool:
vmImage: 'ubuntu-latest'
Expand All @@ -22,7 +20,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 +33,8 @@ stages:
inputs:
provider: 'azurerm'
command: 'plan'
workingDirectory: '$(System.DefaultWorkingDirectory)/terraform'
workingDirectory:
'$(System.DefaultWorkingDirectory)/terraform/staging'
environmentServiceNameAzureRM: '$(serviceConnectionName)'

- stage: Apply
Expand All @@ -57,5 +57,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.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resource "google_container_cluster" "cluster" {

# Optional, if you want multi-zonal cluster
node_locations = [
"${var.location_2}"
var.location_2
]

addons_config {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
terraform {

required_version = ">= 1.7.2"

required_providers {
local = {
source = "hashicorp/local"
Expand All @@ -25,5 +28,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 {}
# }
60 changes: 60 additions & 0 deletions terraform/staging/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
terraform {

required_version = ">= 1.7.2"

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 623b979

Please sign in to comment.