diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..83b491c --- /dev/null +++ b/main.tf @@ -0,0 +1,7 @@ +module "resource_group_storage" { + source = "github.com/ILyakhova/terraform-azurerm-resource_group_storage" + + resource_group_name = "example-rg" + location = "East US" + storage_account_name = "examplestorage" +} diff --git a/modules/resource_group_storage/main.tf b/modules/resource_group_storage/main.tf new file mode 100644 index 0000000..7335815 --- /dev/null +++ b/modules/resource_group_storage/main.tf @@ -0,0 +1,12 @@ +resource "azurerm_resource_group" "task6" { + name = var.resource_group_name + location = var.location +} + +resource "azurerm_storage_account" "task6" { + name = var.storage_account_name + resource_group_name = azurerm_resource_group.task6.name + location = azurerm_resource_group.task6.location + account_tier = "Standard" + account_replication_type = "LRS" +} diff --git a/modules/resource_group_storage/outputs.tf b/modules/resource_group_storage/outputs.tf new file mode 100644 index 0000000..3d38260 --- /dev/null +++ b/modules/resource_group_storage/outputs.tf @@ -0,0 +1,7 @@ +output "resource_group_name" { + value = azurerm_resource_group.task6.name +} + +output "storage_account_name" { + value = azurerm_storage_account.task6.name +} diff --git a/modules/resource_group_storage/variables.tf b/modules/resource_group_storage/variables.tf new file mode 100644 index 0000000..58aa9ef --- /dev/null +++ b/modules/resource_group_storage/variables.tf @@ -0,0 +1,17 @@ +variable "resource_group_name" { + description = "Resource group name" + type = string + default = "task6" +} + +variable "location" { + description = "Resource group location" + type = string + default = "East US" +} + +variable "storage_account_name" { + description = "Storage account name" + type = string + default = "task6-storage-account" +}