New sample (converted from Bicep via OpenAI)
This commit is contained in:
parent
35b3afaf63
commit
566ede9f1e
24
quickstart/101-cognitive-services-account/main.tf
Normal file
24
quickstart/101-cognitive-services-account/main.tf
Normal file
@ -0,0 +1,24 @@
|
||||
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_cognitive_account_name" {
|
||||
length = 13
|
||||
lower = true
|
||||
numeric = false
|
||||
special = false
|
||||
upper = false
|
||||
}
|
||||
|
||||
resource "azurerm_cognitive_account" "cognitive_service" {
|
||||
name = "CognitiveService-${random_string.azurerm_cognitive_account_name.result}"
|
||||
location = azurerm_resource_group.rg.location
|
||||
resource_group_name = azurerm_resource_group.rg.name
|
||||
sku_name = var.sku
|
||||
kind = "CognitiveServices"
|
||||
}
|
7
quickstart/101-cognitive-services-account/outputs.tf
Normal file
7
quickstart/101-cognitive-services-account/outputs.tf
Normal file
@ -0,0 +1,7 @@
|
||||
output "resource_group_name" {
|
||||
value = azurerm_resource_group.rg.name
|
||||
}
|
||||
|
||||
output "azurerm_cognitive_account_name" {
|
||||
value = azurerm_cognitive_account.cognitive_service.name
|
||||
}
|
16
quickstart/101-cognitive-services-account/providers.tf
Normal file
16
quickstart/101-cognitive-services-account/providers.tf
Normal file
@ -0,0 +1,16 @@
|
||||
terraform {
|
||||
required_version = ">=1.0"
|
||||
required_providers {
|
||||
azurerm = {
|
||||
source = "hashicorp/azurerm"
|
||||
version = "~>3.0"
|
||||
}
|
||||
random = {
|
||||
source = "hashicorp/random"
|
||||
version = "~>3.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
provider "azurerm" {
|
||||
features {}
|
||||
}
|
18
quickstart/101-cognitive-services-account/readme.md
Normal file
18
quickstart/101-cognitive-services-account/readme.md
Normal file
@ -0,0 +1,18 @@
|
||||
# Azure Cognitive Services account
|
||||
|
||||
This template deploys an Azure Cognitive Services account.
|
||||
|
||||
## 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)
|
||||
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
|
||||
- [azurerm_cognitive_account](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cognitive_account)
|
||||
|
||||
## 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 |
|
||||
| `sku` | The sku name of the Azure Analysis Services server to create. | S0 |
|
17
quickstart/101-cognitive-services-account/variables.tf
Normal file
17
quickstart/101-cognitive-services-account/variables.tf
Normal file
@ -0,0 +1,17 @@
|
||||
variable "resource_group_location" {
|
||||
type = string
|
||||
description = "Location for all resources."
|
||||
default = "eastus"
|
||||
}
|
||||
|
||||
variable "resource_group_name_prefix" {
|
||||
type = string
|
||||
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
|
||||
default = "rg"
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user