Direct dependencies between two resources causes IndexOutOfBoundsException #1387
Labels
area/sdks
SDKs
kind/bug
Some behavior is incorrect or out of spec
resolution/fixed
This issue was fixed
What happened?
During development of Java version of pulumi-terraform an IndexOutOfBoundsException was thrown due to direct dependency between two resources.
Example
In this example two remote state references are created, the second using
valueFromBucketOne
which was taken from the first.Output of
pulumi about
CLI
Version 3.121.0
Go Version go1.22.4
Go Compiler gc
Host
OS debian
Version 12.5
Arch x86_64
Backend
Name ***
URL file://~
User ***
Organizations
Token type personal
Additional context
The issue is in DeploymentImpl.java:
The Builder of ReadResourceRequest initialises a zero length array to hold dependencies, then if allDirectDependencyUrns is not empty, setDependencies is called for each index i. This causes a set to be called to an invalid index on the underlying array.
PR to follow...
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: