Skip to content

Commit

Permalink
Merge pull request #1 from cth-usq/develop
Browse files Browse the repository at this point in the history
Solution
  • Loading branch information
cth-usq authored Sep 24, 2024
2 parents 00c3f51 + 741ae35 commit 8682f20
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Local .terraform directories & files
**/.terraform/*
*terraform
.terraform*

# .tfstate files
*.tfstate
*.tfstate.*

# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Ignore CLI configuration files
.terraformrc
terraform.rc

# Ignore for zip files
*.zip

index.html
28 changes: 28 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0"
}
}
}

provider "azurerm" {
features {}
}

output "resource_group_id" {
value = module.resource_group_storage.resource_group_id
}

output "storage_account_id" {
value = module.resource_group_storage.storage_account_id
}

module "resource_group_storage" {
source = "cth-usq/resource_group_storage/azurerm"
version = "1.0.1"
resource_group_name = "my-resource-group"
location = "East US"
storage_account_name = "mystorageaccount771"
}
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" "rg" {
name = var.resource_group_name
location = var.location
}

resource "azurerm_storage_account" "sa" {
name = var.storage_account_name
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
account_tier = "Standard"
account_replication_type = "LRS"
}
9 changes: 9 additions & 0 deletions modules/resource_group_storage/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
output "resource_group_id" {
value = azurerm_resource_group.rg.id
description = "The ID of the resource group"
}

output "storage_account_id" {
value = azurerm_storage_account.sa.id
description = "The ID of the storage account"
}
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" {
type = string
description = "Name of the resource group"
}

variable "location" {
type = string
description = "Azure region where resources will be created"
default = "West Europe"
}

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

0 comments on commit 8682f20

Please sign in to comment.