From e26cbdfde30daa9d1e1b3cd832b2ffaefcd0c3be Mon Sep 17 00:00:00 2001 From: Henrik Simonsen Knutsen <46495473+hknutsen@users.noreply.github.com> Date: Thu, 31 Oct 2024 07:39:29 +0100 Subject: [PATCH] fix: examples don't work with Azure provider v4 (#237) * fix: examples don't work with Azure provider v4 * docs: add prereqs * docs: set syntax highlighting * docs --- README.md | 28 ++++++++------------- examples/premium-block-blob-storage/main.tf | 3 +-- examples/premium-data-lake-storage/main.tf | 3 +-- examples/premium-file-storage/main.tf | 3 +-- examples/premium-gpv2-storage/main.tf | 3 +-- examples/standard-blob-storage/main.tf | 3 +-- examples/standard-data-lake-storage/main.tf | 3 +-- examples/standard-gpv2-storage/main.tf | 3 +-- 8 files changed, 18 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index df9717a..81f325e 100644 --- a/README.md +++ b/README.md @@ -16,44 +16,38 @@ Terraform module which creates an Azure Storage account. - File soft-delete retention set to 7 days by default. - Audit logs sent to given Log Analytics workspace by default. -## Development +## Prerequisites -1. Clone this repository: +- Install [Terraform](https://developer.hashicorp.com/terraform/install) **version 1.0 or higher**. +- Install [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli). - ```console - git clone https://github.com/equinor/terraform-azurerm-storage.git - ``` +## Development 1. Login to Azure: - ```console + ```bash az login ``` -1. Set active subscription: - - ```console - az account set -s - ``` - 1. Set environment variables: - ```console - export TF_VAR_resource_group_name= - export TF_VAR_location= + ```bash + export ARM_SUBSCRIPTION_ID="" + export TF_VAR_resource_group_name="" + export TF_VAR_location="" ``` ## Testing 1. Initialize working directory: - ```console + ```bash terraform init ``` 1. Execute tests: - ```console + ```bash terraform test ``` diff --git a/examples/premium-block-blob-storage/main.tf b/examples/premium-block-blob-storage/main.tf index 41b19df..8ddebf4 100644 --- a/examples/premium-block-blob-storage/main.tf +++ b/examples/premium-block-blob-storage/main.tf @@ -18,8 +18,7 @@ module "log_analytics" { } module "storage" { - source = "equinor/storage/azurerm" - version = "12.4.0" + source = "../.." account_name = "st${random_id.this.hex}" resource_group_name = var.resource_group_name diff --git a/examples/premium-data-lake-storage/main.tf b/examples/premium-data-lake-storage/main.tf index da69ef7..83a2613 100644 --- a/examples/premium-data-lake-storage/main.tf +++ b/examples/premium-data-lake-storage/main.tf @@ -18,8 +18,7 @@ module "log_analytics" { } module "storage" { - source = "equinor/storage/azurerm" - version = "12.4.0" + source = "../.." account_name = "st${random_id.this.hex}" resource_group_name = var.resource_group_name diff --git a/examples/premium-file-storage/main.tf b/examples/premium-file-storage/main.tf index 7ba4e1e..73b48ea 100644 --- a/examples/premium-file-storage/main.tf +++ b/examples/premium-file-storage/main.tf @@ -18,8 +18,7 @@ module "log_analytics" { } module "storage" { - source = "equinor/storage/azurerm" - version = "12.4.0" + source = "../.." account_name = "st${random_id.this.hex}" resource_group_name = var.resource_group_name diff --git a/examples/premium-gpv2-storage/main.tf b/examples/premium-gpv2-storage/main.tf index c038ec7..aa5e5f7 100644 --- a/examples/premium-gpv2-storage/main.tf +++ b/examples/premium-gpv2-storage/main.tf @@ -18,8 +18,7 @@ module "log_analytics" { } module "storage" { - source = "equinor/storage/azurerm" - version = "12.4.0" + source = "../.." account_name = "st${random_id.this.hex}" resource_group_name = var.resource_group_name diff --git a/examples/standard-blob-storage/main.tf b/examples/standard-blob-storage/main.tf index 8722fbc..d2141a7 100644 --- a/examples/standard-blob-storage/main.tf +++ b/examples/standard-blob-storage/main.tf @@ -18,8 +18,7 @@ module "log_analytics" { } module "storage" { - source = "equinor/storage/azurerm" - version = "12.4.0" + source = "../.." account_name = "st${random_id.this.hex}" resource_group_name = var.resource_group_name diff --git a/examples/standard-data-lake-storage/main.tf b/examples/standard-data-lake-storage/main.tf index 2ee4c29..15aff0a 100644 --- a/examples/standard-data-lake-storage/main.tf +++ b/examples/standard-data-lake-storage/main.tf @@ -18,8 +18,7 @@ module "log_analytics" { } module "storage" { - source = "equinor/storage/azurerm" - version = "12.4.0" + source = "../.." account_name = "st${random_id.this.hex}" resource_group_name = var.resource_group_name diff --git a/examples/standard-gpv2-storage/main.tf b/examples/standard-gpv2-storage/main.tf index 125d5f1..245086d 100644 --- a/examples/standard-gpv2-storage/main.tf +++ b/examples/standard-gpv2-storage/main.tf @@ -18,8 +18,7 @@ module "log_analytics" { } module "storage" { - source = "equinor/storage/azurerm" - version = "12.4.0" + source = "../.." account_name = "st${random_id.this.hex}" resource_group_name = var.resource_group_name