Skip to content

Commit 89477e4

Browse files
committed
azure ml infra
1 parent 55a251b commit 89477e4

File tree

8 files changed

+160
-1
lines changed

8 files changed

+160
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ crash.*.log
1313
# password, private keys, and other secrets. These should not be part of version
1414
# control as they are data points which are potentially sensitive and subject
1515
# to change depending on the environment.
16-
*.tfvars
1716
*.tfvars.json
1817

1918
# Ignore override files as they are usually used to override resources locally and so

infrastructure/azMachineLearning/src/.terraform.lock.hcl

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
data "azurerm_client_config" "current" {}
2+
3+
resource "azurerm_resource_group" "example" {
4+
name = "RGbrownML"
5+
location = "East US 2"
6+
}
7+
8+
resource "azurerm_application_insights" "example" {
9+
name = "wwsbrownai"
10+
location = azurerm_resource_group.example.location
11+
resource_group_name = azurerm_resource_group.example.name
12+
application_type = "web"
13+
}
14+
15+
resource "azurerm_key_vault" "example" {
16+
name = "wsbrownkeyvault"
17+
location = azurerm_resource_group.example.location
18+
resource_group_name = azurerm_resource_group.example.name
19+
tenant_id = data.azurerm_client_config.current.tenant_id
20+
sku_name = "premium"
21+
}
22+
23+
resource "azurerm_storage_account" "example" {
24+
name = "wsbrownsa"
25+
location = azurerm_resource_group.example.location
26+
resource_group_name = azurerm_resource_group.example.name
27+
account_tier = "Standard"
28+
account_replication_type = "GRS"
29+
}
30+
31+
resource "azurerm_machine_learning_workspace" "example" {
32+
name = "wsbrownml"
33+
location = azurerm_resource_group.example.location
34+
resource_group_name = azurerm_resource_group.example.name
35+
application_insights_id = azurerm_application_insights.example.id
36+
key_vault_id = azurerm_key_vault.example.id
37+
storage_account_id = azurerm_storage_account.example.id
38+
39+
identity {
40+
type = "SystemAssigned"
41+
}
42+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
resource "azurerm_storage_account" "ml_storage" {
2+
name = "mlstorageacct123"
3+
resource_group_name = azurerm_resource_group.ml_rg.name
4+
location = azurerm_resource_group.ml_rg.location
5+
account_tier = "Standard"
6+
account_replication_type = "LRS"
7+
}
8+
9+
resource "azurerm_storage_container" "ml_container" {
10+
name = "ml-artifacts"
11+
container_access_type = "private"
12+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
output "client_config" {
2+
value = {
3+
client_id = data.azurerm_client_config.current.client_id
4+
tenant_id = data.azurerm_client_config.current.tenant_id
5+
subscription_id = data.azurerm_client_config.current.subscription_id
6+
}
7+
}
8+
9+
output "resource_group_name" {
10+
value = azurerm_resource_group.example.name
11+
}
12+
13+
output "application_insights_id" {
14+
value = azurerm_application_insights.example.id
15+
}
16+
17+
output "key_vault_id" {
18+
value = azurerm_key_vault.example.id
19+
}
20+
21+
output "storage_account_id" {
22+
value = azurerm_storage_account.example.id
23+
}
24+
25+
output "ml_workspace_id" {
26+
value = azurerm_machine_learning_workspace.example.id
27+
}
28+
29+
output "ml_workspace_name" {
30+
value = azurerm_machine_learning_workspace.example.name
31+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# provider.tf
2+
# This file configures the Azure provider to interact with Azure resources.
3+
# It specifies the required provider and its version, along with provider-specific configurations.
4+
5+
terraform {
6+
required_version = ">= 1.8, < 2.0"
7+
# Specify the required provider and its version
8+
required_providers {
9+
azurerm = {
10+
source = "hashicorp/azurerm" # Source of the AzureRM provider
11+
version = "~> 4.16.0" # Version of the AzureRM provider
12+
}
13+
}
14+
}
15+
16+
provider "azurerm" {
17+
features {} # Enable all features for the AzureRM provider
18+
subscription_id = var.subscription_id # Add your subscription ID here
19+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
resource_group_name = "ml-platform-rg"
2+
location = "eastus2"
3+
workspace_name = "ml-workspace"
4+
compute_name = "ml-compute-cluster"
5+
subscription_id = "your-subscription_id"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# variables.tf
2+
# This file defines the input variables used in the Terraform configuration.
3+
# Each variable includes a description, type, and optional default value.
4+
5+
variable "subscription_id" {
6+
description = "The Azure subscription ID to use for the AzureRM provider."
7+
type = string
8+
}
9+
10+
variable "resource_group_name" {
11+
type = string
12+
description = "Name of the resource group"
13+
}
14+
15+
variable "location" {
16+
type = string
17+
description = "Azure region"
18+
default = "eastus"
19+
}
20+
21+
variable "workspace_name" {
22+
type = string
23+
description = "Name of the Azure ML workspace"
24+
}
25+
26+
variable "compute_name" {
27+
type = string
28+
description = "Name of the compute cluster"
29+
}

0 commit comments

Comments
 (0)