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
This may be more of a usage clarification, or a deficiency of how the provider is implemented. I'd like to create my heroku_space from scratch and peer into my VPC both which are managed in the same Terraform.
In order to create a peering connection, I need to refer to the heroku_space_peering_info. Without the space created first, the data resource will fail. I added an explicit depends_on in order for heroku_space to be created first before I can get the peering info.
However, on subsequent runs, the depends_on in heroku_space_peering_info will force the peering connection to be consistently replaced. If I remove the explicit depends_on after the initial run, subsequent runs work correctly.
For a dev environment this may be fine, but for production you need stability in the config.
One way to work around it is to use an input variable to set the identity of the resource once it’s created, instead of relying on dynamic data queries.
Maybe there’s an issue open on Terraform, or some other way to give them feedback, since they literally say not to do this in their docs 😕
With this obviously frowned upon, would it make sense for aws_account_id and vpc_id to be exposed through heroku_space resource instead of having an independent data resource?
If I have to create a workaround or not use best practices, I'm wondering if this is a flaw in how the provider is implemented and not Terraform itself.
That’s an interesting idea @mjuarez , to expose those attributes directly on the Space resource. If we can get that data in a data source, then we should be able to get it as part of the resource’s create method.
Call it what you want, but thank you for helping to brainstorm a solution instead of just dumping the problem here.
I will have a bit more capacity to address in a few weeks. Feel free to open PR to propose the actual revision.
This may be more of a usage clarification, or a deficiency of how the provider is implemented. I'd like to create my heroku_space from scratch and peer into my VPC both which are managed in the same Terraform.
In order to create a peering connection, I need to refer to the
heroku_space_peering_info
. Without the space created first, the data resource will fail. I added an explicitdepends_on
in order forheroku_space
to be created first before I can get the peering info.However, on subsequent runs, the
depends_on
inheroku_space_peering_info
will force the peering connection to be consistently replaced. If I remove the explicitdepends_on
after the initial run, subsequent runs work correctly.Terraform Version
0.12.10
Heroku Provider Version
2.2.1
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
I can create a space from scratch, retrieve peering information, and can setup a peering connection from AWS.
Actual Behavior
The peering connection needs to be replaced on every subsequent run.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
with HCL from above.The text was updated successfully, but these errors were encountered: