Skip to content

Conversation

@nmeyerhans
Copy link
Contributor

@nmeyerhans nmeyerhans commented Apr 7, 2023

Issue #, if available: n/a

Description of changes:

There are several commits in this PR. The functionality changes are:

  1. Add --partition support to ec2-metadata, allowing for easy querying of the AWS partition attribute by the instance
  2. Add --quiet support to ec2-metadata to suppress tag keys from the output.

Example:

[ec2-user@ip-10-0-0-230 ~]$ ./ec2-metadata --public-ipv4
public-ipv4: 50.112.150.25
[ec2-user@ip-10-0-0-230 ~]$ ./ec2-metadata --public-ipv4 --quiet
50.112.150.25

and

[ec2-user@ip-10-0-0-230 ~]$ ./ec2-metadata --partition
partition: aws
[ec2-user@ip-10-0-0-230 ~]$ ./ec2-metadata --partition --quiet
aws

This PR also configures automatic shellcheck execution using GitHub Actions, which replaces the earlier CircleCI integration. Results for the current branch are available.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@nmeyerhans nmeyerhans requested a review from keithaws April 7, 2023 05:08
@nmeyerhans nmeyerhans added the enhancement New feature or request label Apr 7, 2023
Noah Meyerhans added 6 commits April 7, 2023 15:41
This lets us extract individual fields from IMDS in a raw form that
can be consumed directly by callers without requiring them to strip
off the keys themselves.
bash is in /usr/bin everywhere we care about.  The /bin path is only
there for backwards compatibility.
Document --tags and --all

Minor formatting fixes
Copy link

@kemotaha kemotaha left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@nmeyerhans nmeyerhans merged commit 2939e0f into amazonlinux:main Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants