Skip to content

Commit

Permalink
Merge pull request #384 from Azure/UserStory330782
Browse files Browse the repository at this point in the history
User Story 330782 - 101-data-factory
  • Loading branch information
TomArcherMsft authored Oct 25, 2024
2 parents b6461f0 + 878ea2e commit 9b1c5ec
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
18 changes: 18 additions & 0 deletions quickstart/101-data-factory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Azure Data Factory

This template deploys an Azure Data Factory instance.

## Terraform resource types

- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [azurerm_data_factory](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/data_factory)

## Variables

| 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 |

## Example
26 changes: 26 additions & 0 deletions quickstart/101-data-factory/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}

resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
name = random_pet.rg_name.id
}

resource "random_string" "azurerm_data_factory" {
length = 13
lower = true
numeric = false
special = false
upper = false
}

resource "azurerm_data_factory" "example" {
name = random_string.azurerm_data_factory.result
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name

identity {
type = "SystemAssigned"
}
}
7 changes: 7 additions & 0 deletions quickstart/101-data-factory/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}

output "data_factory_name" {
value = azurerm_data_factory.example.name
}
18 changes: 18 additions & 0 deletions quickstart/101-data-factory/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform {
required_version = ">=1.0"

required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}

provider "azurerm" {
features {}
}
11 changes: 11 additions & 0 deletions quickstart/101-data-factory/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
variable "resource_group_location" {
type = string
default = "eastus"
description = "Location of the resource group."
}

variable "resource_group_name_prefix" {
type = string
default = "rg"
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
}

0 comments on commit 9b1c5ec

Please sign in to comment.