Merge pull request #155 from TomArcherMsft/UserStory60501-analysis-services-create

User Story 60501: Azure Analysis Services
This commit is contained in:
Mark Gray (MSFT) 2023-03-07 12:02:06 -08:00 committed by GitHub
commit 3fd4b1b0a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 101 additions and 0 deletions

View File

@ -0,0 +1,29 @@
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_analysis_services_server_name" {
length = 25
upper = false
numeric = false
special = false
}
resource "azurerm_analysis_services_server" "server" {
name = random_string.azurerm_analysis_services_server_name.result
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
sku = var.sku
backup_blob_container_uri = var.backup_blob_container_uri
ipv4_firewall_rule {
name = "AllowFromAll"
range_start = "0.0.0.0"
range_end = "255.255.255.255"
}
}

View File

@ -0,0 +1,7 @@
output "resource_group_name" {
value = azurerm_resource_group.rg.name
}
output "azurerm_analysis_services_server_name" {
value = azurerm_analysis_services_server.server.name
}

View File

@ -0,0 +1,16 @@
terraform {
required_version = ">=0.12"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}

View File

@ -0,0 +1,19 @@
# Azure Analysis Services server
This template deploys an Azure Analysis Services server.
## 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_analysis_services_server](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/analysis_services_server)
## Variables
| Name | Description | Default |
|-|-|-|
| `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 |
| `server_name` | Name of the Azure Analysis Services server. | |
| `sku` | SKU name of the Azure Analysis Services server to create. | S0 |
| `backup_blob_container_uri` | SAS URI to a private Azure Blob Storage container with read, write and list permissions. | null |

View File

@ -0,0 +1,30 @@
variable "resource_group_location" {
type = string
default = "eastus"
description = "Location for all resources."
}
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 "azurerm_analysis_services_server_name_prefix" {
type = string
default = "mys"
description = "Prefix of the Azure Analysis Services Server name that's combined with a random string to create a unique server name in your Azure subscription."
}
variable "sku" {
type = string
description = "The sku name of the Azure Analysis Services server to create. Choose from: B1, B2, D1, S0, S1, S2, S3, S4, S8, S9. Some skus are region specific. See https://docs.microsoft.com/en-us/azure/analysis-services/analysis-services-overview#availability-by-region"
default = "S0"
}
variable "backup_blob_container_uri" {
type = string
description = "The SAS URI to a private Azure Blob Storage container with read, write and list permissions. Required only if you intend to use the backup/restore functionality. See https://docs.microsoft.com/en-us/azure/analysis-services/analysis-services-backup"
default = null
}