Skip to content

Feature request: Lambda Metadata support #1158

@hjgraca

Description

@hjgraca

Use case

Lambda has recently launched a metadata device similar to to the Instance Metadata Service that EC2 has. We should add a utility that allows user to access the data without having explicitly make fetch requests to the IP address where the service lives.

Solution/User Experience

using AWS.Lambda.Powertools.Metadata;

public class Function
{
    public string Handler(object input, ILambdaContext context)
    {
        var azId = LambdaMetadata.AvailabilityZoneId;
        return $"Running in AZ: {azId}";
    }
}

Alternative solutions

Acknowledgment

Metadata

Metadata

Assignees

Labels

feature-requestNew or enhancements to existing features

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions