using terraform_remote_state as a resource is deprecated; consider using the data source instead

1,226 views
Skip to first unread message

Gonzalo Fernandez

unread,
Aug 3, 2016, 9:57:47 AM8/3/16
to Terraform
Hi


I am upgrading to Terraform 0.7 and when running the plan I got the following

 using terraform_remote_state as a resource is deprecated; consider using the data source instead

So I got module 

resource "terraform_remote_state" "remote_s3_bucket" {


  backend = "s3"




  config {


    bucket = "${var.s3_bucket}"


    key    = "acct_mgmt_terraform/terraform.tfstate"


  }


}


I do not really understand what mean with that warning message about using the data source instead?

Any ideas?

Thanks!



Paul Hinze

unread,
Aug 3, 2016, 10:18:05 AM8/3/16
to terrafo...@googlegroups.com
Hi Gonzalo,

You can find more information in the 0.7 Upgrade Guide, which we're recommending that all upgrading users look over to learn about issues like this:


Hope this helps!

Paul

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/281f7d6c-0f02-4ad8-890d-6dfc304a22cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gonzalo Fernandez

unread,
Aug 3, 2016, 3:21:50 PM8/3/16
to Terraform
Hey Paul,

I went through the documentation a couple of time as I wasn't very clear about any of this.

I realised this should be the "Migrating to Data Sources" part.

so
resource "terraform_remote_state" "foo" {
    backend = "s3"
    config {
        bucket = "terraform-state-prod"
        key = "network/terraform.tfstate"
        region = "us-east-1"
    }
}

Should be then:

data "terraform_remote_state" "foo" {
    backend = "s3"
    config {
        bucket = "terraform-state-prod"
        key = "network/terraform.tfstate"
        region = "us-east-1"
    }
}

If I understand this correctly?

I believe most of terraform users would appreciate a bit more extensive information and sometimes the document pages tagged with version so we can have a better idea about versions.
A document as the following: 
Not sure how relevant or better to say : "accurate" is for the latest release so 0.7

Thanks again for the URL, and it's nice to hear from you again.

Gonzalo
Reply all
Reply to author
Forward
0 new messages