Skip to content

Commit

Permalink
fix: examples don't work with Azure provider v4 (#237)
Browse files Browse the repository at this point in the history
* fix: examples don't work with Azure provider v4

* docs: add prereqs

* docs: set syntax highlighting

* docs
  • Loading branch information
hknutsen authored Oct 31, 2024
1 parent 65fd832 commit e26cbdf
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 31 deletions.
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SUBSCRIPTION_NAME_OR_ID>
```

1. Set environment variables:

```console
export TF_VAR_resource_group_name=<RESOURCE_GROUP_NAME>
export TF_VAR_location=<LOCATION>
```bash
export ARM_SUBSCRIPTION_ID="<SUBSCRIPTION_ID>"
export TF_VAR_resource_group_name="<RESOURCE_GROUP_NAME>"
export TF_VAR_location="<LOCATION>"
```

## Testing

1. Initialize working directory:

```console
```bash
terraform init
```

1. Execute tests:

```console
```bash
terraform test
```

Expand Down
3 changes: 1 addition & 2 deletions examples/premium-block-blob-storage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions examples/premium-data-lake-storage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions examples/premium-file-storage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions examples/premium-gpv2-storage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions examples/standard-blob-storage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions examples/standard-data-lake-storage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions examples/standard-gpv2-storage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e26cbdf

Please sign in to comment.