Class LambdaMetadata

java.lang.Object
software.amazon.lambda.powertools.metadata.LambdaMetadata

public final class LambdaMetadata extends Object
Data class representing Lambda execution environment metadata.

This class is immutable and contains metadata retrieved from the Lambda Metadata Endpoint (LMDS). Use LambdaMetadataClient.get() to obtain an instance.

This class is annotated with JsonIgnoreProperties to ensure forward compatibility.

Example Usage


 LambdaMetadata metadata = LambdaMetadataClient.get();
 String azId = metadata.getAvailabilityZoneId();
 
See Also:
  • Constructor Details

    • LambdaMetadata

      public LambdaMetadata()
      Default constructor for Jackson deserialization.
    • LambdaMetadata

      public LambdaMetadata(String availabilityZoneId)
      Constructor with availability zone ID.
      Parameters:
      availabilityZoneId - the availability zone ID
  • Method Details

    • getAvailabilityZoneId

      public String getAvailabilityZoneId()
      Returns the Availability Zone ID.

      The Availability Zone ID is a unique identifier for the availability zone where the Lambda function is executing (e.g., "use1-az1").

      Returns:
      the availability zone ID