From 629a403870a545d65cdd187467723236fbf92a49 Mon Sep 17 00:00:00 2001 From: Paul Jewell <109604867+pauljewellmsft@users.noreply.github.com> Date: Wed, 11 Oct 2023 17:09:41 -0400 Subject: [PATCH 1/4] Initial changes for AMLFS sample --- .../README.md | 32 + .../TestRecord.md | 627 ++++++++++++++++++ .../main.tf | 32 + .../outputs.tf | 0 .../providers.tf | 18 + .../variables.tf | 5 + 6 files changed, 714 insertions(+) create mode 100644 quickstart/101-managed-lustre-create-filesystem/README.md create mode 100644 quickstart/101-managed-lustre-create-filesystem/TestRecord.md create mode 100644 quickstart/101-managed-lustre-create-filesystem/main.tf create mode 100644 quickstart/101-managed-lustre-create-filesystem/outputs.tf create mode 100644 quickstart/101-managed-lustre-create-filesystem/providers.tf create mode 100644 quickstart/101-managed-lustre-create-filesystem/variables.tf diff --git a/quickstart/101-managed-lustre-create-filesystem/README.md b/quickstart/101-managed-lustre-create-filesystem/README.md new file mode 100644 index 000000000..6459be6f1 --- /dev/null +++ b/quickstart/101-managed-lustre-create-filesystem/README.md @@ -0,0 +1,32 @@ +# Managed Lustre create filesystem +This template deploys a Managed Lustre filesystem. + +## Terraform resource types +- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) + +## Variables + +| Name | Description | +|-|-| +| `resource_group_name` | Resource group name | +| `resource_group_location` | Resource group location | + +## Example terraform.tfvars file +``` +resource_group_name = "rg-amlfs-create-101" +location = "centralus" + +``` + +## Usage + +```bash +>terraform plan + + +Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + + create + +Terraform will perform the following actions: + +``` diff --git a/quickstart/101-managed-lustre-create-filesystem/TestRecord.md b/quickstart/101-managed-lustre-create-filesystem/TestRecord.md new file mode 100644 index 000000000..6611219a7 --- /dev/null +++ b/quickstart/101-managed-lustre-create-filesystem/TestRecord.md @@ -0,0 +1,627 @@ +## 08 Oct 23 02:51 UTC + +Success: true + +### Versions + +Terraform v1.5.6 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.75.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 01 Oct 23 04:13 UTC + +Success: true + +### Versions + +Terraform v1.5.6 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.75.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 24 Sep 23 02:51 UTC + +Success: true + +### Versions + +Terraform v1.5.6 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.74.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 20 Sep 23 09:04 UTC + +Success: true + +### Versions + +Terraform v1.5.6 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.73.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 17 Sep 23 02:54 UTC + +Success: true + +### Versions + +Terraform v1.5.5 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.73.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 10 Sep 23 02:56 UTC + +Success: true + +### Versions + +Terraform v1.5.4 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.72.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 03 Sep 23 04:06 UTC + +Success: true + +### Versions + +Terraform v1.5.4 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.71.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 27 Aug 23 03:35 UTC + +Success: true + +### Versions + +Terraform v1.5.4 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.71.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 20 Aug 23 04:04 UTC + +Success: true + +### Versions + +Terraform v1.5.3 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.70.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 13 Aug 23 03:59 UTC + +Success: true + +### Versions + +Terraform v1.5.2 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.69.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 06 Aug 23 04:11 UTC + +Success: true + +### Versions + +Terraform v1.5.1 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.68.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 30 Jul 23 04:06 UTC + +Success: true + +### Versions + +Terraform v1.5.1 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.67.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 16 Jul 23 03:01 UTC + +Success: true + +### Versions + +Terraform v1.5.0 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.65.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 09 Jul 23 04:00 UTC + +Success: true + +### Versions + +Terraform v1.5.0 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.64.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 02 Jul 23 04:14 UTC + +Success: true + +### Versions + +Terraform v1.5.0 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.63.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 25 Jun 23 05:25 UTC + +Success: true + +### Versions + +Terraform v1.5.0 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.62.1 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 18 Jun 23 04:11 UTC + +Success: true + +### Versions + +Terraform v1.4.6 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.61.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 11 Jun 23 04:10 UTC + +Success: true + +### Versions + +Terraform v1.4.6 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.60.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 04 Jun 23 04:27 UTC + +Success: true + +### Versions + +Terraform v1.4.6 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.59.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 28 May 23 03:49 UTC + +Success: true + +### Versions + +Terraform v1.4.5 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.58.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 21 May 23 02:54 UTC + +Success: true + +### Versions + +Terraform v1.4.5 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.57.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 14 May 23 02:50 UTC + +Success: true + +### Versions + +Terraform v1.4.5 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.56.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 07 May 23 04:04 UTC + +Success: true + +### Versions + +Terraform v1.4.5 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.55.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 30 Apr 23 03:02 UTC + +Success: true + +### Versions + +Terraform v1.4.5 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.54.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 23 Apr 23 02:53 UTC + +Success: true + +### Versions + +Terraform v1.4.4 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.53.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 16 Apr 23 04:17 UTC + +Success: true + +### Versions + +Terraform v1.4.3 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.52.0 ++ provider registry.terraform.io/hashicorp/random v3.5.1 + +### Error + + + +--- + +## 09 Apr 23 03:39 UTC + +Success: true + +### Versions + +Terraform v1.4.2 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.51.0 ++ provider registry.terraform.io/hashicorp/random v3.4.3 + +### Error + + + +--- + +## 02 Apr 23 02:40 UTC + +Success: true + +### Versions + +Terraform v1.4.1 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.50.0 ++ provider registry.terraform.io/hashicorp/random v3.4.3 + +### Error + + + +--- + +## 26 Mar 23 03:17 UTC + +Success: true + +### Versions + +Terraform v1.4.1 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.49.0 ++ provider registry.terraform.io/hashicorp/random v3.4.3 + +### Error + + + +--- + +## 19 Mar 23 02:50 UTC + +Success: true + +### Versions + +Terraform v1.4.0 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.48.0 ++ provider registry.terraform.io/hashicorp/random v3.4.3 + +### Error + + + +--- + +## 14 Mar 23 08:46 UTC + +Success: true + +### Versions + +Terraform v1.3.9 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.47.0 ++ provider registry.terraform.io/hashicorp/random v3.4.3 + +### Error + + + +--- + +## 12 Mar 23 04:36 UTC + +Success: true + +### Versions + +Terraform v1.3.8 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.47.0 ++ provider registry.terraform.io/hashicorp/random v3.4.3 + +### Error + + + +--- + +## 08 Mar 23 17:06 UTC + +Success: true + +### Versions + +Terraform v1.3.8 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.46.0 ++ provider registry.terraform.io/hashicorp/random v3.4.3 + +### Error + + + +--- + +## 19 Feb 23 01:34 UTC + +Success: true + +### Versions + +Terraform v1.3.7 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.44.1 ++ provider registry.terraform.io/hashicorp/random v3.4.3 + +### Error + + + +--- + +## 17 Feb 23 01:35 UTC + +Success: true + +### Versions + +Terraform v1.3.7 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.43.0 ++ provider registry.terraform.io/hashicorp/random v3.4.3 + +### Error + + + +--- + +## 12 Feb 23 00:48 UTC + +Success: false + +### Versions + +Terraform v1.3.7 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.43.0 + +### Error + + + +--- + +## 05 Feb 23 00:21 UTC + +Success: false + +### Versions + +Terraform v1.3.7 +on linux_amd64 ++ provider registry.terraform.io/hashicorp/azurerm v3.42.0 + +### Error + + + +--- + diff --git a/quickstart/101-managed-lustre-create-filesystem/main.tf b/quickstart/101-managed-lustre-create-filesystem/main.tf new file mode 100644 index 000000000..f61d3be21 --- /dev/null +++ b/quickstart/101-managed-lustre-create-filesystem/main.tf @@ -0,0 +1,32 @@ +resource "azurerm_resource_group" "example" { + name = "my-terraform-AMLFS-test" + location = "East US" +} + +resource "azurerm_virtual_network" "example" { + name = "my-terraform-AMLFS-vnet" + address_space = ["10.90.0.0/16"] + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name +} + +resource "azurerm_subnet" "example" { + name = "my-terraform-AMLFS-subnet" + resource_group_name = azurerm_resource_group.example.name + virtual_network_name = azurerm_virtual_network.example.name + address_prefixes = ["10.90.2.0/24"] +} + +resource "azurerm_managed_lustre_file_system" "example" { + name = "my-terraform-AMLFS-cluster" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + sku_name = "AMLFS-Durable-Premium-40" + subnet_id = azurerm_subnet.example.id + storage_capacity_in_tb = 48 + zones = ["1"] + maintenance_window { + day_of_week = "Saturday" + time_of_day_in_utc = "02:00" + } +} \ No newline at end of file diff --git a/quickstart/101-managed-lustre-create-filesystem/outputs.tf b/quickstart/101-managed-lustre-create-filesystem/outputs.tf new file mode 100644 index 000000000..e69de29bb diff --git a/quickstart/101-managed-lustre-create-filesystem/providers.tf b/quickstart/101-managed-lustre-create-filesystem/providers.tf new file mode 100644 index 000000000..dc42605e0 --- /dev/null +++ b/quickstart/101-managed-lustre-create-filesystem/providers.tf @@ -0,0 +1,18 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = ">= 3.0, < 4.0" + } + random = { + source = "hashicorp/random" + version = ">= 3.0" + } + } +} + +provider "azurerm" { + features {} +} \ No newline at end of file diff --git a/quickstart/101-managed-lustre-create-filesystem/variables.tf b/quickstart/101-managed-lustre-create-filesystem/variables.tf new file mode 100644 index 000000000..403456ed9 --- /dev/null +++ b/quickstart/101-managed-lustre-create-filesystem/variables.tf @@ -0,0 +1,5 @@ +variable "location" { + type = string + default = "eastus" + description = "Resource group location" +} \ No newline at end of file From 21c4654b2d56a3a5bb545391cbfe68b9441b1634 Mon Sep 17 00:00:00 2001 From: Paul Jewell <109604867+pauljewellmsft@users.noreply.github.com> Date: Thu, 12 Oct 2023 15:09:09 -0400 Subject: [PATCH 2/4] Add code for AMLFS resource --- .../README.md | 77 ++- .../TestRecord.md | 627 ------------------ .../main.tf | 29 +- .../outputs.tf | 19 + .../variables.tf | 32 +- 5 files changed, 133 insertions(+), 651 deletions(-) delete mode 100644 quickstart/101-managed-lustre-create-filesystem/TestRecord.md diff --git a/quickstart/101-managed-lustre-create-filesystem/README.md b/quickstart/101-managed-lustre-create-filesystem/README.md index 6459be6f1..c9993df81 100644 --- a/quickstart/101-managed-lustre-create-filesystem/README.md +++ b/quickstart/101-managed-lustre-create-filesystem/README.md @@ -2,31 +2,86 @@ This template deploys a Managed Lustre filesystem. ## Terraform resource types + - [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) +- [azurerm_virtual_network](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network) +- [azurerm_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet) +- [azurerm_managed_lustre_file_system](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/managed_lustre_file_system) ## Variables | Name | Description | |-|-| -| `resource_group_name` | Resource group name | -| `resource_group_location` | Resource group location | - -## Example terraform.tfvars file -``` -resource_group_name = "rg-amlfs-create-101" -location = "centralus" - -``` +| `rg_location` | Resource group location | +| `amlfs_sku_name` | SKU name for the Azure Managed Lustre file system | +| `amlfs_storage_capacity_in_tb` | The size of the AML file system, in TiB. This might be rounded up. | +| `amlfs_maintenance_day_of_week` | Day of the week on which the maintenance window will occur | +| `amlfs_maintenance_time_of_day` | The time of day (in UTC) to start the maintenance window | ## Usage ```bash ->terraform plan - +> terraform plan Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + create Terraform will perform the following actions: + # azurerm_managed_lustre_file_system.example will be created + + resource "azurerm_managed_lustre_file_system" "example" { + + id = (known after apply) + + location = "eastus" + + name = (known after apply) + + resource_group_name = (known after apply) + + sku_name = "AMLFS-Durable-Premium-40" + + storage_capacity_in_tb = 48 + + subnet_id = (known after apply) + + zones = [ + + "1", + ] + + + maintenance_window { + + day_of_week = "Saturday" + + time_of_day_in_utc = "02:00" + } + } + + # azurerm_resource_group.example will be created + + resource "azurerm_resource_group" "example" { + + id = (known after apply) + + location = "eastus" + + name = (known after apply) + } + + # azurerm_subnet.example will be created + + resource "azurerm_subnet" "example" { + + address_prefixes = [ + + "10.0.2.0/24", + ] + + enforce_private_link_endpoint_network_policies = (known after apply) + + enforce_private_link_service_network_policies = (known after apply) + + id = (known after apply) + + name = (known after apply) + + private_endpoint_network_policies_enabled = (known after apply) + + private_link_service_network_policies_enabled = (known after apply) + + resource_group_name = (known after apply) + + virtual_network_name = (known after apply) + } + + # azurerm_virtual_network.example will be created + + resource "azurerm_virtual_network" "example" { + + address_space = [ + + "10.0.0.0/16", + ] + + dns_servers = (known after apply) + + guid = (known after apply) + + id = (known after apply) + + location = "eastus" + + name = (known after apply) + + resource_group_name = (known after apply) + + subnet = (known after apply) + } + +Plan: 4 to add, 0 to change, 0 to destroy. ``` diff --git a/quickstart/101-managed-lustre-create-filesystem/TestRecord.md b/quickstart/101-managed-lustre-create-filesystem/TestRecord.md deleted file mode 100644 index 6611219a7..000000000 --- a/quickstart/101-managed-lustre-create-filesystem/TestRecord.md +++ /dev/null @@ -1,627 +0,0 @@ -## 08 Oct 23 02:51 UTC - -Success: true - -### Versions - -Terraform v1.5.6 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.75.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 01 Oct 23 04:13 UTC - -Success: true - -### Versions - -Terraform v1.5.6 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.75.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 24 Sep 23 02:51 UTC - -Success: true - -### Versions - -Terraform v1.5.6 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.74.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 20 Sep 23 09:04 UTC - -Success: true - -### Versions - -Terraform v1.5.6 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.73.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 17 Sep 23 02:54 UTC - -Success: true - -### Versions - -Terraform v1.5.5 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.73.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 10 Sep 23 02:56 UTC - -Success: true - -### Versions - -Terraform v1.5.4 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.72.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 03 Sep 23 04:06 UTC - -Success: true - -### Versions - -Terraform v1.5.4 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.71.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 27 Aug 23 03:35 UTC - -Success: true - -### Versions - -Terraform v1.5.4 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.71.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 20 Aug 23 04:04 UTC - -Success: true - -### Versions - -Terraform v1.5.3 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.70.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 13 Aug 23 03:59 UTC - -Success: true - -### Versions - -Terraform v1.5.2 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.69.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 06 Aug 23 04:11 UTC - -Success: true - -### Versions - -Terraform v1.5.1 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.68.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 30 Jul 23 04:06 UTC - -Success: true - -### Versions - -Terraform v1.5.1 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.67.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 16 Jul 23 03:01 UTC - -Success: true - -### Versions - -Terraform v1.5.0 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.65.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 09 Jul 23 04:00 UTC - -Success: true - -### Versions - -Terraform v1.5.0 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.64.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 02 Jul 23 04:14 UTC - -Success: true - -### Versions - -Terraform v1.5.0 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.63.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 25 Jun 23 05:25 UTC - -Success: true - -### Versions - -Terraform v1.5.0 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.62.1 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 18 Jun 23 04:11 UTC - -Success: true - -### Versions - -Terraform v1.4.6 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.61.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 11 Jun 23 04:10 UTC - -Success: true - -### Versions - -Terraform v1.4.6 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.60.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 04 Jun 23 04:27 UTC - -Success: true - -### Versions - -Terraform v1.4.6 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.59.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 28 May 23 03:49 UTC - -Success: true - -### Versions - -Terraform v1.4.5 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.58.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 21 May 23 02:54 UTC - -Success: true - -### Versions - -Terraform v1.4.5 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.57.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 14 May 23 02:50 UTC - -Success: true - -### Versions - -Terraform v1.4.5 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.56.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 07 May 23 04:04 UTC - -Success: true - -### Versions - -Terraform v1.4.5 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.55.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 30 Apr 23 03:02 UTC - -Success: true - -### Versions - -Terraform v1.4.5 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.54.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 23 Apr 23 02:53 UTC - -Success: true - -### Versions - -Terraform v1.4.4 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.53.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 16 Apr 23 04:17 UTC - -Success: true - -### Versions - -Terraform v1.4.3 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.52.0 -+ provider registry.terraform.io/hashicorp/random v3.5.1 - -### Error - - - ---- - -## 09 Apr 23 03:39 UTC - -Success: true - -### Versions - -Terraform v1.4.2 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.51.0 -+ provider registry.terraform.io/hashicorp/random v3.4.3 - -### Error - - - ---- - -## 02 Apr 23 02:40 UTC - -Success: true - -### Versions - -Terraform v1.4.1 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.50.0 -+ provider registry.terraform.io/hashicorp/random v3.4.3 - -### Error - - - ---- - -## 26 Mar 23 03:17 UTC - -Success: true - -### Versions - -Terraform v1.4.1 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.49.0 -+ provider registry.terraform.io/hashicorp/random v3.4.3 - -### Error - - - ---- - -## 19 Mar 23 02:50 UTC - -Success: true - -### Versions - -Terraform v1.4.0 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.48.0 -+ provider registry.terraform.io/hashicorp/random v3.4.3 - -### Error - - - ---- - -## 14 Mar 23 08:46 UTC - -Success: true - -### Versions - -Terraform v1.3.9 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.47.0 -+ provider registry.terraform.io/hashicorp/random v3.4.3 - -### Error - - - ---- - -## 12 Mar 23 04:36 UTC - -Success: true - -### Versions - -Terraform v1.3.8 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.47.0 -+ provider registry.terraform.io/hashicorp/random v3.4.3 - -### Error - - - ---- - -## 08 Mar 23 17:06 UTC - -Success: true - -### Versions - -Terraform v1.3.8 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.46.0 -+ provider registry.terraform.io/hashicorp/random v3.4.3 - -### Error - - - ---- - -## 19 Feb 23 01:34 UTC - -Success: true - -### Versions - -Terraform v1.3.7 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.44.1 -+ provider registry.terraform.io/hashicorp/random v3.4.3 - -### Error - - - ---- - -## 17 Feb 23 01:35 UTC - -Success: true - -### Versions - -Terraform v1.3.7 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.43.0 -+ provider registry.terraform.io/hashicorp/random v3.4.3 - -### Error - - - ---- - -## 12 Feb 23 00:48 UTC - -Success: false - -### Versions - -Terraform v1.3.7 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.43.0 - -### Error - - - ---- - -## 05 Feb 23 00:21 UTC - -Success: false - -### Versions - -Terraform v1.3.7 -on linux_amd64 -+ provider registry.terraform.io/hashicorp/azurerm v3.42.0 - -### Error - - - ---- - diff --git a/quickstart/101-managed-lustre-create-filesystem/main.tf b/quickstart/101-managed-lustre-create-filesystem/main.tf index f61d3be21..f1c92292f 100644 --- a/quickstart/101-managed-lustre-create-filesystem/main.tf +++ b/quickstart/101-managed-lustre-create-filesystem/main.tf @@ -1,32 +1,37 @@ resource "azurerm_resource_group" "example" { - name = "my-terraform-AMLFS-test" - location = "East US" + name = "${random_pet.prefix.id}-rg" + location = var.rg_location } resource "azurerm_virtual_network" "example" { - name = "my-terraform-AMLFS-vnet" - address_space = ["10.90.0.0/16"] - location = azurerm_resource_group.example.location + name = "${random_pet.prefix.id}-vnet" resource_group_name = azurerm_resource_group.example.name + address_space = ["10.0.0.0/16"] + location = azurerm_resource_group.example.location } resource "azurerm_subnet" "example" { - name = "my-terraform-AMLFS-subnet" + name = "${random_pet.prefix.id}-subnet" resource_group_name = azurerm_resource_group.example.name virtual_network_name = azurerm_virtual_network.example.name - address_prefixes = ["10.90.2.0/24"] + address_prefixes = ["10.0.2.0/24"] } resource "azurerm_managed_lustre_file_system" "example" { - name = "my-terraform-AMLFS-cluster" + name = "${random_pet.prefix.id}" resource_group_name = azurerm_resource_group.example.name location = azurerm_resource_group.example.location - sku_name = "AMLFS-Durable-Premium-40" + sku_name = var.amlfs_sku_name subnet_id = azurerm_subnet.example.id - storage_capacity_in_tb = 48 + storage_capacity_in_tb = var.amlfs_storage_capacity_in_tb zones = ["1"] maintenance_window { - day_of_week = "Saturday" - time_of_day_in_utc = "02:00" + day_of_week = var.amlfs_maintenance_day_of_week + time_of_day_in_utc = var.amlfs_maintenance_time_of_day } +} + +resource "random_pet" "prefix" { + prefix = var.prefix + length = 1 } \ No newline at end of file diff --git a/quickstart/101-managed-lustre-create-filesystem/outputs.tf b/quickstart/101-managed-lustre-create-filesystem/outputs.tf index e69de29bb..72fbfde8c 100644 --- a/quickstart/101-managed-lustre-create-filesystem/outputs.tf +++ b/quickstart/101-managed-lustre-create-filesystem/outputs.tf @@ -0,0 +1,19 @@ +output "virtual_network_name" { + value = azurerm_virtual_network.example.name +} + +output "subnet_name" { + value = azurerm_subnet.example.name +} + +output "azurerm_managed_lustre_file_system" { + value = azurerm_managed_lustre_file_system.example.name +} + +output "amlfs_sku_name" { + value = azurerm_managed_lustre_file_system.example.sku_name +} + +output "amlfs_storage_capacity_in_tb" { + value = azurerm_managed_lustre_file_system.example.storage_capacity_in_tb +} \ No newline at end of file diff --git a/quickstart/101-managed-lustre-create-filesystem/variables.tf b/quickstart/101-managed-lustre-create-filesystem/variables.tf index 403456ed9..094fb1a2b 100644 --- a/quickstart/101-managed-lustre-create-filesystem/variables.tf +++ b/quickstart/101-managed-lustre-create-filesystem/variables.tf @@ -1,5 +1,35 @@ -variable "location" { +variable "prefix" { + type = string + default = "managed-lustre-file-system" + description = "Prefix of the resource name" +} + +variable "rg_location" { type = string default = "eastus" description = "Resource group location" +} + +variable "amlfs_sku_name" { + type = string + default = "AMLFS-Durable-Premium-40" + description = "SKU name for the Azure Managed Lustre file system" +} + +variable "amlfs_storage_capacity_in_tb" { + type = number + default = 48 + description = "The size of the Managed Lustre file system, in TiB. This might be rounded up." +} + +variable "amlfs_maintenance_day_of_week" { + type = string + default = "Saturday" + description = "Day of the week on which the maintenance window will occur" +} + +variable "amlfs_maintenance_time_of_day" { + type = string + default = "02:00" + description = "The time of day (in UTC) to start the maintenance window" } \ No newline at end of file From 60bba8f8af8de829d03d0f25fc787193bf5e3337 Mon Sep 17 00:00:00 2001 From: Paul Jewell <109604867+pauljewellmsft@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:12:22 -0400 Subject: [PATCH 3/4] Incorporate review feedback --- .../README.md | 96 ++++--------------- .../main.tf | 55 +++++++---- .../outputs.tf | 4 + .../providers.tf | 4 +- .../variables.tf | 42 ++++++-- 5 files changed, 98 insertions(+), 103 deletions(-) diff --git a/quickstart/101-managed-lustre-create-filesystem/README.md b/quickstart/101-managed-lustre-create-filesystem/README.md index c9993df81..c263a31ac 100644 --- a/quickstart/101-managed-lustre-create-filesystem/README.md +++ b/quickstart/101-managed-lustre-create-filesystem/README.md @@ -1,5 +1,5 @@ -# Managed Lustre create filesystem -This template deploys a Managed Lustre filesystem. +# Azure Managed Lustre +This template deploys an Azure Managed Lustre file system. ## Terraform resource types @@ -7,81 +7,23 @@ This template deploys a Managed Lustre filesystem. - [azurerm_virtual_network](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network) - [azurerm_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet) - [azurerm_managed_lustre_file_system](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/managed_lustre_file_system) +- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) +- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) ## Variables -| Name | Description | -|-|-| -| `rg_location` | Resource group location | -| `amlfs_sku_name` | SKU name for the Azure Managed Lustre file system | -| `amlfs_storage_capacity_in_tb` | The size of the AML file system, in TiB. This might be rounded up. | -| `amlfs_maintenance_day_of_week` | Day of the week on which the maintenance window will occur | -| `amlfs_maintenance_time_of_day` | The time of day (in UTC) to start the maintenance window | - -## Usage - -```bash -> terraform plan - -Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: - + create - -Terraform will perform the following actions: - - # azurerm_managed_lustre_file_system.example will be created - + resource "azurerm_managed_lustre_file_system" "example" { - + id = (known after apply) - + location = "eastus" - + name = (known after apply) - + resource_group_name = (known after apply) - + sku_name = "AMLFS-Durable-Premium-40" - + storage_capacity_in_tb = 48 - + subnet_id = (known after apply) - + zones = [ - + "1", - ] - - + maintenance_window { - + day_of_week = "Saturday" - + time_of_day_in_utc = "02:00" - } - } - - # azurerm_resource_group.example will be created - + resource "azurerm_resource_group" "example" { - + id = (known after apply) - + location = "eastus" - + name = (known after apply) - } - - # azurerm_subnet.example will be created - + resource "azurerm_subnet" "example" { - + address_prefixes = [ - + "10.0.2.0/24", - ] - + enforce_private_link_endpoint_network_policies = (known after apply) - + enforce_private_link_service_network_policies = (known after apply) - + id = (known after apply) - + name = (known after apply) - + private_endpoint_network_policies_enabled = (known after apply) - + private_link_service_network_policies_enabled = (known after apply) - + resource_group_name = (known after apply) - + virtual_network_name = (known after apply) - } - - # azurerm_virtual_network.example will be created - + resource "azurerm_virtual_network" "example" { - + address_space = [ - + "10.0.0.0/16", - ] - + dns_servers = (known after apply) - + guid = (known after apply) - + id = (known after apply) - + location = "eastus" - + name = (known after apply) - + resource_group_name = (known after apply) - + subnet = (known after apply) - } - -Plan: 4 to add, 0 to change, 0 to destroy. -``` +| Name | Description | Default value | +|-|-|-| +| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg | +| `resource_group_location` | Location of the resource group. | eastus | +| `virtual_network_name` | Name of the virtual network resource. | "" | +| `subnet_name` | Name of the virtual network subnet. | "" | +| `amlfs_name` | Name of the Managed Lustre file system resource. | "" | +| `amlfs_sku_name` | SKU name for the Azure Managed Lustre file system. Possible values are: AMLFS-Durable-Premium-40, AMLFS-Durable-Premium-125, AMLFS-Durable-Premium-250, and AMLFS-Durable-Premium-500. | AMLFS-Durable-Premium-40 | +| `amlfs_storage_capacity_in_tb` | The size of the AML file system, in TiB. This might be rounded up. | 48 | +| `amlfs_maintenance_day_of_week` | Day of the week on which the maintenance window will occur. Possible values are: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday. | Saturday | +| `amlfs_maintenance_time_of_day` | The time of day (in UTC) to start the maintenance window. | 02:00 | + +## Example + +To see how to run this example, see [Create an Azure Managed Lustre file system using Terraform](https://learn.microsoft.com/azure/azure-managed-lustre/create-aml-file-system-terraform). diff --git a/quickstart/101-managed-lustre-create-filesystem/main.tf b/quickstart/101-managed-lustre-create-filesystem/main.tf index f1c92292f..4a489f6cd 100644 --- a/quickstart/101-managed-lustre-create-filesystem/main.tf +++ b/quickstart/101-managed-lustre-create-filesystem/main.tf @@ -1,26 +1,54 @@ -resource "azurerm_resource_group" "example" { - name = "${random_pet.prefix.id}-rg" - location = var.rg_location +resource "random_pet" "rg_name" { + prefix = var.resource_group_name_prefix +} + +resource "azurerm_resource_group" "rg" { + name = "${random_pet.rg_name.id}" + location = var.resource_group_location +} + +resource "random_string" "azurerm_virtual_network_name" { + length = 13 + lower = true + numeric = false + special = false + upper = false } resource "azurerm_virtual_network" "example" { - name = "${random_pet.prefix.id}-vnet" - resource_group_name = azurerm_resource_group.example.name + name = coalesce(var.virtual_network_name, "vnet-${random_string.azurerm_virtual_network_name.result}") + resource_group_name = azurerm_resource_group.rg.name address_space = ["10.0.0.0/16"] - location = azurerm_resource_group.example.location + location = azurerm_resource_group.rg.location +} + +resource "random_string" "azurerm_subnet_name" { + length = 13 + lower = true + numeric = false + special = false + upper = false } resource "azurerm_subnet" "example" { - name = "${random_pet.prefix.id}-subnet" - resource_group_name = azurerm_resource_group.example.name + name = coalesce(var.subnet_name, "subnet-${random_string.azurerm_subnet_name.result}") + resource_group_name = azurerm_resource_group.rg.name virtual_network_name = azurerm_virtual_network.example.name address_prefixes = ["10.0.2.0/24"] } +resource "random_string" "azurerm_amlfs_name" { + length = 13 + lower = true + numeric = false + special = false + upper = false +} + resource "azurerm_managed_lustre_file_system" "example" { - name = "${random_pet.prefix.id}" - resource_group_name = azurerm_resource_group.example.name - location = azurerm_resource_group.example.location + name = coalesce(var.amlfs_name, "amlfs-${random_string.azurerm_amlfs_name.result}") + resource_group_name = azurerm_resource_group.rg.name + location = azurerm_resource_group.rg.location sku_name = var.amlfs_sku_name subnet_id = azurerm_subnet.example.id storage_capacity_in_tb = var.amlfs_storage_capacity_in_tb @@ -29,9 +57,4 @@ resource "azurerm_managed_lustre_file_system" "example" { day_of_week = var.amlfs_maintenance_day_of_week time_of_day_in_utc = var.amlfs_maintenance_time_of_day } -} - -resource "random_pet" "prefix" { - prefix = var.prefix - length = 1 } \ No newline at end of file diff --git a/quickstart/101-managed-lustre-create-filesystem/outputs.tf b/quickstart/101-managed-lustre-create-filesystem/outputs.tf index 72fbfde8c..1cd82c264 100644 --- a/quickstart/101-managed-lustre-create-filesystem/outputs.tf +++ b/quickstart/101-managed-lustre-create-filesystem/outputs.tf @@ -1,3 +1,7 @@ +output "resource_group_name" { + value = azurerm_resource_group.example.name +} + output "virtual_network_name" { value = azurerm_virtual_network.example.name } diff --git a/quickstart/101-managed-lustre-create-filesystem/providers.tf b/quickstart/101-managed-lustre-create-filesystem/providers.tf index dc42605e0..c5b792a95 100644 --- a/quickstart/101-managed-lustre-create-filesystem/providers.tf +++ b/quickstart/101-managed-lustre-create-filesystem/providers.tf @@ -4,11 +4,11 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = ">= 3.0, < 4.0" + version = "~> 3.0, < 4.0" } random = { source = "hashicorp/random" - version = ">= 3.0" + version = "~> 3.0" } } } diff --git a/quickstart/101-managed-lustre-create-filesystem/variables.tf b/quickstart/101-managed-lustre-create-filesystem/variables.tf index 094fb1a2b..27dbf0770 100644 --- a/quickstart/101-managed-lustre-create-filesystem/variables.tf +++ b/quickstart/101-managed-lustre-create-filesystem/variables.tf @@ -1,19 +1,41 @@ -variable "prefix" { +variable "resource_group_name_prefix" { type = string - default = "managed-lustre-file-system" - description = "Prefix of the resource name" + default = "rg" + description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription." } -variable "rg_location" { +variable "resource_group_location" { type = string default = "eastus" - description = "Resource group location" + description = "Location of the resource group." +} + +variable "virtual_network_name" { + type = string + description = "The name of the virtual network resource. The value will be randomly generated if blank." + default = "" +} + +variable "subnet_name" { + type = string + description = "The name of the virtual network subnet. The value will be randomly generated if blank." + default = "" +} + +variable "amlfs_name" { + type = string + description = "The name of the Manage Lustre file system resource. The value will be randomly generated if blank." + default = "" } variable "amlfs_sku_name" { type = string default = "AMLFS-Durable-Premium-40" - description = "SKU name for the Azure Managed Lustre file system" + validation { + condition = contains(["AMLFS-Durable-Premium-40", "AMLFS-Durable-Premium-125", "AMLFS-Durable-Premium-250", "AMLFS-Durable-Premium-500"], var.amlfs_sku_name) + error_message = "The SKU value must be one of the following: AMLFS-Durable-Premium-40, AMLFS-Durable-Premium-125, AMLFS-Durable-Premium-250, AMLFS-Durable-Premium-500." + } + description = "SKU name for the Azure Managed Lustre file system." } variable "amlfs_storage_capacity_in_tb" { @@ -25,11 +47,15 @@ variable "amlfs_storage_capacity_in_tb" { variable "amlfs_maintenance_day_of_week" { type = string default = "Saturday" - description = "Day of the week on which the maintenance window will occur" + validation { + condition = contains(["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], var.amlfs_maintenance_day_of_week) + error_message = "The maintenance day of week value must be one of the following: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday." + } + description = "Day of the week on which the maintenance window will occur." } variable "amlfs_maintenance_time_of_day" { type = string default = "02:00" - description = "The time of day (in UTC) to start the maintenance window" + description = "The time of day (in UTC) to start the maintenance window." } \ No newline at end of file From 6330a303c718df50f1e836efc142471ae5fa22ee Mon Sep 17 00:00:00 2001 From: Paul Jewell <109604867+pauljewellmsft@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:18:45 -0400 Subject: [PATCH 4/4] Update outputs.tf --- quickstart/101-managed-lustre-create-filesystem/outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstart/101-managed-lustre-create-filesystem/outputs.tf b/quickstart/101-managed-lustre-create-filesystem/outputs.tf index 1cd82c264..e33b46bca 100644 --- a/quickstart/101-managed-lustre-create-filesystem/outputs.tf +++ b/quickstart/101-managed-lustre-create-filesystem/outputs.tf @@ -1,5 +1,5 @@ output "resource_group_name" { - value = azurerm_resource_group.example.name + value = azurerm_resource_group.rg.name } output "virtual_network_name" {