Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: examples don't work with Azure provider v4 #237

Merged
merged 4 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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