EC2 Dynamic Inventory For Keyed Group Help

Hi,

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

---
assume_role_arn: arn:aws:iam::xxx:role/role
keyed_groups:
  - key: tags.environment
    separator: ""
  - key: platform_details
    separator: ""
  - key: state.name
    separator: ""
  - key: tags.{% raw %}aws:autoscaling:groupName{% endraw %}
    separator: ""
    prefix: asg
compose:
 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