Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Add resource group
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu-benoit authored Mar 1, 2024
1 parent b58e9e3 commit 32be525
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
11 changes: 11 additions & 0 deletions resources/terraform/resource-group/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "random_string" "rg_name" {
length = 8
special = false
lower = true
upper = false
}

resource "azurerm_resource_group" "rg" {
name = random_string.rg_name.result
location = "West Europe"
}
3 changes: 3 additions & 0 deletions resources/terraform/resource-group/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "rg_name" {
value = azurerm_resource_group.rg.name
}
20 changes: 20 additions & 0 deletions resources/terraform/resource-group/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
}

random = {
source = "hashicorp/random"
}
}
}

provider "azurerm" {
features {}
subscription_id = var.azure_subscription_id
tenant_id = var.azure_tenant_id
client_id = var.service_principal_id
client_secret = var.service_principal_password
skip_provider_registration = true
}
22 changes: 22 additions & 0 deletions resources/terraform/resource-group/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
variable "azure_subscription_id" {
type = string
}

variable "azure_tenant_id" {
type = string
}

variable "service_principal_id" {
type = string
sensitive = true
}

variable "service_principal_password" {
type = string
sensitive = true
}

variable "location" {
type = string
default = "eastus"
}

0 comments on commit 32be525

Please sign in to comment.