I'm using terraform to orchestrate stuff across a few aws accounts, so pretty much everything is going in with a specific provider, and this has worked beautifully right up until trying to put the state file in a remote bucket.
If I leave it to default, it works, but I really would prefer to specify providers to avoid future things being accidentally put in the wrong account.
```
provider "aws" {
alias = "infrastructure-account"
profile = "${var.infra_profile_name}"
region = "eu-west-1"
}
provider "aws" {
alias = "target"
profile = "${var.target_profile_name}"
region = "eu-west-1"
}
```
```
resource "terraform_remote_state" "bucket" {
backend = "s3"
provider = "aws.infrastructure-account"
config {
bucket = "els-terraform-state"
key = "${template_file.state_key.rendered}"
region = "eu-west-1"
}
}
```
```
(saml)vagrant@vagrant-ubuntu-trusty-64 (master *) /vagrant/Nicholas/Aegis2: terraform -v
Terraform v0.6.15
(saml)vagrant@vagrant-ubuntu-trusty-64 (master *) /vagrant/Nicholas/Aegis2: terraform plan -var-file=evpc.tfvars
There are warnings and/or errors related to your configuration. Please
fix these before continuing.
Errors:
* terraform_remote_state.bucket: Provider doesn't support resource: terraform_remote_state
```