diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl new file mode 100644 index 0000000..0e73601 --- /dev/null +++ b/.terraform.lock.hcl @@ -0,0 +1,22 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/azurerm" { + version = "3.105.0" + constraints = "3.105.0" + hashes = [ + "h1:OtWRTAMNOruOmwVB72QSGXC5IIGGQcHwEqnCCmsGbGM=", + "zh:2f81bca6a3bf3d37604bf99fdb2c77d6118520aa379ab65fd28e6b76bed399cd", + "zh:3578eb79d175af9544b0dc543124d551c0fed4c48f51773ee17e1dc62e22833a", + "zh:377dbb56caea3fa1e6a6599193b55c8594204c40c054fc2ace4f576fdfe750a2", + "zh:3d1cf01929cb213ff9a0f9753e35699bf13f60f7f0f15b38f1b216fa2cbb5f72", + "zh:481376d79224a0e4aebc6e39dee10de3cc14efd1c7c58b6d74c538e356cf4bb2", + "zh:625119aec0d24ff693c589d802b7983ffce3fcf1e9c3351396af02799dd176ca", + "zh:65981e62a6e9eb8a39dd332632617e8c929dcce6af48d3829f590f5c0f14362f", + "zh:72db82697f4e694c21defa8d0efb22f71d373676d078d71d567e8b4d9a134df7", + "zh:a0fa43cf78716ff98eccd7506b017c5c487034d9d9cce88c1accdba9314a4822", + "zh:b073f60b68b0102128815251dd895ec7f24bddec84a1b725fc0777de8a78dc7e", + "zh:b601e509eb9735756b6b7ccacc15d6333769a7bb2f8ac8c394e39b29cfc6ee55", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..1b6f7ce --- /dev/null +++ b/main.tf @@ -0,0 +1,21 @@ +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = "3.105.0" + } + } +} + +provider "azurerm" { + features {} +} + +module "resource_group_storage" { + source = "Darya-Savchenko/resource_group_storage/azurerm" + version = "1.0.0" + resource_group_name = "task6-resource-group" + storage_account_name = "task6storageaccount" + location = "West US" +} + diff --git a/modules/resource_group_storage/main.tf b/modules/resource_group_storage/main.tf new file mode 100644 index 0000000..b923e67 --- /dev/null +++ b/modules/resource_group_storage/main.tf @@ -0,0 +1,13 @@ +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 = azurerm_resource_group.example.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..d49b35d --- /dev/null +++ b/modules/resource_group_storage/outputs.tf @@ -0,0 +1,8 @@ +output "resource_group_id" { + value = azurerm_resource_group.example.id +} + +output "storage_account_id" { + value = azurerm_storage_account.example.id +} + diff --git a/modules/resource_group_storage/variables.tf b/modules/resource_group_storage/variables.tf new file mode 100644 index 0000000..b0ff601 --- /dev/null +++ b/modules/resource_group_storage/variables.tf @@ -0,0 +1,15 @@ +variable "resource_group_name" { + description = "The name of the resource group" + default = "example-resources" +} + +variable "storage_account_name" { + description = "The name of the storage account" + default = "examplestorageaccount" +} + +variable "location" { + description = "The location for all resources." + default = "East US" +} + diff --git a/tfplan b/tfplan new file mode 100644 index 0000000..655b6f8 Binary files /dev/null and b/tfplan differ