EC2 Dynamic Inventory For Keyed Group Help


I would to ask if anyone know how to escape colon?

assume_role_arn: arn:aws:iam::xxx:role/role
  - key: tags.environment
    separator: ""
  - key: platform_details
    separator: ""
  - key:
    separator: ""
  - key: tags.{% raw %}aws:autoscaling:groupName{% endraw %}
    separator: ""
    prefix: asg
 ansible_host: private_ip_address

The problem is when I sync inventory , i can’t get all the host group by the autoscaling group name.

I suspect is due to the “:” issue.

Please assist if anyone know.

While the two types of accessors in Jinja are often interchangeable, . as an accessor can only be used with valid Python identifiers. For keys that do not adhere to the rules for identifiers you have to use square brackets.

  - key: tags['aws:autoscaling:groupName']
    separator: ""
    prefix: asg