This commit is contained in:
Tom Archer
2024-10-25 15:01:17 -07:00
parent 2e32ee6be9
commit e6c148c0f4
8 changed files with 46 additions and 565 deletions

View File

@ -0,0 +1,33 @@
# 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 |
| `virtual_network_name` | Name of the virtual network resource. | "" |
| `subnet_name` | Name of the virtual network subnet. | "" |
| `public_ip_name` | Name of the public IP resource. | "" |
| `network_security_group_name` | Name of the network security group resource. | "" |
| `network_interface_name` | Name of the network interface resource. | "" |
| `virtual_machine_name` | Name of the virtual machine resource. | "" |
| `virtual_network_name_2` | Name of the second virtual network resource. | "" |
| `subnet_name_2` | Name of the second virtual network subnet. | "" |
| `public_ip_name_2` | Name of the second public IP resource. | "" |
| `network_interface_name_2` | Name of the second network interface resource. | "" |
| `virtual_machine_name_2` | Name of the second virtual machine resource. | "" |
| `data_factory_name` | Name of the data factory resource. | "" |
| `data_factory_integration_runtime_self_hosted_name` | Name of the data factory integration runtime self hosted resource. | "" |
| `data_factory_name_2` | Name of the second data factory resource. | "" |
| `data_factory_integration_runtime_self_hosted_name_2` | Name of the second data factory integration runtime self hosted resource. | "" |
## Example

View File

@ -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"
}
}

View File

@ -0,0 +1,7 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "data_factory_name" {
value = azurerm_data_factory.example.name
}

View File

@ -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 {}
}

View File

@ -0,0 +1,11 @@
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."
}
variable "resource_group_location" {
type = string
default = "eastus"
description = "Location of the resource group."
}