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 #9

Open
wants to merge 6 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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/.terraform/*
./terraform/*
*.tfstate
*.tfstate.*
*.zip

21 changes: 21 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ To complete this task, Terraform and Azure CLI must be installed and configured
- Initialize and apply the configuration to verify that the module is used correctly.

**6. Pull request's description should also contain a reference to a successful workflow run**




```
https://registry.terraform.io/modules/SHCHERBANV/resource_group_storage/azurerm/latest
```
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module "resource_group_storage" {
source = "./modules/resource_group_storage"

resource_group_name = "task6"
location = "westus"
storage_account_name = "vr88"
}
16 changes: 16 additions & 0 deletions modules/resource_group_storage/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
provider "azurerm" {
features {}
}

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"
}
7 changes: 7 additions & 0 deletions modules/resource_group_storage/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output "resource_group_name" {
value = azurerm_resource_group.example.name
}

output "storage_account_name" {
value = azurerm_storage_account.example.name
}
15 changes: 15 additions & 0 deletions modules/resource_group_storage/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
variable "resource_group_name" {
description = "The name of the resource group"
type = string
}

variable "location" {
description = "The location/region where the resource group will be created"
type = string
default = "West Europe" # You can set a default or override it via tfvars or command line
}

variable "storage_account_name" {
description = "The name of the storage account"
type = string
}
Binary file added tfplan
Binary file not shown.