Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #15

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
16 changes: 16 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module "resource_group_storage" {
source = "yaroslavyvk/resource_group_storage/azurerm"
version = "v1.1.0"

resource_group_name = var.resource_group_name
location = var.location
storage_account_name = var.storage_account_name
}

output "resource_group_id" {
value = module.resource_group_storage.resource_group_id
}

output "storage_account_id" {
value = module.resource_group_storage.storage_account_id
}
12 changes: 12 additions & 0 deletions modules/resource_group_storage/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "azurerm_resource_group" "rg" {
name = var.resource_group_name
location = var.location
}

resource "azurerm_storage_account" "storage" {
name = var.storage_account_name
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
account_tier = var.account_tier
account_replication_type = var.replication_type
}
10 changes: 10 additions & 0 deletions modules/resource_group_storage/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
output "resource_group_id" {
description = "ID of the Azure Resource Group"
value = azurerm_resource_group.rg.id
}


output "storage_account_id" {
description = "ID of the Storage Account"
value = azurerm_storage_account.storage.id
}
26 changes: 26 additions & 0 deletions modules/resource_group_storage/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
variable "resource_group_name" {
description = "Name of the Azure Resource Group"
type = string
}

variable "location" {
description = "Azure region where resources will be created"
type = string
}

variable "storage_account_name" {
description = "Name of the Azure Storage Account"
type = string
}

variable "account_tier" {
description = "The tier of the storage account"
type = string
default = "Standard"
}

variable "replication_type" {
description = "The replication type of the storage account"
type = string
default = "LRS"
}
12 changes: 12 additions & 0 deletions provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.105.0"
}
}
}

provider "azurerm" {
features {}
}
19 changes: 19 additions & 0 deletions variable.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# variables.tf

variable "resource_group_name" {
description = "The name of the resource group to create"
type = string
default = "task6-resources"
}

variable "location" {
description = "The location where resources will be created"
type = string
default = "West Europe"
}

variable "storage_account_name" {
description = "The name of the storage account to create"
type = string
default = "task6torageacct"
}