This issue was originally opened by @jflammia as hashicorp/terraform#15085. It was migrated here as part of the provider split. The original body of the issue is below.
When a module or resource has an output variable of id, it cannot be imported using data.terraform_remote_state. data.terraform_remote_state will pull in the ID of the remote state itself (which happens to be a timestamp) instead of the resource's output variable id.
My work-around was to rename my module's output variable to something other than id. id seems to be a reserved word, so I don't know if this is a simple omission from documentation or this a valid action that has a bug in it.
Terraform Version
Terraform v0.9.6
Affected Resource(s)
data.terraform_remote_state
Expected Behavior
The output variable id's value should be used.
Actual Behavior
The remote state's id value is used.
Steps to Reproduce
Create a resource with an output variable named id
output "id" {
value = "${aws_security_group.new_sg.id}"
}
### Important Factoids
If the remote state file is visually inspected, you can see that the timestamp that is being pulled in for the `id` field is the `id` of the remote state, not the output variable `id`. Renaming the output variable to something other than `id` is the work-around for this issue.
This issue was originally opened by @jflammia as hashicorp/terraform#15085. It was migrated here as part of the provider split. The original body of the issue is below.
When a module or resource has an output variable of
id
, it cannot be imported usingdata.terraform_remote_state
.data.terraform_remote_state
will pull in the ID of the remote state itself (which happens to be a timestamp) instead of the resource's output variableid
.My work-around was to rename my module's output variable to something other than
id
.id
seems to be a reserved word, so I don't know if this is a simple omission from documentation or this a valid action that has a bug in it.Terraform Version
Terraform v0.9.6
Affected Resource(s)
data.terraform_remote_state
Expected Behavior
The output variable
id
's value should be used.Actual Behavior
The remote state's
id
value is used.Steps to Reproduce
id
Import the state using
terraform_remote_state
Reference the output variable
id
in another resourceterraform plan
, the value ofsecurity_group_id
is a timestamp (similar to2017-06-05 15:15:55.60991551 +0000 UTC
)Plan: 0 to add, 1 to change, 0 to destroy.