Skip to content

terraform output not display the outputs #35105

@scott-doyland-burrows

Description

@scott-doyland-burrows

Terraform Version

Terraform v1.8.2
on linux_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v4.30.0
+ provider registry.terraform.io/hashicorp/aws v5.47.0
+ provider registry.terraform.io/hashicorp/external v2.3.3

Terraform Configuration Files

Relevant parts are:

In a root module:

output "a" {
  value = module.terraform-module-ou.a
}

output "b" {
  value = "from root module"
}

In a submodule:

output "a" {
  value = "from module"
}

Debug Output

I run terraform apply and then a terraform output and see this:


No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

a = "from module"
b = "from root module"
doylands@HGRSDELTCG30106:~$ terraform output
╷
│ Warning: No outputs found
│
│ The state file either has no outputs defined, or all the defined outputs are empty. Please define an output in your configuration with the `output` keyword and run `terraform refresh` for it to become
│ available. If you are using interpolation, please verify the interpolated value is not empty. You can use the `terraform console` command to assist.

Expected Behavior

The outputs should be displayed

Actual Behavior

terraform says there are no outputs.

Steps to Reproduce

terraform apply
terraform output

Additional Context

I can see the state file has the outputs:

{
  "version": 4,
  "terraform_version": "1.8.2",
  "serial": 56,
  "lineage": "1cf6b725-b0a4-0b5f-915f-963481c8eca4",
  "outputs": {
    "a": {
      "value": "from module",
      "type": "string"
    },
    "b": {
      "value": "from root module",
      "type": "string"
    }
  },

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclicloudRelated to Terraform Cloud's integration with Terraformnewnew issue not yet triagedwaiting for reproductionunable to reproduce issue without further information

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions