# Opennebula terraform variables

**URL:** <https://forum.opennebula.io/t/opennebula-terraform-variables/8380>\
**Category:** Product Support\
**Created:** [April 29, 2020, 9:44am UTC](https://forum.opennebula.io/t/opennebula-terraform-variables/8380 "2020-04-29T09:44:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![define](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@define](https://forum.opennebula.io/u/define)\
**Post date:** [April 29, 2020, 9:44am UTC](https://forum.opennebula.io/t/opennebula-terraform-variables/8380/1 "2020-04-29T09:44:19Z")

</div>

Hi.  
I need some help with export Opennebula variables to terraform.  
In a .tr file i add:

> ```
> provider "opennebula" {
> endpoint = "http://192.168.1.55:2633/RPC2"
> username = "terraform"
> password = "password"
> }
> 
> ```

Everything is working correctly.

But I don’t want to keep credentials in the .tf file, so i add the credentials to linux variables:

> ```
> export TF_VAR_endpoint=http://192.168.1.55:2633/RPC2
> export TF_VAR_username=terraform
> export TF_VAR_password=password
> 
> ```

But when i run `terraform plan` i get:

> ```
> provider.opennebula.endpoint
> The URL to your public or private OpenNebula
> 
> Enter a value: 
> 
> ```

How to add variables correctly?

---

<div class="post-metadata">

**Author:** ![Bishop](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/bishop/32/6167_2.png) [@Bishop](https://forum.opennebula.io/u/Bishop)\
**Post date:** [April 30, 2020, 2:17pm UTC](https://forum.opennebula.io/t/opennebula-terraform-variables/8380/2 "2020-04-30T14:17:06Z")

</div>

I found the solution to a similar problem in the TF documentation. Are you missing a series of variable statements to link the env variables into TF?

```
variable "endpoint" {}
variable "username" {}
variable "password" {}

```

…which you then link into the code?

```
provider "opennebula" {
  endpoint = var.endpoint
  username = var.username
  password = var.password
}

```

I’d choose better variable names, but I wrote that to match the environment that is being sent into TF by your code above.

TL;DR - you now need stubbed variable definitions to position your environment variables into the TF code, and you need to use those variables in a provider specification.
