You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resource"random_string""test" {
length=6special=falseupper=false
}
data"null_data_source""test" {
count=4inputs={
test ="${random_string.test.result}-${count.index}"
}
}
resource"null_resource""test" {
count=4triggers={
test ="${data.null_data_source.test.*.outputs.test[count.index]}"
}
}
Output
terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
------------------------------------------------------------------------
Error: Error running plan: 1 error(s) occurred:
* null_resource.test: 4 error(s) occurred:
* null_resource.test[2]: Resource 'data.null_data_source.test' does not have attribute 'outputs.test' for variable 'data.null_data_source.test.*.outputs.test'
* null_resource.test[3]: Resource 'data.null_data_source.test' does not have attribute 'outputs.test' for variable 'data.null_data_source.test.*.outputs.test'
* null_resource.test[0]: Resource 'data.null_data_source.test' does not have attribute 'outputs.test' for variable 'data.null_data_source.test.*.outputs.test'
* null_resource.test[1]: Resource 'data.null_data_source.test' does not have attribute 'outputs.test' for variable 'data.null_data_source.test.*.outputs.test'
If I replace ${random_string.test.result} in the data source input with a hardcoded string then the plan succeeds:
data"null_data_source""test" {
count=4inputs={
test ="test-${count.index}"
}
}
resource"null_resource""test" {
count=4triggers={
test ="${data.null_data_source.test.*.outputs.test[count.index]}"
}
}
terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
data.null_data_source.test[0]: Refreshing state...
data.null_data_source.test[1]: Refreshing state...
data.null_data_source.test[2]: Refreshing state...
data.null_data_source.test[3]: Refreshing state...
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ null_resource.test[0]
id: <computed>
triggers.%: "1"
triggers.test: "test-0"
+ null_resource.test[1]
id: <computed>
triggers.%: "1"
triggers.test: "test-1"
+ null_resource.test[2]
id: <computed>
triggers.%: "1"
triggers.test: "test-2"
+ null_resource.test[3]
id: <computed>
triggers.%: "1"
triggers.test: "test-3"
The text was updated successfully, but these errors were encountered:
Hi @hbuckle,
Sorry you've come across this unexpected behavior. There are other tickets covering this, such as #17034, so I am going to close this one - please go give a 👍 on #17034!
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
locked and limited conversation to collaborators
Apr 1, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I suspect this is related to the already reported data source lifecycle issues but I couldn't see this use case exactly
Terraform Version
Terraform Configuration Files
Output
If I replace ${random_string.test.result} in the data source input with a hardcoded string then the plan succeeds:
The text was updated successfully, but these errors were encountered: