Skip to content

Commit

Permalink
organize codes directory sturcture
Browse files Browse the repository at this point in the history
this organize directory structure holds scripts and configurations for automating  provisioning, and management of infrastructure

Signed-off-by: karim mdmirajul <karim.mdmirajul@unikie.com>
  • Loading branch information
karim20230 committed Nov 2, 2023
1 parent f0af2bc commit 8443654
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 39 deletions.
39 changes: 0 additions & 39 deletions terraform/azure-ghaf-infra.tf
Original file line number Diff line number Diff line change
@@ -1,46 +1,7 @@
# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII)
#
# SPDX-License-Identifier: Apache-2.0
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
}
sops = {
source = "carlpett/sops"
}
}
}

data "sops_file" "ghaf-infra" {
source_file = "secrets.yaml"
}

provider "azurerm" {
features {}
}


# Backend for storing tfstate

terraform {
backend "azurerm" {
resource_group_name = "ghaf-infra-storage"
storage_account_name = "ghafinfrastatestorage"
container_name = "ghaf-infra-tfstate-container"
key = "ghaf-infra.tfstate"
}
}


# Resource group

variable "resource_group_location" {
type = string
default = "northeurope"
description = "Location of the resource group."
}

resource "azurerm_resource_group" "rg" {
name = "ghaf-infra-terraform-dev"
location = var.resource_group_location
Expand Down
8 changes: 8 additions & 0 deletions terraform/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
backend "azurerm" {
resource_group_name = "ghaf-infra-storage"
storage_account_name = "ghafinfrastatestorage"
container_name = "ghaf-infra-tfstate-container"
key = "ghaf-infra.tfstate"
}
}
3 changes: 3 additions & 0 deletions terraform/data.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "sops_file" "ghaf-infra" {
source_file = "secrets.yaml"
}
7 changes: 7 additions & 0 deletions terraform/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}

output "resource_group_location" {
value = azurerm_resource_group.rg.location
}
15 changes: 15 additions & 0 deletions terraform/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
provider "azurerm" {
features {}
}

terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
}
sops = {
source = "carlpett/sops"
}
}
}

5 changes: 5 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
variable "resource_group_location" {
type = string
default = "northeurope"
description = "Location of the resource group."
}

0 comments on commit 8443654

Please sign in to comment.