Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Respect AWS_EC2_METADATA_SERVICE_ENDPOINT env var #10873

Copy link
Copy link

Description

@clayrosenthal
Issue body actions

Is your feature request related to a problem? Please describe.
When on non-EC2 environments, it's possible to use the env var AWS_EC2_METADATA_SERVICE_ENDPOINT to use IMDS on a host other than 169.254.169.254. The aws sdk docs describe the env var more. On a related note you may also want to support the IPv6 endpoint of [fd00:ec2::254] as another default.

Describe the solution you'd like
If the env var is set, its value is respected and used instead of 169.254.169.254.

Describe alternatives you've considered
Doing some shenanigans with iptables or other routing tools.

Additional context
I'm trying to authenticate to AWS on a non-EC2 host with IMDS.

The cli can authenticate fine for example:

$ aws sts get-caller-identity --no-cli-pager
{
    "UserId": "A********P:40907cc9d91df2bfaa7c523ca4feee87",
    "Account": "************",
    "Arn": "arn:aws:sts::*********:assumed-role/********/40907cc9d91df2bfaa7c523ca4feee87"
}

While fluent-bit is confused:

$ /opt/fluent-bit/bin/fluent-bit
Fluent Bit v4.0.9
* Copyright (C) 2015-2025 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

______ _                  _    ______ _ _             ___  _____
|  ___| |                | |   | ___ (_) |           /   ||  _  |
| |_  | |_   _  ___ _ __ | |_  | |_/ /_| |_  __   __/ /| || |/' |
|  _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / / /_| ||  /| |
| |   | | |_| |  __/ | | | |_  | |_/ / | |_   \ V /\___  |\ |_/ /
\_|   |_|\__,_|\___|_| |_|\__| \____/|_|\__|   \_/     |_(_)___/


[2025/09/10 21:44:00] [ info] [fluent bit] version=4.0.9, commit=, pid=83097
[2025/09/10 21:44:00] [ info] [storage] ver=1.5.3, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2025/09/10 21:44:00] [ info] [simd    ] SSE2
[2025/09/10 21:44:00] [ info] [cmetrics] version=1.0.5
[2025/09/10 21:44:00] [ info] [ctraces ] version=0.6.6
[2025/09/10 21:44:00] [ info] [input:tail:tail.0] initializing
[2025/09/10 21:44:00] [ info] [input:tail:tail.0] storage_strategy='memory' (memory only)
[2025/09/10 21:44:01] [error] [net] connection #104 timeout after 1 seconds to: 169.254.169.254:80
[2025/09/10 21:44:01] [ warn] [imds] unable to evaluate IMDS version
[2025/09/10 21:44:01] [ info] [sp] stream processor started
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.