From eb242132cc592d29a6feaf4ab82f3647d1f4df17 Mon Sep 17 00:00:00 2001 From: ionmariana531 Date: Mon, 25 Nov 2024 17:40:02 +0000 Subject: [PATCH] Add Azure provider setup with basic resources. Closes #14 --- terraform/azure/main.tf | 25 +++++++++++++++++++++++++ terraform/azure/providers/azure.tf | 13 +++++++++++++ terraform/azure/variables/azure.tf | 18 ++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 terraform/azure/main.tf create mode 100644 terraform/azure/providers/azure.tf create mode 100644 terraform/azure/variables/azure.tf diff --git a/terraform/azure/main.tf b/terraform/azure/main.tf new file mode 100644 index 0000000..92b221a --- /dev/null +++ b/terraform/azure/main.tf @@ -0,0 +1,25 @@ +resource "azurerm_resource_group" "main" { + name = "rg-${var.project}-${var.environment}" + location = var.location + + tags = { + Environment = var.environment + Project = var.project + ManagedBy = "terraform" + } +} + +resource "azurerm_storage_account" "main" { + name = "st${var.project}${var.environment}" + resource_group_name = azurerm_resource_group.main.name + location = azurerm_resource_group.main.location + account_tier = "Standard" + account_replication_type = "LRS" + + tags = { + Environment = var.environment + Project = var.project + ManagedBy = "terraform" + } +} + diff --git a/terraform/azure/providers/azure.tf b/terraform/azure/providers/azure.tf new file mode 100644 index 0000000..1fff892 --- /dev/null +++ b/terraform/azure/providers/azure.tf @@ -0,0 +1,13 @@ +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = "~> 3.0" + } + } +} + +provider "azurerm" { + features {} +} + diff --git a/terraform/azure/variables/azure.tf b/terraform/azure/variables/azure.tf new file mode 100644 index 0000000..9e546a1 --- /dev/null +++ b/terraform/azure/variables/azure.tf @@ -0,0 +1,18 @@ +variable "location" { + description = "Azure region for resources" + type = string + default = "West Europe" +} + +variable "environment" { + description = "Environment name" + type = string + default = "dev" +} + +variable "project" { + description = "Project name" + type = string + default = "devops-tools" +} +