dependency/azapi_examples/Microsoft.DBforMariaDB_servers_configurations@2018-06-01/main.tf (64 lines of code) (raw):
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "server" {
type = "Microsoft.DBforMariaDB/servers@2018-06-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
administratorLogin = "acctestun"
administratorLoginPassword = "H@Sh1CoR3!"
createMode = "Default"
minimalTlsVersion = "TLS1_2"
publicNetworkAccess = "Enabled"
sslEnforcement = "Enabled"
storageProfile = {
backupRetentionDays = 7
storageAutogrow = "Enabled"
storageMB = 51200
}
version = "10.2"
}
sku = {
capacity = 2
family = "Gen5"
name = "GP_Gen5_2"
tier = "GeneralPurpose"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_update_resource" "configuration" {
type = "Microsoft.DBforMariaDB/servers/configurations@2018-06-01"
parent_id = azapi_resource.server.id
name = "character_set_server"
body = {
properties = {
value = "LATIN1"
}
}
response_export_values = ["*"]
}