Examples for documentation for AzAPI provider including resource and update_resource
This commit is contained in:
25
quickstart/101-azapi-lab-services/main-generic.tf
Normal file
25
quickstart/101-azapi-lab-services/main-generic.tf
Normal file
@ -0,0 +1,25 @@
|
||||
# Provision a Lab Service Account and a Lab that are in public preview
|
||||
resource "azapi_resource" "qs101-account" {
|
||||
type = "Microsoft.LabServices/labaccounts@2018-10-15"
|
||||
name = "qs101LabAccount"
|
||||
parent_id = azurerm_resource_group.qs101.id
|
||||
|
||||
body = jsonencode({
|
||||
properties = {
|
||||
enabledRegionSelection = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
resource "azapi_resource" "qs101-lab" {
|
||||
type = "Microsoft.LabServices/labaccounts/labs@2018-10-15"
|
||||
name = "qs101Lab"
|
||||
parent_id = azapi_resource.qs101-account.id
|
||||
|
||||
body = jsonencode({
|
||||
properties = {
|
||||
maxUsersInLab = 10
|
||||
userAccessMode = "Restricted"
|
||||
}
|
||||
})
|
||||
}
|
13
quickstart/101-azapi-lab-services/main.tf
Normal file
13
quickstart/101-azapi-lab-services/main.tf
Normal file
@ -0,0 +1,13 @@
|
||||
resource "azurerm_resource_group" "qs101" {
|
||||
name = "rg-qs101"
|
||||
location = "westus2"
|
||||
|
||||
depends_on = [
|
||||
azurerm_resource_provider_registration.qs101
|
||||
]
|
||||
}
|
||||
|
||||
#
|
||||
resource "azurerm_resource_provider_registration" "qs101" {
|
||||
name = "Microsoft.LabServices"
|
||||
}
|
23
quickstart/101-azapi-lab-services/providers.tf
Normal file
23
quickstart/101-azapi-lab-services/providers.tf
Normal file
@ -0,0 +1,23 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
azapi = {
|
||||
source = "azure/azapi"
|
||||
version = "=0.1.0"
|
||||
}
|
||||
azurerm = {
|
||||
source = "hashicorp/azurerm"
|
||||
version = "=3.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "azapi" {
|
||||
default_location = "eastus"
|
||||
default_tags = {
|
||||
team = "Azure deployments"
|
||||
}
|
||||
}
|
||||
|
||||
provider "azurerm" {
|
||||
features {}
|
||||
}
|
Reference in New Issue
Block a user