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

Soution #11

Open
wants to merge 7 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
2 changes: 1 addition & 1 deletion .github/workflows/terraform-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
exit 1
fi
echo "outputs.tf is present in module 'resource_group_storage'."

- name: Terraform Fmt
run: terraform fmt -check -recursive -diff

Expand Down
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
}