terraform-provider-azure

Create Azure Automation Start/Stop solution through Terraform

守給你的承諾、 提交于 2020-08-10 19:39:16
问题 I'm trying to set up machines to be automatically start/stopped using the newish Azure Automation add-in (https://docs.microsoft.com/en-us/azure/automation/automation-solution-vm-management) with this being set up by Terraform. I can create the automation account but I don't know how to create the start-stop functionality, can someone help fill in the blanks? 回答1: the AzureRM provider can manage aspects of runbooks. If you have a look at the documentation here. Using azurerm_automation

Removing Backend pools and load balancer rules before creating another

蓝咒 提交于 2020-07-09 06:39:40
问题 I have terraform script which creates Backend address pools and Loadbalancer rules in Loadbalancer in resource group. These tasks are included in Azure-pipeline. FOr the first time I run the pipeline.Its creating properly. If I run the pipeline for the second time. Its not updating the existing one .Its keeping the Backend address pools and Loadbalancer rules which are created by previous release and adding the extra Backend address pools and Loadbalancer rules for this release which is

Terraform: How to install multiple versions of provider plugins? [duplicate]

给你一囗甜甜゛ 提交于 2020-07-08 03:34:21
问题 This question already has an answer here : Multiple provider versions with Terraform (1 answer) Closed last month . I am trying to deploy Azure resources through Terraform 0.12 with azurerm provider. I have AKS module which works fine with azurerm version 2.5.0, but breaks with 2.9.0. On the other hand Postgresql module works with version 2.9.0 but breaks with 2.5.0 I want to deploy both resources through a single terraform apply. I tried below configuration but it fails at initialize phase.

Defining Azure VM CustomScriptExtension in Terraform (Expecting state 'Element'.. Encountered 'Text' with name '', namespace ''. \“.”)

不想你离开。 提交于 2020-06-18 15:39:46
问题 I defined a CustomScriptExtension for Azure VM in Terraform: resource "azurerm_virtual_machine_extension" "test" { name = "WinRM" location = "South Central US" resource_group_name = "${azurerm_resource_group.test.name}" virtual_machine_name = "${azurerm_virtual_machine.test.name}" publisher = "Microsoft.Compute" type = "CustomScriptExtension" type_handler_version = "1.8" settings = <<SETTINGS { "fileUris": "https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts

Defining Azure VM CustomScriptExtension in Terraform (Expecting state 'Element'.. Encountered 'Text' with name '', namespace ''. \“.”)

跟風遠走 提交于 2020-06-18 15:39:05
问题 I defined a CustomScriptExtension for Azure VM in Terraform: resource "azurerm_virtual_machine_extension" "test" { name = "WinRM" location = "South Central US" resource_group_name = "${azurerm_resource_group.test.name}" virtual_machine_name = "${azurerm_virtual_machine.test.name}" publisher = "Microsoft.Compute" type = "CustomScriptExtension" type_handler_version = "1.8" settings = <<SETTINGS { "fileUris": "https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts

Terraform with azure CLI - error building account

雨燕双飞 提交于 2020-06-16 18:49:05
问题 using the provider block provider "azurerm" { subscription_id = var.subscription_id version = "=1.44" } and after successfully logging in with az login running terraform plan I get the following error: Error: Error building account: Error getting authenticated object ID: Error parsing json result from the Azure CLI: Error waiting for the Azure CLI: exit status 2 on main.tf line 21, in provider "azurerm": 21: provider "azurerm" { UPDATE: If I change the provider block to: provider "azurerm" {

Terraform - Passing type Object as a parameter to Azure Template Deployment

假如想象 提交于 2020-06-15 23:42:07
问题 I am tying to to provision Azure AD Domain Service using Terraform by giving Terraform the Azure ARM template, this is because Terrafrom does not support provisioning Azure AD Domain Service natively. I have exported the ARM Template and it's parameters, one of the parameters is called "notificationSettings" which is a type Object and looks like below : "notificationSettings": { "value": { "notifyGlobalAdmins": "Enabled", "notifyDcAdmins": "Enabled", "additionalRecipients": [] } } Other

Terraform - Passing type Object as a parameter to Azure Template Deployment

人走茶凉 提交于 2020-06-15 23:40:13
问题 I am tying to to provision Azure AD Domain Service using Terraform by giving Terraform the Azure ARM template, this is because Terrafrom does not support provisioning Azure AD Domain Service natively. I have exported the ARM Template and it's parameters, one of the parameters is called "notificationSettings" which is a type Object and looks like below : "notificationSettings": { "value": { "notifyGlobalAdmins": "Enabled", "notifyDcAdmins": "Enabled", "additionalRecipients": [] } } Other

I have a CSV and JSON data to parse the input values to the Terraform main file. Here I can able to parse the data using JSON but not with CSV

喜欢而已 提交于 2020-05-24 07:30:50
问题 I have a azure_subnet snippet to create resources like below. locals { csvlist = fileexists(var.csvfile) ? csvdecode(file(var.csvfile)) : [] subnets = length(var.subnets) > 0 ? var.subnets : local.csvlist } resource "azurerm_subnet" "subnet" { lifecycle { ignore_changes = [network_security_group_id] } count = length(local.subnets) > 0 && var.create ? length(local.subnets) : 0 name = local.subnets[count.index].name resource_group_name = var.resource_group virtual_network_name = var.vnet

How do I create custom Azure images smaller than 30GB with Packer + Terraform?

﹥>﹥吖頭↗ 提交于 2020-04-30 10:01:17
问题 I want to create custom images that are 4GB for cost-saving purposes on a side project. I've been able set the size for the Azure-provided Ubuntu 18.04 base image in Terraform successfully using the following: resource "azurerm_managed_disk" "example-disk" { ... create_option = "FromImage" disk_size_gb = "4" } resource "azurerm_virtual_machine" "example" { ... vm_size = "Standard_B1s" storage_image_reference { publisher = "Canonical" offer = "UbuntuServer" sku = "18.04-LTS" version = "latest"