terraform-provider-azure

Terraform Custom Provider - Data Source

橙三吉。 提交于 2020-04-06 04:12:12
问题 I am currently working on a custom Terraform Provider for Jumpcloud and am experiencing some challenges with configuring a custom data source. I see that the Resource schema requires Create, Read, Update, and delete. I am just wanting to run an API query in Terraform so that I can return a list of users and use those users in a for loop. Below is the API call that I have tagged as a schema.Resource func userquery() *schema.Resource { apiKey := "" userGroupID := "" contentType := "application

ARM Return App Service Environment ID to use in Terraform Script

妖精的绣舞 提交于 2020-02-05 04:38:19
问题 Terraform does not allow for the deployment of App Service Environments so I am using the azurerm_template_deployment as a work around. However, I want to reference the App Service Environment ID in an App Service Plan resource that I am creating later. How would I get and save the ID of the App Service Environment using this method? I am using the depends_on tag in the app service plan resource to ensure its creation after the app service environment, but I can not figure out how to get the

Add azure SQL user with terraform

烂漫一生 提交于 2020-01-30 03:52:16
问题 is there a possibility to add a sql user to the azure sql via terraform? https://www.mssqltips.com/sqlservertip/5242/adding-users-to-azure-sql-databases/ Or is there a better suggestions how to create a SQL user? Thanks 回答1: Yes you can do it from Terraform if that is what you want to happen. I would use a null resource provider in Terraform to execute the commands from the box that is running Terraform. You could use PowerShell, CMD, etc. to connect to the database after it is created and

Add azure SQL user with terraform

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-30 03:50:49
问题 is there a possibility to add a sql user to the azure sql via terraform? https://www.mssqltips.com/sqlservertip/5242/adding-users-to-azure-sql-databases/ Or is there a better suggestions how to create a SQL user? Thanks 回答1: Yes you can do it from Terraform if that is what you want to happen. I would use a null resource provider in Terraform to execute the commands from the box that is running Terraform. You could use PowerShell, CMD, etc. to connect to the database after it is created and

Terraform creating VM from managed disk image made in Packer

情到浓时终转凉″ 提交于 2020-01-21 18:39:49
问题 I have created a custom VM image using Packer, and now I am trying to create a new VM based on this image using Terraform, but I am confused on how I need to set up my .TF file . I can create the rest of the infrastructure okay. I think my packer json file created a managed disk image but I am unsure how to set this up and cannot find an example online. I am quite new to infraastructure as code and the Azure ecco system in general main.tf resource "azurerm_managed_disk" "managedDisk" { name =

unknown token IDENT list error for IP address variable

允我心安 提交于 2020-01-14 10:11:20
问题 I have defined variable in my .tfvars variable as variables.tfvars address_space = ["10.197.0.0/16"] build-windows.tf variable "address_space" { type = list } In build-windows.tf file I get the error as Unknow token ident list? Not sure what I am doing wrong here, I even do not understand why terraform wants me to use the list instead of a string. When I use string I get an error in terraform plan stating that I have to use list. Not going anywhere. Please assist 回答1: The type parameter is a

unknown token IDENT list error for IP address variable

本小妞迷上赌 提交于 2020-01-14 10:11:10
问题 I have defined variable in my .tfvars variable as variables.tfvars address_space = ["10.197.0.0/16"] build-windows.tf variable "address_space" { type = list } In build-windows.tf file I get the error as Unknow token ident list? Not sure what I am doing wrong here, I even do not understand why terraform wants me to use the list instead of a string. When I use string I get an error in terraform plan stating that I have to use list. Not going anywhere. Please assist 回答1: The type parameter is a

How to configure environment variables in Hashicorp Terraform

巧了我就是萌 提交于 2020-01-02 06:36:10
问题 I'm quite new to Terraform, though I have gone through all of the instructional modules available on Hashicorp's site. Currently, I'm struggling with understanding how to set up environment variables. I know how to reference variables in the main.tf config ( access_key = "${var.access_key}" ), and I know how to save that access key to a separate file and reference that, but what I don't understand (and can't find any documentation/instruction on) is how to set up environment variables so I

Connection timeout during file provision to azurerm vm

痞子三分冷 提交于 2019-12-14 03:09:30
问题 I am getting below timeout message once trying to provision file to an azure RM VM . unknown error Post http://terraform.eastus.cloudapp.azure.com:3389/wsman: read tcp 192.168.0.4:59745->52.224.162.240:3389: wsarecv: An existing connection was forcibly closed by the remote host. I am trying file provision and the VM already there and no need to create it. I only need to copy a text file to an existing VM using below config. provider "azurerm" { } resource "null_resource" "test" { provisioner

Error Importing existing resources into Terraform State File

白昼怎懂夜的黑 提交于 2019-12-12 23:59:54
问题 I am attempting to refactor some of my modules, which requires me to move existing resources into a different state file. Normally importing resources is monotonous but straightforward. I do not know how to interpret the following "The number of path segments is not divisible by 2" error when attempting to import any of these resources. This is happening on all resources I am attempting to import (which I have successfully done many times in the past) CLI> terraform import azurerm_virtual