Skip to content

Commit

Permalink
Soution
Browse files Browse the repository at this point in the history
  • Loading branch information
Serveladik committed Sep 17, 2024
1 parent 00c3f51 commit 3ef1c77
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.terraform/
terraform.tfstate
terraform.tfstate.backup
*.tfvars
.terraform.lock*
12 changes: 12 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
provider "azurerm" {
features {}
subscription_id = "d345fa5d-4fda-4d1e-abf1-c8a7e4fb0576"
tenant_id = "e84abfc3-c8c5-4892-8f6d-942a64e5bfc4"
}

module "resource_group_storage" {
source = "./modules/resource_group_storage"
resource_group_name = var.resource_group_name
location = var.location
storage_account_name = var.storage_account_name
}
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" "example" {
name = var.resource_group_name
location = var.location
}

resource "azurerm_storage_account" "example" {
name = var.storage_account_name
resource_group_name = azurerm_resource_group.example.name
location = var.location
account_tier = "Standard"
account_replication_type = "LRS"
}
3 changes: 3 additions & 0 deletions modules/resource_group_storage/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "resource_group_name" {
value = azurerm_resource_group.example.name
}
14 changes: 14 additions & 0 deletions modules/resource_group_storage/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
variable "resource_group_name" {
type = string
default = "default-resource-group"
}

variable "location" {
type = string
default = "Poland Central"
}

variable "storage_account_name" {
type = string
default = "defaultstorageaccount"
}
3 changes: 3 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "resource_group_name" {
value = module.resource_group_storage.resource_group_name
}
11 changes: 11 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "resource_group_name" {
type = string
}

variable "storage_account_name" {
type = string
}

variable "location" {
type = string
}

0 comments on commit 3ef1c77

Please sign in to comment.