Skip to content

Instantly share code, notes, and snippets.

@ThaddeusJiang
Created March 14, 2022 11:16
Show Gist options
  • Save ThaddeusJiang/2473709158c4b3f57455fdd920c31304 to your computer and use it in GitHub Desktop.
Save ThaddeusJiang/2473709158c4b3f57455fdd920c31304 to your computer and use it in GitHub Desktop.
terraform sample for Azure Cloud
# Configure the Azure provider
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 2.26"
}
}
required_version = ">= 0.14.9"
}
provider "azurerm" {
features {}
}
data "azurerm_resource_group" "rg" {
// 略
}
# 1.新しいデータベースContainerを作成します
data "azurerm_cosmosdb_account" "account" {
// 略
}
resource "azurerm_cosmosdb_sql_container" "container" {
// 略
}
# 2.新しいStorageを作成します
resource "azurerm_storage_account" "new_storage" {
// 略
}
# 3.新しい顧客データを作成する
# Have to Manual
# 4.DNSゾーン設定
data "azurerm_dns_zone" "dns" {
// 略
}
resource "azurerm_dns_cname_record" "cname" {
// 略
}
# 5.App Service検証構成
data "azurerm_app_service" "app" {
// 略
}
# custom domain
resource "azurerm_app_service_custom_hostname_binding" "domain" {
// 略
}
# 6.CORS設定する
// 略
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment