Skip to content

aws_ec2_metadata performs network initialization in build() #25162

Description

@pront

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

aws_ec2_metadata currently performs network-dependent work in TransformConfig::build().

Today that includes:

  • creating the HTTP client
  • attempting an initial metadata refresh
  • spawning the background refresh task

PR #25161: This makes it an exception for vector validate --no-environment, since normal transform build() cannot be used safely for this transform without touching the environment.

Configuration

data_dir: "${VECTOR_DATA_DIR}"

sources:
  in:
    type: demo_logs
    format: shuffle
    lines:
      - log

transforms:
  meta:
    type: aws_ec2_metadata
    inputs:
      - in
    endpoint: "http://127.0.0.1:9"

sinks:
  out:
    type: blackhole
    inputs:
      - meta

Version

0.54

Debug Output

$ vector validate aws/ec2_meta.yaml
√ Loaded ["/Users/pavlos.rontidis/RustroverProjects/vector/pront/configs/aws/ec2_meta.yaml"]
2026-04-10T14:59:34.187345Z  WARN transform{component_kind="transform" component_id=meta component_type=aws_ec2_metadata}: vector::internal_events::http_client: HTTP error. error=error trying to connect: tcp connect error: Connection refused (os error 61) error_type="request_failed" stage="processing"

Component errors
----------------
x Transform "meta": Unable to fetch metadata authentication token: Failed to make HTTP(S) request: error trying to connect: tcp connect error: Connection refused (os error 61).

--------
$ vector validate --no-environment /Users/pavlos.rontidis/RustroverProjects/vector/pront/configs/aws/ec2_meta.yaml
√ Loaded ["/Users/pavlos.rontidis/RustroverProjects/vector/pront/configs/aws/ec2_meta.yaml"]
--------------------------------------------------------------------------------------------
                                                                                   Validated

Example Data

No response

Additional Context

No response

References

PR #25161

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions