I noticed when I run terraform version in command prompt is not giving the correct terraform version, I just downloaded and kept in c:/terraform folder.
If you notice terraform version command in command prompt is not giving the correct terraform version, you just downloaded and kept in c:/terraform path then check these two things.
Check whether you Updated system path variable with c:/terraform
Check where terraform was installed using (get-command terraform.exe).Path in PowerShell.
Check whether you already installed terraform using chocolatey.
Related
I setup Gitlab runner on a local Windows machine. There are some jobs defined, but one of them is "terraform version", but the job failed in Gitlab CI, below is the error,
$ terraform version
terraform: The term 'terraform' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Note: Terraform works fine locally without Gitlab when executed from the working directory.
Can someone through some lights here, thanks.
As windows issue is not resolved or can't be resolved in my case, i have tried another option ie. by installing Windows Subsystem for Linux (WSL) on the same windows machine.
Thanks all.
I found the tools tfenv and tfswitch to easily and quickly change the terraform and terragrunt version - and I guess the tools work cause people use it, but for some reason they don't chagne the versions on my computer, after I run let's say
$ tfswitch 0.12.25
Downloading https://releases.hashicorp.com/terraform/0.12.25/terraform_0.12.25_darwin_amd64.zip to terraform_0.12.25_darwin_amd64.zip
Downloading ...
18220765 bytes downloaded.
Switched terraform to version "0.12.25"
It seems I correctly switch to version 0.12.25, but after checking it with terraform it didin't change
$ terraform --version
Terraform v0.12.18
+ provider.google v3.29.0
+ provider.random v2.3.0
Your version of Terraform is out of date! The latest version
is 0.12.28. You can update by downloading from https://www.terraform.io/downloads.html
same goes for tfenv tool, anyone met with that problem ? I tried running it with sudo as well, but without success - I see the binaries are being downloaded to config dir of those tools and I even add them to PATH, but they don't overwrite the main terraform or terragrunt binaries that's why I'm left with the old versions, any thoughts ?
I had the same problem in the past, I solved it by removing the reference of Terraform from .bash_profile or .zshrc for zsh.
I'm having the exact same problem whilst using tfswitch
tfswitch 0.13.0
Installing terraform at /home/bin
Switched terraform to version "0.13.0"
terraform -v
Terraform v0.12.26
Terraform doesn't actually switch the versions and remains at v0.12.26
The answer provided on this post for removing the tf references located in .bash_profile doesn't appear to be working for me as the only reference to $PATH is the binaries for tfswitch for /home/bin which is required for it to work.
I'm trying to get a Lambda happy version of XPDF's pdftohtml to work but am having no luck.
So far the following has been tried:
Created Docker container running the latest amazonlinux image
I've copied the source code into this container and ran:
yum install cmake, gcc, gcc-c++, freetype-devel
Compiling the code with cmake produces a binary which executes perfectly in the container which should be the same OS and environment as Lambda.
I've verified the version of libc.so.6 as 2.26 within the container.
I've copied this into my AWS zip folder and included the following dependencies in a lib folder ready to upload:
libfreetype.so.6.10.0, libpng15.so.15, libstdc++.so.6.0.24
These dependencies are copied directly from the container used to compile the code.
Python function then connects these via
os.environ.update(dict(LD_LIBRARY_PATH='/var/task/lib'))
At the end of this, I run the function and get the following error code:
/var/task/pdftohtml: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /var/task/lib/libstdc++.so.6)
I've no idea where the GLIBC_2.18 comes from as this version isn't present in the container used to compile it.
Really stumped but keen to get it finished as it would produce a lightweight binary perfect for a Lambda function!
Where am I going wrong?
EDIT
SOLVED - see the comments below. There are two versions of AWS Linux and Lambda runs this version
I ran in an EC2 instance as one of the commenters suggested. Whilst the libstdc++.so.6.24 looked to be the right version, as it was itself compiled with a different GLIBC version, it throws an error. Compiling in EC2 from the source code worked fine. The other trick was making sure the CXX_FLAGS included -std=c++11. Thanks to those who contributed to help me solve this!
I've no idea where the GLIBC_2.18 comes from as this version isn't present in the container used to compile it.
I think you don't understand symbol version dependencies (see here).
The error message is telling you that your libstdc++.so.6 was built against GLIBC-2.18 or newer, and you are running against GLIBC-2.17 or older.
Where am I going wrong?
Your build environment is targeting something much newer than what your deployment environment contains.
You need to either find a built environment that matches your deployment target, or you need to change your deployment target to be not older than your build environment.
I am using the following instructions:
https://console.bluemix.net/docs/terraform/setup_cli.html#setup_cli
When I run terraform init
I get the following error:
Provider "ibm" not available for installation.
A provider named "ibm" could not be found in the official repository.
This may result from mistyping the provider name, or the given provider may
be a third-party provider that cannot be installed automatically.
In the latter case, the plugin must be installed manually by locating and
downloading a suitable distribution package and placing the plugin's executable
file in the following directory:
terraform.d/plugins/windows_amd64
Terraform detects necessary plugins by inspecting the configuration and state.
To view the provider versions requested by each module, run
"terraform providers".
I am on windows 10 pc, I tried placing following executable under:
$HOME/terraform.d/plugins/windows_amd64/terraform-provider-ibm_v0.14.1.exe
Can anyone point why this is not working?
I think there is a bug in instructions of IBM Cloud. But when I put the executable file under the following path it works:
$HOME\terraform.d\plugins\terraform-provider-ibm_v0.14.1.exe
Hope this answer will help save someone some time.
There are clear steps on how to configure the IBM Cloud Provider for Terraform in this solution tutorial on both Windows and non-windows operating systems.
On Windows, the file needs to be placed in terraform.d/plugins beneath your user's "Application Data" directory.
Run the below commands on a command prompt Provider Configuration
MD %USERPROFILE%\AppData\terraform.d\plugins
MOVE PATH_TO_UNZIPPED_PROVIDER_FILE\terraform-provider-ibm.exe %USERPROFILE%\AppData\terraform.d\plugins
Launch Windows Powershell (Start + R > Powershell) and run the below command to create terraform.rc file
echo > $env:APPDATA\terraform.rc
At the first prompt, enter the below content
# ~/.terraformrc
providers {
ibm = "PATH_TO_YOUR_APPDATA_PLUGINS/terraform-provider-ibm.exe"
}
The file terraform.rc should be saved with Encoding ANSI and you have to be sure of not having weird characters.
I have followed these instructions.
And as far as I can tell I have successfully installed node.js azure tools. No error - nothing to suggest it failed.
However, I cannot, and the documentation says, simple run "azure"...
Maybe there is something I am missing with node.js?
There are a few problems you may be experiencing.
First of all, I would ensure you are running Node.js v0.6.20. You can do this by opening the command prompt and running:
node -v
You should have v0.6.20 echoed back.
If this doesn't work, you may be missing a path variable to Node.js or the NPM cache. Verify the Environment variables exist by running [in the command prompt]:
path
you should see two paths:
%appdata%\npm
[x64 Machine]
%programfiles(x86)%\nodejs\
[x86 Machine]
%programfiles%\nodejs\
If this doesn't work, I would check to ensure that the azure module was loaded into the %appdata%\npm\node_modules directory.
It could be the PATH issue. In my case, the azure program is located at ~/.npm-global/bin.
run "export PATH=$PATH:~/.npm-global/bin". Or just add to bash source file