Skip to content

Instantly share code, notes, and snippets.

View weeyin83's full-sized avatar

Sarah Lean weeyin83

View GitHub Profile
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: AzureCLI@2
name: RunTerraform
inputs:
azureSubscription: INSERT NAME OF YOUR SERVICE CONNECTION # The name of your service connection goes here
scriptType: bash
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=4.14.0"
}
}
}
provider "azurerm" {
features {}
module "avm-res-azurestackhci-cluster" {
  source  = "Azure/avm-res-azurestackhci-cluster/azurerm"
  version = "0.12.0"
module "storage_account" {
  source = "./modules/storage-account"
  storage_account_name = "mystorageaccount"
  resource_group_name  = "my-resource-group"
  location             = "East US"
  account_tier         = "Standard"
  account_replication_type = "LRS"
  tags                 = {
    environment = "dev"
    project     = "example-project"
output "storage_account_name" {
  value = azurerm_storage_account.example.name
}
output "primary_blob_endpoint" {
  value = azurerm_storage_account.example.primary_blob_endpoint
}
variable "storage_account_name" {
  description = "The name of the storage account."
  type        = string
}
variable "resource_group_name" {
  description = "The name of the resource group."
  type        = string
}
variable "location" {
  description = "The Azure region where the storage account will be created."
resource "azurerm_storage_account" "example" {
  name                     = var.storage_account_name
  resource_group_name      = var.resource_group_name
  location                 = var.location
  account_tier             = var.account_tier
  account_replication_type = var.account_replication_type
  tags = var.tags
}
name: Terraform deploy Log Analytics with TFLint checks
on:
workflow_dispatch:
jobs:
terraform:
runs-on: ubuntu-latest
env:
@weeyin83
weeyin83 / .tflint.hcl
Created December 16, 2024 15:14
tflint file
plugin "azurerm" {
enabled = true
version = "0.27.0"
source = "github.com/terraform-linters/tflint-ruleset-azurerm"
}
# General Terraform rules
rule "terraform_deprecated_interpolation" {
enabled = true
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
version = "2.1.0"
}
}
}
provider "azapi" {