次の方法で共有


Microsoft.SQL instancePools

Bicep リソース定義

instancePools リソースの種類は、次をターゲットとする操作でデプロイできます。

  • リソース グループの - リソース グループのデプロイ コマンド 参照

各 API バージョンで変更されたプロパティの一覧については、変更ログの参照してください。

リソースの形式

Microsoft.Sql/instancePools リソースを作成するには、次の Bicep をテンプレートに追加します。

resource symbolicname 'Microsoft.Sql/instancePools@2024-11-01-preview' = {
  location: 'string'
  name: 'string'
  properties: {
    licenseType: 'string'
    maintenanceConfigurationId: 'string'
    subnetId: 'string'
    vCores: int
  }
  sku: {
    capacity: int
    family: 'string'
    name: 'string'
    size: 'string'
    tier: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

プロパティ値

Microsoft.Sql/instancePools

Name Description Value
位置 リソースの場所。 string (必須)
name リソース名 string (必須)
properties リソースのプロパティ。 InstancePoolProperties
sku SKU の名前と層。 Sku
tags リソース タグ タグ名と値のディクショナリ。 テンプレート の タグを参照してください

InstancePoolProperties

Name Description Value
licenseType ライセンスの種類。 指定できる値は、'LicenseIncluded' (SQL ライセンスの価格が含まれています) と 'BasePrice' (SQL ライセンス価格なし) です。 'BasePrice'
'LicenseIncluded' (必須)
maintenanceConfigurationId このマネージド インスタンスに適用するメンテナンス構成 ID を指定します。 文字列
subnetId このインスタンス プールを配置するサブネットのリソース ID。 string (必須)
vCores このインスタンス プールに属する仮想コアの数。 int (必須)

Sku

Name Description Value
キャパシティ 特定の SKU の容量。 int
family 同じ SKU に対して、サービスの世代が異なるハードウェアがある場合は、ここでキャプチャできます。 文字列
name SKU の名前 。通常は、文字 + 番号コード (P3 など)。 string (必須)
size 特定の SKU のサイズ 文字列
レベル 特定の SKU のレベルまたはエディション (Basic、Premium など)。 文字列

TrackedResourceTags

Name Description Value

使用例

Bicep サンプル

SQL インスタンス プールのデプロイの基本的な例。

param resourceName string = 'acctest0001'

resource subnet 'Microsoft.Network/virtualNetworks/subnets@2023-04-01' existing = {
  parent: virtualNetwork
  name: resourceName
}

resource instancePool 'Microsoft.Sql/instancePools@2022-05-01-preview' = {
  name: resourceName
  properties: {
    licenseType: 'LicenseIncluded'
    subnetId: subnet.id
    vCores: 8
  }
  sku: {
    family: 'Gen5'
    name: 'GP_Gen5'
    tier: 'GeneralPurpose'
  }
}

resource networkSecurityGroup 'Microsoft.Network/networkSecurityGroups@2023-04-01' = {
  name: resourceName
  properties: {
    securityRules: [
      {
        name: 'allow_tds_inbound'
        properties: {
          access: 'Allow'
          description: 'Allow access to data'
          destinationAddressPrefix: '*'
          destinationPortRange: '1433'
          direction: 'Inbound'
          priority: 1000
          protocol: 'TCP'
          sourceAddressPrefix: 'VirtualNetwork'
          sourcePortRange: '*'
        }
      }
      {
        name: 'allow_redirect_inbound'
        properties: {
          access: 'Allow'
          description: 'Allow inbound redirect traffic to Managed Instance inside the virtual network'
          destinationAddressPrefix: '*'
          destinationPortRange: '11000-11999'
          direction: 'Inbound'
          priority: 1100
          protocol: 'Tcp'
          sourceAddressPrefix: 'VirtualNetwork'
          sourcePortRange: '*'
        }
      }
      {
        name: 'allow_geodr_inbound'
        properties: {
          access: 'Allow'
          description: 'Allow inbound geodr traffic inside the virtual network'
          destinationAddressPrefix: '*'
          destinationPortRange: '5022'
          direction: 'Inbound'
          priority: 1200
          protocol: 'Tcp'
          sourceAddressPrefix: 'VirtualNetwork'
          sourcePortRange: '*'
        }
      }
      {
        name: 'deny_all_inbound'
        properties: {
          access: 'Deny'
          description: 'Deny all other inbound traffic'
          destinationAddressPrefix: '*'
          destinationPortRange: '*'
          direction: 'Inbound'
          priority: 4096
          protocol: '*'
          sourceAddressPrefix: '*'
          sourcePortRange: '*'
        }
      }
      {
        name: 'allow_linkedserver_outbound'
        properties: {
          access: 'Allow'
          description: 'Allow outbound linkedserver traffic inside the virtual network'
          destinationAddressPrefix: 'VirtualNetwork'
          destinationPortRange: '1433'
          direction: 'Outbound'
          priority: 1000
          protocol: 'Tcp'
          sourceAddressPrefix: '*'
          sourcePortRange: '*'
        }
      }
      {
        name: 'allow_redirect_outbound'
        properties: {
          access: 'Allow'
          description: 'Allow outbound redirect traffic to Managed Instance inside the virtual network'
          destinationAddressPrefix: 'VirtualNetwork'
          destinationPortRange: '11000-11999'
          direction: 'Outbound'
          priority: 1100
          protocol: 'Tcp'
          sourceAddressPrefix: '*'
          sourcePortRange: '*'
        }
      }
      {
        name: 'allow_geodr_outbound'
        properties: {
          access: 'Allow'
          description: 'Allow outbound geodr traffic inside the virtual network'
          destinationAddressPrefix: 'VirtualNetwork'
          destinationPortRange: '5022'
          direction: 'Outbound'
          priority: 1200
          protocol: 'Tcp'
          sourceAddressPrefix: '*'
          sourcePortRange: '*'
        }
      }
      {
        name: 'deny_all_outbound'
        properties: {
          access: 'Deny'
          description: 'Deny all other outbound traffic'
          destinationAddressPrefix: '*'
          destinationPortRange: '*'
          direction: 'Outbound'
          priority: 4096
          protocol: '*'
          sourceAddressPrefix: '*'
          sourcePortRange: '*'
        }
      }
    ]
  }
}

resource routeTable 'Microsoft.Network/routeTables@2023-04-01' = {
  name: resourceName
  properties: {
    disableBgpRoutePropagation: false
  }
}

resource virtualNetwork 'Microsoft.Network/virtualNetworks@2023-04-01' = {
  name: resourceName
  properties: {
    addressSpace: {
      addressPrefixes: [
        '10.0.0.0/16'
      ]
    }
    subnets: [
      {
        name: 'Default'
        properties: {
          addressPrefix: '10.0.0.0/24'
        }
      }
      {
        name: 'acctest0001'
        properties: {
          addressPrefix: '10.0.1.0/24'
          delegations: [
            {
              name: 'miDelegation'
              properties: {
                serviceName: 'Microsoft.Sql/managedInstances'
              }
            }
          ]
          networkSecurityGroup: {
            id: networkSecurityGroup.id
          }
          routeTable: {
            id: routeTable.id
          }
        }
      }
    ]
  }
}

Azure 検証済みモジュール

次の Azure 検証済みモジュール を使用して、このリソースの種類をデプロイできます。

Module Description
SQL インスタンス プール SQL インスタンス プールの AVM リソース モジュール

ARM テンプレート リソース定義

instancePools リソースの種類は、次をターゲットとする操作でデプロイできます。

  • リソース グループの - リソース グループのデプロイ コマンド 参照

各 API バージョンで変更されたプロパティの一覧については、変更ログの参照してください。

リソースの形式

Microsoft.Sql/instancePools リソースを作成するには、次の JSON をテンプレートに追加します。

{
  "type": "Microsoft.Sql/instancePools",
  "apiVersion": "2024-11-01-preview",
  "name": "string",
  "location": "string",
  "properties": {
    "licenseType": "string",
    "maintenanceConfigurationId": "string",
    "subnetId": "string",
    "vCores": "int"
  },
  "sku": {
    "capacity": "int",
    "family": "string",
    "name": "string",
    "size": "string",
    "tier": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

プロパティ値

Microsoft.Sql/instancePools

Name Description Value
apiVersion API のバージョン '2024-11-01-preview'
位置 リソースの場所。 string (必須)
name リソース名 string (必須)
properties リソースのプロパティ。 InstancePoolProperties
sku SKU の名前と層。 Sku
tags リソース タグ タグ名と値のディクショナリ。 テンプレート の タグを参照してください
リソースの種類 'Microsoft.Sql/instancePools'

InstancePoolProperties

Name Description Value
licenseType ライセンスの種類。 指定できる値は、'LicenseIncluded' (SQL ライセンスの価格が含まれています) と 'BasePrice' (SQL ライセンス価格なし) です。 'BasePrice'
'LicenseIncluded' (必須)
maintenanceConfigurationId このマネージド インスタンスに適用するメンテナンス構成 ID を指定します。 文字列
subnetId このインスタンス プールを配置するサブネットのリソース ID。 string (必須)
vCores このインスタンス プールに属する仮想コアの数。 int (必須)

Sku

Name Description Value
キャパシティ 特定の SKU の容量。 int
family 同じ SKU に対して、サービスの世代が異なるハードウェアがある場合は、ここでキャプチャできます。 文字列
name SKU の名前 。通常は、文字 + 番号コード (P3 など)。 string (必須)
size 特定の SKU のサイズ 文字列
レベル 特定の SKU のレベルまたはエディション (Basic、Premium など)。 文字列

TrackedResourceTags

Name Description Value

使用例

Terraform (AzAPI プロバイダー) リソース定義

instancePools リソースの種類は、次をターゲットとする操作でデプロイできます。

  • リソース グループ

各 API バージョンで変更されたプロパティの一覧については、変更ログの参照してください。

リソースの形式

Microsoft.Sql/instancePools リソースを作成するには、次の Terraform をテンプレートに追加します。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Sql/instancePools@2024-11-01-preview"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      licenseType = "string"
      maintenanceConfigurationId = "string"
      subnetId = "string"
      vCores = int
    }
    sku = {
      capacity = int
      family = "string"
      name = "string"
      size = "string"
      tier = "string"
    }
  }
}

プロパティ値

Microsoft.Sql/instancePools

Name Description Value
位置 リソースの場所。 string (必須)
name リソース名 string (必須)
properties リソースのプロパティ。 InstancePoolProperties
sku SKU の名前と層。 Sku
tags リソース タグ タグ名と値のディクショナリ。
リソースの種類 "Microsoft.Sql/instancePools@2024-11-01-preview"

InstancePoolProperties

Name Description Value
licenseType ライセンスの種類。 指定できる値は、'LicenseIncluded' (SQL ライセンスの価格が含まれています) と 'BasePrice' (SQL ライセンス価格なし) です。 'BasePrice'
'LicenseIncluded' (必須)
maintenanceConfigurationId このマネージド インスタンスに適用するメンテナンス構成 ID を指定します。 文字列
subnetId このインスタンス プールを配置するサブネットのリソース ID。 string (必須)
vCores このインスタンス プールに属する仮想コアの数。 int (必須)

Sku

Name Description Value
キャパシティ 特定の SKU の容量。 int
family 同じ SKU に対して、サービスの世代が異なるハードウェアがある場合は、ここでキャプチャできます。 文字列
name SKU の名前 。通常は、文字 + 番号コード (P3 など)。 string (必須)
size 特定の SKU のサイズ 文字列
レベル 特定の SKU のレベルまたはエディション (Basic、Premium など)。 文字列

TrackedResourceTags

Name Description Value

使用例

Terraformサンプル

SQL インスタンス プールのデプロイの基本的な例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
    azurerm = {
      source = "hashicorp/azurerm"
    }
  }
}

provider "azurerm" {
  features {
  }
}

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@2022-09-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "networkSecurityGroup" {
  type      = "Microsoft.Network/networkSecurityGroups@2023-04-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      securityRules = [
        {
          name = "allow_tds_inbound"
          properties = {
            description              = "Allow access to data"
            protocol                 = "TCP"
            sourcePortRange          = "*"
            destinationPortRange     = "1433"
            sourceAddressPrefix      = "VirtualNetwork"
            destinationAddressPrefix = "*"
            access                   = "Allow"
            priority                 = 1000
            direction                = "Inbound"
          }
        },
        {
          name = "allow_redirect_inbound"
          properties = {
            description              = "Allow inbound redirect traffic to Managed Instance inside the virtual network"
            protocol                 = "Tcp"
            sourcePortRange          = "*"
            destinationPortRange     = "11000-11999"
            sourceAddressPrefix      = "VirtualNetwork"
            destinationAddressPrefix = "*"
            access                   = "Allow"
            priority                 = 1100
            direction                = "Inbound"
          }
        },
        {
          name = "allow_geodr_inbound"
          properties = {
            description              = "Allow inbound geodr traffic inside the virtual network"
            protocol                 = "Tcp"
            sourcePortRange          = "*"
            destinationPortRange     = "5022"
            sourceAddressPrefix      = "VirtualNetwork"
            destinationAddressPrefix = "*"
            access                   = "Allow"
            priority                 = 1200
            direction                = "Inbound"
          }
        },
        {
          name = "deny_all_inbound"
          properties = {
            description              = "Deny all other inbound traffic"
            protocol                 = "*"
            sourcePortRange          = "*"
            destinationPortRange     = "*"
            sourceAddressPrefix      = "*"
            destinationAddressPrefix = "*"
            access                   = "Deny"
            priority                 = 4096
            direction                = "Inbound"
          }
        },
        {
          name = "allow_linkedserver_outbound"
          properties = {
            description              = "Allow outbound linkedserver traffic inside the virtual network"
            protocol                 = "Tcp"
            sourcePortRange          = "*"
            destinationPortRange     = "1433"
            sourceAddressPrefix      = "*"
            destinationAddressPrefix = "VirtualNetwork"
            access                   = "Allow"
            priority                 = 1000
            direction                = "Outbound"
          }
        },
        {
          name = "allow_redirect_outbound"
          properties = {
            description              = "Allow outbound redirect traffic to Managed Instance inside the virtual network"
            protocol                 = "Tcp"
            sourcePortRange          = "*"
            destinationPortRange     = "11000-11999"
            sourceAddressPrefix      = "*"
            destinationAddressPrefix = "VirtualNetwork"
            access                   = "Allow"
            priority                 = 1100
            direction                = "Outbound"
          }
        },
        {
          name = "allow_geodr_outbound"
          properties = {
            description              = "Allow outbound geodr traffic inside the virtual network"
            protocol                 = "Tcp"
            sourcePortRange          = "*"
            destinationPortRange     = "5022"
            sourceAddressPrefix      = "*"
            destinationAddressPrefix = "VirtualNetwork"
            access                   = "Allow"
            priority                 = 1200
            direction                = "Outbound"
          }
        },
        {
          name = "deny_all_outbound"
          properties = {
            description              = "Deny all other outbound traffic"
            protocol                 = "*"
            sourcePortRange          = "*"
            destinationPortRange     = "*"
            sourceAddressPrefix      = "*"
            destinationAddressPrefix = "*"
            access                   = "Deny"
            priority                 = 4096
            direction                = "Outbound"
          }
        }
      ]
    }
  }
}

resource "azapi_resource" "routeTable" {
  type      = "Microsoft.Network/routeTables@2023-04-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      disableBgpRoutePropagation = false
    }
  }
}

resource "azapi_resource" "virtualNetwork" {
  type      = "Microsoft.Network/virtualNetworks@2023-04-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      addressSpace = {
        addressPrefixes = ["10.0.0.0/16"]
      }
      subnets = [
        {
          name = "Default"
          properties = {
            addressPrefix = "10.0.0.0/24"
          }
        },
        {
          name = var.resource_name
          properties = {
            addressPrefix = "10.0.1.0/24"
            networkSecurityGroup = {
              id = azapi_resource.networkSecurityGroup.id
            }
            routeTable = {
              id = azapi_resource.routeTable.id
            }
            delegations = [
              {
                name = "miDelegation"
                properties = {
                  serviceName = "Microsoft.Sql/managedInstances"
                }
              }
            ]
          }
        }
      ]
    }
  }
}

data "azapi_resource" "subnet" {
  type      = "Microsoft.Network/virtualNetworks/subnets@2023-04-01"
  parent_id = azapi_resource.virtualNetwork.id
  name      = var.resource_name
}


resource "azapi_resource" "instancePool" {
  type      = "Microsoft.Sql/instancePools@2022-05-01-preview"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = azapi_resource.resourceGroup.location
  body = {
    properties = {
      licenseType = "LicenseIncluded"
      subnetId    = data.azapi_resource.subnet.id
      vCores      = 8
    }
    sku = {
      family = "Gen5"
      name   = "GP_Gen5"
      tier   = "GeneralPurpose"
    }
  }

  timeouts {
    create = "300m"
    update = "300m"
    delete = "300m"
  }
}