AzureRM Terraformプロバイダーを使用すると、AzureResourceManager内でリソースを管理できます。
AzureRMプロバイダーのバージョン3.0を使用する場合は、Terraform 1.xを使用することをお勧めします(最新バージョンはここにあります)。Terraform Coreの古いバージョン(0.12.x以降)はAzureRMプロバイダーのv3.0との互換性を維持しますが、1.0より前のバージョンのサポートはAzureRMプロバイダー(v4.0)の次のメジャーリリースで削除されます。
# 1. Specify the version of the AzureRM Provider to use
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.0.1"
}
}
}
# 2. Configure the AzureRM Provider
provider "azurerm" {
# The AzureRM Provider supports authenticating using via the Azure CLI, a Managed Identity
# and a Service Principal. More information on the authentication methods supported by
# the AzureRM Provider can be found here:
# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#authenticating-to-azure
# The features block allows changing the behaviour of the Azure Provider, more
# information can be found here:
# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/features-block
features {}
}
# 3. Create a resource group
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
# 4. Create a virtual network within the resource group
resource "azurerm_virtual_network" "example" {
name = "example-network"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
address_space = ["10.0.0.0/16"]
}
./examplesこのリポジトリ内のフォルダにあります。
DEVELOPER.mdファイルは、プロバイダーを構築および開発する方法の基本的な概要です。寄稿者向けのより詳細なガイドは、[
/contributing](https://github.com/hashicorp/terraform-provider-azurerm/tree/ )にあります。このリポジトリのメイン/貢献)ディレクトリ。