# Terraform Module - Output Returns Empty after Successful Run.

**URL:** <https://forum.ansible.com/t/terraform-module-output-returns-empty-after-successful-run/34433>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [January 13, 2021, 8:38pm UTC](https://forum.ansible.com/t/terraform-module-output-returns-empty-after-successful-run/34433 "2021-01-13T20:38:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bharath\_Annamaneni](https://avatars.discourse-cdn.com/v4/letter/b/9de0a6/32.png) [@Bharath\_Annamaneni](https://forum.ansible.com/u/Bharath_Annamaneni)\
**Post date:** [January 13, 2021, 8:38pm UTC](https://forum.ansible.com/t/terraform-module-output-returns-empty-after-successful-run/34433/1 "2021-01-13T20:38:19Z")

</div>

Hello Ansible Users,

I am trying to run/use the Ansible’s Terraform Module to provision the servers in Public Cloud. The Terraform Code works fine when run manually and through Ansible, but, the **Ansible doesn’t return the output of the resources being provisioned by Terraform**.

Per Ansible’s Terraform Module [documentation](https://docs.ansible.com/ansible/latest/collections/community/general/terraform_module.html#return-values) it is expected to return a “output” key on success with the details of the resources being provisioned. But, in my case **its empty.**

**play.yml**

- hosts: localhost  
gather\_facts: false  
become: false

tasks:

- name: Provision AWS  
community.general.terraform:  
project\_path: “/home/terraform/aws-vm”  
state: present  
force\_init: true  
variables:  
type: t2.micro  
register: terraform

- debug:  
var: terraform

**Output:**  
ok: [localhost] =\> {  
“terraform”: {  
“changed”: true,  
“command”: “/usr/bin/terraform apply -no-color -input=false -auto-approve=true -lock=true /tmp/tmp5plmx0xb.tfplan”,  
“failed”: false,  
“outputs”: {},  
“state”: “present”,  
“stderr”: “”,  
“stderr\_lines”: ,  
“stdout”: “aws\_instance.awsvm: Creating…\naws\_instance.awsvm: Still creating… [10s elapsed]\naws\_instance.awsvm: Still creating… [20s elapsed]\naws\_instance.awsvm: Still creating… [30s elapsed]\naws\_instance.awsvm: Still creating… [40s elapsed]\naws\_instance.awsvm: Creation complete after 42s [id=i-068dd9cb7d994abe3]\n\nApply complete! Resources: 1 added, 0 changed, 0 destroyed.\n\nThe state of your infrastructure has been saved to the path\nbelow. This state is required to modify and destroy your\ninfrastructure, so keep it safe. To inspect the complete state\nuse the `terraform show` command.\n\nState path: terraform.tfstate\n”,  
“stdout\_lines”: [  
“aws\_instance.awsvm: Creating…”,  
“aws\_instance.awsvm: Still creating… [10s elapsed]”,  
“aws\_instance.awsvm: Still creating… [20s elapsed]”,  
“aws\_instance.awsvm: Still creating… [30s elapsed]”,  
“aws\_instance.awsvm: Still creating… [40s elapsed]”,  
“aws\_instance.awsvm: Creation complete after 42s [id=i-068dd9cb7d994abe3]”,  
“”,  
“Apply complete! Resources: 1 added, 0 changed, 0 destroyed.”,  
“”,  
“The state of your infrastructure has been saved to the path”,  
“below. This state is required to modify and destroy your”,  
“infrastructure, so keep it safe. To inspect the complete state”,  
“use the `terraform show` command.”,  
“”,  
“State path: terraform.tfstate”  
],  
“workspace”: “default”  
}  
}

**Can anyone please help me resolving the issue.**

---

<div class="post-metadata">

**Author:** ![Jorge\_Rua1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@Jorge\_Rua1](https://forum.ansible.com/u/Jorge_Rua1)\
**Post date:** [January 14, 2021, 10:37am UTC](https://forum.ansible.com/t/terraform-module-output-returns-empty-after-successful-run/34433/2 "2021-01-14T10:37:19Z")

</div>

What ansible documentation say is that the terraform ansible module ouputs Terraform outputs [https://www.terraform.io/docs/configuration/outputs.html](https://www.terraform.io/docs/configuration/outputs.html)

If you don’t have any Terraform output declared in your .tf files you won’t see any output.

HTH
