Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State path not output to command line via 'apply' command #13042

Closed
seenickcode opened this issue Mar 24, 2017 · 8 comments
Closed

State path not output to command line via 'apply' command #13042

seenickcode opened this issue Mar 24, 2017 · 8 comments
Labels
bug cli v0.9 Issues (primarily bugs) reported against v0.9 releases

Comments

@seenickcode
Copy link

Hi there again, this is a minor issue but the State path isn't being output when running 'terraform apply'

terraform apply
aws_instance.example: Creating...
  ami:                         "" => "ami-737e2416"
  associate_public_ip_address: "" => "<computed>"
  availability_zone:           "" => "<computed>"
  ebs_block_device.#:          "" => "<computed>"
  ephemeral_block_device.#:    "" => "<computed>"
  instance_state:              "" => "<computed>"
  instance_type:               "" => "t2.micro"
  ipv6_addresses.#:            "" => "<computed>"
  key_name:                    "" => "<computed>"
  network_interface_id:        "" => "<computed>"
  placement_group:             "" => "<computed>"
  private_dns:                 "" => "<computed>"
  private_ip:                  "" => "<computed>"
  public_dns:                  "" => "<computed>"
  public_ip:                   "" => "<computed>"
  root_block_device.#:         "" => "<computed>"
  security_groups.#:           "" => "<computed>"
  source_dest_check:           "" => "true"
  subnet_id:                   "" => "<computed>"
  tenancy:                     "" => "<computed>"
  vpc_security_group_ids.#:    "" => "<computed>"
aws_instance.example: Still creating... (10s elapsed)
aws_instance.example: Still creating... (20s elapsed)
aws_instance.example: Creation complete (ID: i-0f2040856d3beaaa7)

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:

"State path:" is blank

Terraform Version

terraform -v
Terraform v0.9.1

Steps to Reproduce

terraform.tf

provider "aws" {
  access_key = "MYKEY"
  secret_key = "MYSECRET"
  region     = "us-east-2"
}

resource "aws_instance" "example" {
  ami           = "ami-0d729a60"
  instance_type = "t2.micro"
}
@salewski
Copy link
Contributor

salewski commented Apr 2, 2017

Just noting that I see this behavior with terraform-0.9.2 as well:

$ terraform -v
Terraform v0.9.2

The terraform.tfstate file is created correctly, but its name is simply not displayed on the terminal after the "State path:" label.

@apparentlymart
Copy link
Contributor

One approach we could take here is to add a new method to the backend interface to produce a human-oriented string representation of the state location, and then change the caption to the more generic "State location:"

When on S3, for example, we could show it tersely as an s3: URI. Not all backend will have such a canonical string representation, but I think we should always be able to find some reasonable string to show.

(A good question here is to what extent we want to expose the physical storage details in the UI. For example, would we expose the object paths generated for S3 when non-default state environments are in use?)

@kylemoschetto
Copy link

I'm seeing a similar problem of nothing displayed to the state path, but I'm also not seeing a .tfstate file being created. This is also causing me to not be able to destroy the things I'm creating/applying.


Apply complete! Resources: 14 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 -v
Terraform v0.9.2
Do you really want to destroy?
  Terraform will delete all your managed infrastructure.
  There is no undo. Only 'yes' will be accepted to confirm.

  Enter a value: yes


Destroy complete! Resources: 0 destroyed.

@bamb00
Copy link

bamb00 commented Jul 9, 2017

Hi, I also run into this issue in v0.9.11. Did not get this problem in 0.6.16. After upgrading to 0.9.11 the "State path: " is blank.

@apparentlymart
Copy link
Contributor

apparentlymart commented Jul 19, 2017

Hi @kylemoschetto and @bamb00! Sorry for the delayed response here.

Are both of you using the "local" backend? (That's the default if you didn't specify a different backend explicitly). If so, there being no local state file is the intended behavior in 0.9 and above, since the state now lives only in the remote location, but this message showing up in that case was indeed a bug, which was fixed in #15435.

@dwayne-mss
Copy link

@apparentlymart, Not sure I understand your post. If I'm using the "local" backend, then no local state file is produced? Or just no local state file is displayed to console?

@apparentlymart apparentlymart added cli and removed core labels Nov 7, 2018
@hashibot hashibot added the v0.9 Issues (primarily bugs) reported against v0.9 releases label Aug 29, 2019
@hashibot
Copy link
Contributor

Hello! 🤖

This issue relates to an older version of Terraform that is no longer in active development, and because the area of Terraform it relates to has changed significantly since the issue was opened we suspect that the issue is either fixed or that the circumstances around it have changed enough that we'd need an updated issue report in order to reproduce and address it.

If you're still seeing this or a similar issue in the latest version of Terraform, please do feel free to open a new bug report! Please be sure to include all of the information requested in the template, even if it might seem redundant with the information already shared in this issue, because the internal details relating to this problem are likely to be different in the current version of Terraform.

Thanks!

@ghost
Copy link

ghost commented Sep 29, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Sep 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug cli v0.9 Issues (primarily bugs) reported against v0.9 releases
Projects
None yet
Development

No branches or pull requests

8 participants