enhancement(aws_ec2_metadata transform): support additional IMDS categories#25533
Open
xfocus3 wants to merge 1 commit into
Open
enhancement(aws_ec2_metadata transform): support additional IMDS categories#25533xfocus3 wants to merge 1 commit into
xfocus3 wants to merge 1 commit into
Conversation
…gories Add support for the following IMDS instance metadata categories to the aws_ec2_metadata transform, requestable via the `fields` option: - availability-zone-id (placement/availability-zone-id) - partition (services/partition) - domain (services/domain) - placement-group-name (placement/group-name) - placement-partition-number (placement/partition-number) - host-id (placement/host-id) - autoscaling-target-lifecycle-state (autoscaling/target-lifecycle-state) These help locate impacted instances (e.g. by availability zone ID, which is consistent across accounts, or by Dedicated Host ID) and correlate EC2 Auto Scaling lifecycle events with on-instance events. Each new field is opt-in and only fetched when explicitly listed in `fields`, so there is no change in behavior for existing configurations. Closes vectordotdev#22069
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the
aws_ec2_metadatatransform to support additional IMDS instance metadata categories, as requested in #22069. The following fields can now be requested via thefieldsoption:availability-zone-id(placement/availability-zone-id) — unlike the availability zone name, the AZ ID is consistent across AWS accounts, which is useful for correlating zonal impact in multi-account deployments.partition(services/partition)domain(services/domain)placement-group-name(placement/group-name)placement-partition-number(placement/partition-number)host-id(placement/host-id) — useful for identifying bad Dedicated Hosts (e.g. EC2 Mac instances).autoscaling-target-lifecycle-state(autoscaling/target-lifecycle-state) — useful for correlating EC2 Auto Scaling lifecycle hook events with on-instance events.Each new field follows the existing pattern for optional categories (such as
account-idandtags): it is opt-in and only fetched when explicitly listed infields. The default field allowlist is unchanged, so there is no change in behavior or additional IMDS requests for existing configurations.Vector configuration
How did you test this PR?
cargo check --lib --no-default-features --features transforms-aws_ec2_metadata— passescargo test --lib --no-default-features --features transforms-aws_ec2_metadata aws_ec2_metadata— passescargo fmt --check— passescargo clippy --lib --no-default-features --features transforms-aws_ec2_metadata -- -D warnings— passesThe new categories are all simple flat IMDS GET endpoints fetched through the existing
get_metadatahelper (which already handles IMDSv2 tokens and404responses by skipping the field), so they reuse the transform's existing token/refresh/error-handling logic. IMDS paths were verified against the AWS EC2 instance metadata categories documentation.Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References