aws

package
v1.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package aws provides AWS cloud environment detection and metadata retrieval capabilities using the EC2 instance metadata service (IMDS) v2 with fallback to v1.

Index

Constants

This section is empty.

Variables

View Source
var ErrIMDSv2Unavailable = errors.New("IMDSv2 token endpoint unavailable, falling back to IMDSv1")

ErrIMDSv2Unavailable is returned when IMDSv2 token endpoint is not available

Functions

This section is empty.

Types

type Scout

type Scout struct {
	// contains filtered or unexported fields
}

func NewScout

func NewScout() *Scout

NewScout creates a new AWS metadata scout

func (*Scout) Detect

func (s *Scout) Detect(ctx context.Context) (types.CloudProvider, error)

Detect determines if the current environment is running on AWS by testing the metadata service. AWS metadata service returns 401 when accessed without IMDSv2 token, which is a positive indicator. For IMDSv1 environments, we check for AWS-specific metadata fields.

func (*Scout) EnvironmentInfo

func (s *Scout) EnvironmentInfo(ctx context.Context) (*types.EnvironmentInfo, error)

EnvironmentInfo retrieves AWS environment information from EC2 metadata service with IMDSv2 support and fallback to IMDSv1 for compatibility.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL