terraforming icon indicating copy to clipboard operation
terraforming copied to clipboard

terraforming should import connected resources using variables

Open zdexter opened this issue 8 years ago • 3 comments

Right now, terraforming ec2 will produce a hardcoded list of related resources' internal AWS identifiers. But terraform supports variables, which allow you to, say, create security groups and ec2 instances on one terraform run, as opposed to creating these dependencies first, then update the ec2 resources' security group IDs in your aws_instance blocks.

terraforming should support importing connected resources, such as security groups, and connecting them to parent resources using variables.

zdexter avatar Jul 20 '15 20:07 zdexter

I'm sorry but I have no plan to implement this feature right now. If you really need this feature, I always welcome pull request :octocat:

Terraforming generates one resource at every command execution, not generate multiple resources at once. I think it is not a good way to include other resource dependencies to generated result. Moreover, this feature increases a complexity of codes... I'd like to keep it simple.

dtan4 avatar Aug 01 '15 09:08 dtan4

@dtan4 I'm aware that you have no plans to support this feature, but this would be incredibly useful. It's rather difficult to have to go in and manually replace hardcoded references with variables, especially when you have something like 20 of them - this feature would allow for a truly exportable and, more importantly, portable infrastructure. I'd find working on this feature to be rather interesting if I can get my ruby chops up to snuff.

autotune avatar Mar 01 '16 19:03 autotune

+1 I've created a script which search-replace the .tf file from hardcoded values to variable references for that.

Binternet avatar Jun 13 '18 15:06 Binternet