AWS EC2 metadata
Parse metadata emitted by AWS EC2 instances
Requirements
Running this transform within Docker on EC2 requires 2 network hops. Users must raise this limit:
aws ec2 modify-instance-metadata-options --instance-id <ID> --http-endpoint enabled --http-put-response-hop-limit 2
Accessing instance tags must be explicitly enabled for each instance. This can be done in the AWS Console, or with the following CLI command:
aws ec2 modify-instance-metadata-options --instance-id <ID> --instance-metadata-tags enabled
Warnings
Configuration
Example configurations
{
"transforms": {
"my_transform_id": {
"type": "aws_ec2_metadata",
"inputs": [
"my-source-or-transform-id"
]
}
}
}
[transforms.my_transform_id]
type = "aws_ec2_metadata"
inputs = [ "my-source-or-transform-id" ]
transforms:
my_transform_id:
type: aws_ec2_metadata
inputs:
- my-source-or-transform-id
{
"transforms": {
"my_transform_id": {
"type": "aws_ec2_metadata",
"inputs": [
"my-source-or-transform-id"
],
"endpoint": "http://169.254.169.254",
"fields": [
"instance-id"
],
"refresh_interval_secs": 10,
"refresh_timeout_secs": 1,
"required": true,
"tags": [
"Name"
]
}
}
}
[transforms.my_transform_id]
type = "aws_ec2_metadata"
inputs = [ "my-source-or-transform-id" ]
endpoint = "http://169.254.169.254"
fields = [ "instance-id" ]
refresh_interval_secs = 10
refresh_timeout_secs = 1
required = true
tags = [ "Name" ]
transforms:
my_transform_id:
type: aws_ec2_metadata
inputs:
- my-source-or-transform-id
endpoint: http://169.254.169.254
fields:
- instance-id
refresh_interval_secs: 10
refresh_timeout_secs: 1
required: true
tags:
- Name
endpoint
optional string literalhttp://169.254.169.254
fields
optional [string][ami-id availability-zone instance-id instance-type local-hostname local-ipv4 public-hostname public-ipv4 region subnet-id vpc-id role-name]
graph
optional objectExtra graph configuration
Configure output for component when generated with graph command
graph.node_attributes
optional objectNode attributes to add to this component’s node in resulting graph
They are added to the node as provided
graph.node_attributes.*
required string literalinputs
required [string]A list of upstream source or transform IDs.
Wildcards (*
) are supported.
See configuration for more info.
namespace
optional string literalproxy
optional objectProxy configuration.
Configure to proxy traffic through an HTTP(S) proxy when making external requests.
Similar to common proxy configuration convention, you can set different proxies to use based on the type of traffic being proxied. You can also set specific hosts that should not be proxied.
proxy.http
optional string literalProxy endpoint to use when proxying HTTP traffic.
Must be a valid URI string.
proxy.https
optional string literalProxy endpoint to use when proxying HTTPS traffic.
Must be a valid URI string.
proxy.no_proxy
optional [string]A list of hosts to avoid proxying.
Multiple patterns are allowed:
Pattern | Example match |
---|---|
Domain names | example.com matches requests to example.com |
Wildcard domains | .example.com matches requests to example.com and its subdomains |
IP addresses | 127.0.0.1 matches requests to 127.0.0.1 |
CIDR blocks | 192.168.0.0/16 matches requests to any IP addresses in this range |
Splat | * matches all hosts |
refresh_interval_secs
optional uint10
(seconds)refresh_timeout_secs
optional uint1
(seconds)required
optional booltrue
tags
optional [string]Environment variables
HTTPS_PROXY
common optional string literalThe global URL to proxy HTTPS requests through.
If another HTTPS proxy is set in the configuration file or at a component level, this one will be overridden.
The lowercase variant has priority over the uppercase one.
HTTP_PROXY
common optional string literalThe global URL to proxy HTTP requests through.
If another HTTP proxy is set in the configuration file or at a component level, this one will be overridden.
The lowercase variant has priority over the uppercase one.
NO_PROXY
common optional string literalList of hosts to avoid proxying globally.
Allowed patterns here include:
Pattern | Example match |
---|---|
Domain names | example.com matches requests to example.com |
Wildcard domains | .example.come matches requests to example.com and its subdomains |
IP addresses | 127.0.0.1 matches requests to 127.0.0.1 |
CIDR blocks | 192.168.0.0./16 matches requests to any IP addresses in this range |
Splat | * matches all hosts |
If another no_proxy
value is set in the configuration file or at a component level, this
one is overridden.
The lowercase variant has priority over the uppercase one.
http_proxy
common optional string literalThe global URL to proxy HTTP requests through.
If another HTTP proxy is set in the configuration file or at a component level, this one will be overridden.
The lowercase variant has priority over the uppercase one.
https_proxy
common optional string literalThe global URL to proxy HTTPS requests through.
If another HTTPS proxy is set in the configuration file or at a component level, this one will be overridden.
The lowercase variant has priority over the uppercase one.
no_proxy
common optional string literalList of hosts to avoid proxying globally.
Allowed patterns here include:
Pattern | Example match |
---|---|
Domain names | example.com matches requests to example.com |
Wildcard domains | .example.come matches requests to example.com and its subdomains |
IP addresses | 127.0.0.1 matches requests to 127.0.0.1 |
CIDR blocks | 192.168.0.0./16 matches requests to any IP addresses in this range |
Splat | * matches all hosts |
If another no_proxy
value is set in the configuration file or at a component level, this
one is overridden.
The lowercase variant has priority over the uppercase one.
Outputs
<component_id>
Output Data
Logs
Warning
Log
account-id
that launched the EC2 instance.123456789
ami-id
that the current EC2 instance is using.ami-00068cd7555f543d5
availability-zone
that the current EC2 instance is running in.54.234.246.107
instance-id
of the current EC2 instance.i-096fba6d03d36d262
instance-type
of the current EC2 instance.m4.large
local-hostname
of the current EC2 instance.ip-172-31-93-227.ec2.internal
local-ipv4
of the current EC2 instance.172.31.93.227
public-hostname
of the current EC2 instance.ec2-54-234-246-107.compute-1.amazonaws.com
public-ipv4
of the current EC2 instance.54.234.246.107
region
that the current EC2 instance is running in.us-east-1
role-name
that the current EC2 instance is using.some_iam_role
subnet-id
of the current EC2 instance’s default network interface.subnet-9d6713b9
{
"ApplicationId": "12345678",
"Name": "InstanceName"
}
vpc-id
of the current EC2 instance’s default network interface.vpc-a51da4dc
Telemetry
Metrics
linkcomponent_discarded_events_total
counterfilter
transform, or false if due to an error.component_errors_total
countercomponent_received_event_bytes_total
countercomponent_received_events_count
histogramA histogram of the number of events passed in each internal batch in Vector’s internal topology.
Note that this is separate than sink-level batching. It is mostly useful for low level debugging performance issues in Vector due to small internal batches.