Closed luckyraul closed 4 years ago
I would expect:
groups:
- name: xxx_lb
targets:
- _plugin: terraform
dir: ../xxx
resource_type: aws_instance.lb
target_mapping:
uri: public_ip
To create a new target for each instance of aws_instance.lb.public_ip
. If this is not currently working it seems like maybe there is an issue with resolving that data from the statefile. Can you try just running the resolve_reference task (see https://github.com/puppetlabs/puppetlabs-terraform/blob/master/tasks/resolve_reference.json for paramter details).? This might help you understand what is going on.
It is in my issue
{"target":"localhost","action":"task","object":"terraform::resolve_reference","status":"success","value":{"value":[{"uri":"xxx.xx.xx.xx"}]}}
This is a part of debug log, I've checked in the ruby code, the uri has a correct ip
Ah, i seee. OK your example is somewhat confusing.
With this command bolt inventory show --targets xxx-lb --debug --detail
i think you have a typo, instead of looking for group xxx_lb
its effectively creating a new target with name/uri xxx-lb
. Can you confirm bolt inventory show --targets xxx_lb --debug --detail
does not create new targets with name,uri
found from statefile?
thanks, this was my issue. Works fine with xxx_lb
Describe the Bug
When I run
bolt inventory show --targets xxx-lb --debug --detail
output: Command returned successfully{"target":"localhost","action":"task","object":"terraform::resolve_reference","status":"success","value":{"value":[{"uri":"xxx.xx.xx.xx"}]}}
Did not find config for xxx-lb in inventory
If I run plan
Expected Behavior
A clear and concise description of what you expected to happen.