Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document use of tags in target_mapping #19

Merged

Conversation

mattock
Copy link
Contributor

@mattock mattock commented Jun 5, 2021

While using tags in target_mapping is trivial, it was not documented at all afaics. I actually had to look into the code and do some ad hoc debugging before I realized how to do it.

Being able to refer to targets using a human-readable name (e.g. "Name" tag of the EC2 instance) is a big usability feature so better document it.

@mattock mattock requested a review from a team as a code owner June 5, 2021 06:34
@CLAassistant
Copy link

CLAassistant commented Jun 5, 2021

CLA assistant check
All committers have signed the CLA.

@@ -24,7 +24,7 @@ The AWS Inventory plugin supports looking up running AWS EC2 instances. It suppo
- `aws_access_key_id`: The AWS access key id to use. (optional)
- `aws_secret_access_key`: The AWS secret access key to use. (optional)
- `filters`: The [filter request parameters](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html) used to filter the EC2 instances by. Filters are name-values pairs, where the name is a request parameter and the values are an array of values to filter by. (optional)
- `target_mapping`: A hash of target attributes to populate with resource values. The following attributes are available.
- `target_mapping`: A hash of target attributes to populate with resource values. Tags can referenced with tag.\<key\> (e.g. tag.Name). The following attributes are available.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have time, this seems like it might be worth adding to the example at the bottom of this document as well, for visibility. Agreed that this is incredibly useful and not documented at all! I think just adding a new configuration option would be good, so something like changing the example to be:

        target_mapping:
          name: public_dns_name
          uri: public_ip_address
          config:
            ssh:
              host: public_dns_name
              user: tag.User

@lucywyman
Copy link
Contributor

I think we can just merge this as-is and add the example as a separate PR. Thanks again!

@lucywyman lucywyman merged commit 5634ba0 into puppetlabs:main Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants