tevert / vsts-release-terraform Goto Github PK
View Code? Open in Web Editor NEWThis project forked from xpiritbv/xpirit-vsts-release-terraform
VSTS Build/Release task for Terraform commands
License: MIT License
This project forked from xpiritbv/xpirit-vsts-release-terraform
VSTS Build/Release task for Terraform commands
License: MIT License
Running "Plan" causes failure. With leaving out a step for "init" prior to it generates a blank error.
When running "init" followed by "plan" you recieve the following error on the plan stage:
erraform version:
Terraform v0.11.1
+ provider.azurerm v0.3.3
+ provider.random v1.1.0
Running: terraform plan
�[0m�[1mRefreshing Terraform state in-memory prior to plan...�[0m'
The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage.
�[0m
------------------------------------------------------------------------
�[31m
�[1m�[31mError: �[0m�[0m�[1mError running plan: 1 error(s) occurred:
* provider.azurerm: Azure CLI Authorization Profile was not found. Please ensure the Azure CLI is installed and then log-in with
az login.�[0m
�[0m�[0m�[0m
Terraform failed to execute. Error:
End of Task Terraform
Do you have any examples on how to pass the variables? I have the variables defined in the library and linked to the build job but they seem to not be referencing. I added the following line to attempt to call them:
-var 'subscription_id=vars' -var 'client_id=vars' -var 'client_secret=vars' -var 'tenant_id=vars'
and flipped it around as well to:
-var 'vars=subscription_id' -var 'vars=client_id' -var 'vars=client_secret' -var 'vars=tenant_id'
My code I have tried using
variable subscription_id {
description = "words in here"
}
as well as:
provider "azurerm" {
subscription_id = "${var.subscription_id}"
client_id = "${var.client_id}"
client_secret = "${var.client_secret}"
tenant_id = "${var.tenant_id}"
}
but cannot seem to get the variables to take. Get an error telling me:
- provider config 'azurerm': unknown variable referenced: 'subscription_id'; define it with a 'variable' block
- provider config 'azurerm': unknown variable referenced: 'client_id'; define it with a 'variable' block
- provider config 'azurerm': unknown variable referenced: 'client_secret'; define it with a 'variable' block
- provider config 'azurerm': unknown variable referenced: 'tenant_id'; define it with a 'variable' block
Each time I run it.
See comment: hashicorp/terraform#9803 (comment)
In the spirit of Seth's comment, it might also make sense to change the Version field to a dropdown of major/minor versions. But then I'd need to be constantly adding new dropdown items....
Or maybe the better approach is just to force people to define their remote state as part of the templates themselves. Needs a bit of investigation.
I'm new the the VSTS deployment process but pretty good with PowerShell. It should be pretty easy to add by implementing a picklist with the different TF_LOG options defaulting to ERROR and then adding something like this to the invoke-terraform:
$tf_log = Get-VstsInput -Name tf_log
[Environment]::SetEnvironmentVariable("TF_LOG", $tf_log, "Process")
I would do this myself, but I am not entirely sure how to go about it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.