I've got some Terraform that provisions a mix of Linux and Windows EC2 instances using separate private modules such that the module outputs provide the private IP address and FQDN and hide the differences in OS provisioning and instance configuration.
I'd like to use your module to retrieve this output information from the state file for running further Bolt plans but I need to be able to differentiate between the two operating systems for the purposes of configuring the transport (SSH vs WinRM, etc.). The problem is both modules contain a Terraform resource like so:
resource "aws_instance" "server" {
...
}
I can't find a way to only find the aws_instance resources that are in the linux module versus only finding the aws_instance resources in the windows module. If I configure the inventory.yaml like so:
I get every instance. I was perhaps expecting the inventory plugin to stick to the interface of using the top-level/root module Terraform outputs rather than potentially find any resources encapsulated within the modules. It also means should the Terraform code change internally (but maintain the same output names), this inventory configuration will break.
Expected Behavior
One solution might be to allow access to the outputs, i.e. to access the private_dns output on both modules:
Describe the Bug
I've got some Terraform that provisions a mix of Linux and Windows EC2 instances using separate private modules such that the module outputs provide the private IP address and FQDN and hide the differences in OS provisioning and instance configuration.
I'd like to use your module to retrieve this output information from the state file for running further Bolt plans but I need to be able to differentiate between the two operating systems for the purposes of configuring the transport (SSH vs WinRM, etc.). The problem is both modules contain a Terraform resource like so:
I can't find a way to only find the aws_instance resources that are in the linux module versus only finding the aws_instance resources in the windows module. If I configure the
inventory.yaml
like so:I get every instance. I was perhaps expecting the inventory plugin to stick to the interface of using the top-level/root module Terraform outputs rather than potentially find any resources encapsulated within the modules. It also means should the Terraform code change internally (but maintain the same output names), this inventory configuration will break.
Expected Behavior
One solution might be to allow access to the outputs, i.e. to access the private_dns output on both modules:
Environment