Help us shape the future of Go! Take the 2026 Go Developer Survey

aws

package
v0.313.5 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 38 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultEC2SDConfig = EC2SDConfig{
	Port:             80,
	RefreshInterval:  model.Duration(60 * time.Second),
	HTTPClientConfig: config.DefaultHTTPClientConfig,
}

DefaultEC2SDConfig is the default EC2 SD configuration.

View Source
var DefaultECSSDConfig = ECSSDConfig{
	Port:               80,
	RefreshInterval:    model.Duration(60 * time.Second),
	RequestConcurrency: 20,
	HTTPClientConfig:   config.DefaultHTTPClientConfig,
}

DefaultECSSDConfig is the default ECS SD configuration.

View Source
var DefaultElasticacheSDConfig = ElasticacheSDConfig{
	Port:               80,
	RefreshInterval:    model.Duration(60 * time.Second),
	RequestConcurrency: 10,
	HTTPClientConfig:   config.DefaultHTTPClientConfig,
}

DefaultElasticacheSDConfig is the default Elasticache SD configuration.

View Source
var DefaultLightsailSDConfig = LightsailSDConfig{
	Port:             80,
	RefreshInterval:  model.Duration(60 * time.Second),
	HTTPClientConfig: config.DefaultHTTPClientConfig,
}

DefaultLightsailSDConfig is the default Lightsail SD configuration.

View Source
var DefaultMSKSDConfig = MSKSDConfig{
	Port:               80,
	RefreshInterval:    model.Duration(60 * time.Second),
	RequestConcurrency: 10,
	HTTPClientConfig:   config.DefaultHTTPClientConfig,
}

DefaultMSKSDConfig is the default MSK SD configuration.

View Source
var DefaultRDSSDConfig = RDSSDConfig{
	Port:               80,
	RefreshInterval:    model.Duration(60 * time.Second),
	RequestConcurrency: 10,
	HTTPClientConfig:   config.DefaultHTTPClientConfig,
}

DefaultRDSSDConfig is the default RDS SD configuration.

View Source
var DefaultSDConfig = SDConfig{
	RefreshInterval:  model.Duration(60 * time.Second),
	HTTPClientConfig: config.DefaultHTTPClientConfig,
}

DefaultSDConfig is the default AWS SD configuration.

Functions

This section is empty.

Types

type EC2Discovery

type EC2Discovery struct {
	*refresh.Discovery
	// contains filtered or unexported fields
}

EC2Discovery periodically performs EC2-SD requests. It implements the Discoverer interface.

func NewEC2Discovery

func NewEC2Discovery(conf *EC2SDConfig, opts discovery.DiscovererOptions) (*EC2Discovery, error)

NewEC2Discovery returns a new EC2Discovery which periodically refreshes its targets.

type EC2SDConfig

type EC2SDConfig struct {
	Endpoint        string         `yaml:"endpoint"`
	Region          string         `yaml:"region"`
	AccessKey       string         `yaml:"access_key,omitempty"`
	SecretKey       config.Secret  `yaml:"secret_key,omitempty"`
	Profile         string         `yaml:"profile,omitempty"`
	RoleARN         string         `yaml:"role_arn,omitempty"`
	ExternalID      string         `yaml:"external_id,omitempty"`
	RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
	Port            int            `yaml:"port"`
	Filters         []*Filter      `yaml:"filters"`

	HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`
}

EC2SDConfig is the configuration for EC2 based service discovery.

func (*EC2SDConfig) Name

func (*EC2SDConfig) Name() string

Name returns the name of the EC2 Config.

func (*EC2SDConfig) NewDiscoverer

NewDiscoverer returns a Discoverer for the EC2 Config.

func (*EC2SDConfig) NewDiscovererMetrics added in v0.50.0

NewDiscovererMetrics implements discovery.Config.

func (*EC2SDConfig) SetDirectory added in v0.312.0

func (c *EC2SDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*EC2SDConfig) UnmarshalYAML

func (c *EC2SDConfig) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for the EC2 Config.

type ECSDiscovery added in v0.308.0

type ECSDiscovery struct {
	*refresh.Discovery
	// contains filtered or unexported fields
}

ECSDiscovery periodically performs ECS-SD requests. It implements the Discoverer interface.

func NewECSDiscovery added in v0.308.0

func NewECSDiscovery(conf *ECSSDConfig, opts discovery.DiscovererOptions) (*ECSDiscovery, error)

NewECSDiscovery returns a new ECSDiscovery which periodically refreshes its targets.

type ECSSDConfig added in v0.308.0

type ECSSDConfig struct {
	Region          string         `yaml:"region"`
	Endpoint        string         `yaml:"endpoint"`
	AccessKey       string         `yaml:"access_key,omitempty"`
	SecretKey       config.Secret  `yaml:"secret_key,omitempty"`
	Profile         string         `yaml:"profile,omitempty"`
	RoleARN         string         `yaml:"role_arn,omitempty"`
	ExternalID      string         `yaml:"external_id,omitempty"`
	Clusters        []string       `yaml:"clusters,omitempty"`
	Port            int            `yaml:"port"`
	RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`

	// RequestConcurrency controls the maximum number of concurrent ECS API requests.
	// Default is 20, which aligns with AWS ECS sustained rate limits:
	// - Cluster read actions (DescribeClusters, ListClusters): 20 req/sec sustained
	// - Service read actions (DescribeServices, ListServices): 20 req/sec sustained
	// - Cluster resource read actions (DescribeTasks, ListTasks): 20 req/sec sustained
	// See: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/request-throttling.html
	RequestConcurrency int `yaml:"request_concurrency,omitempty"`

	HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`
}

ECSSDConfig is the configuration for ECS based service discovery.

func (*ECSSDConfig) Name added in v0.308.0

func (*ECSSDConfig) Name() string

Name returns the name of the ECS Config.

func (*ECSSDConfig) NewDiscoverer added in v0.308.0

NewDiscoverer returns a Discoverer for the EC2 Config.

func (*ECSSDConfig) NewDiscovererMetrics added in v0.308.0

NewDiscovererMetrics implements discovery.Config.

func (*ECSSDConfig) SetDirectory added in v0.312.0

func (c *ECSSDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*ECSSDConfig) UnmarshalYAML added in v0.308.0

func (c *ECSSDConfig) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for the ECS Config.

type ElasticacheDiscovery added in v0.311.0

type ElasticacheDiscovery struct {
	*refresh.Discovery
	// contains filtered or unexported fields
}

ElasticacheDiscovery periodically performs Elasticache-SD requests. It implements the Discoverer interface.

func NewElasticacheDiscovery added in v0.311.0

func NewElasticacheDiscovery(conf *ElasticacheSDConfig, opts discovery.DiscovererOptions) (*ElasticacheDiscovery, error)

NewElasticacheDiscovery returns a new ElasticacheDiscovery which periodically refreshes its targets.

type ElasticacheSDConfig added in v0.311.0

type ElasticacheSDConfig struct {
	Region          string         `yaml:"region"`
	Endpoint        string         `yaml:"endpoint"`
	AccessKey       string         `yaml:"access_key,omitempty"`
	SecretKey       config.Secret  `yaml:"secret_key,omitempty"`
	Profile         string         `yaml:"profile,omitempty"`
	RoleARN         string         `yaml:"role_arn,omitempty"`
	ExternalID      string         `yaml:"external_id,omitempty"`
	Clusters        []string       `yaml:"clusters,omitempty"`
	Port            int            `yaml:"port"`
	RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`

	// RequestConcurrency controls the maximum number of concurrent Elasticache API requests.
	RequestConcurrency int `yaml:"request_concurrency,omitempty"`

	HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`
}

ElasticacheSDConfig is the configuration for Elasticache based service discovery.

func (*ElasticacheSDConfig) Name added in v0.311.0

func (*ElasticacheSDConfig) Name() string

Name returns the name of the Elasticache Config.

func (*ElasticacheSDConfig) NewDiscoverer added in v0.311.0

NewDiscoverer returns a Discoverer for the Elasticache Config.

func (*ElasticacheSDConfig) NewDiscovererMetrics added in v0.311.0

NewDiscovererMetrics implements discovery.Config.

func (*ElasticacheSDConfig) SetDirectory added in v0.312.0

func (c *ElasticacheSDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*ElasticacheSDConfig) UnmarshalYAML added in v0.311.0

func (c *ElasticacheSDConfig) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for the Elasticache Config.

type Filter added in v0.313.0

type Filter struct {
	Name   string   `yaml:"name"`
	Values []string `yaml:"values"`
}

Filter is the configuration for filtering AWS resources.

type LightsailDiscovery

type LightsailDiscovery struct {
	*refresh.Discovery
	// contains filtered or unexported fields
}

LightsailDiscovery periodically performs Lightsail-SD requests. It implements the Discoverer interface.

func NewLightsailDiscovery

func NewLightsailDiscovery(conf *LightsailSDConfig, opts discovery.DiscovererOptions) (*LightsailDiscovery, error)

NewLightsailDiscovery returns a new LightsailDiscovery which periodically refreshes its targets.

type LightsailSDConfig

type LightsailSDConfig struct {
	Endpoint        string         `yaml:"endpoint"`
	Region          string         `yaml:"region"`
	AccessKey       string         `yaml:"access_key,omitempty"`
	SecretKey       config.Secret  `yaml:"secret_key,omitempty"`
	Profile         string         `yaml:"profile,omitempty"`
	RoleARN         string         `yaml:"role_arn,omitempty"`
	ExternalID      string         `yaml:"external_id,omitempty"`
	RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
	Port            int            `yaml:"port"`

	HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`
}

LightsailSDConfig is the configuration for Lightsail based service discovery.

func (*LightsailSDConfig) Name

func (*LightsailSDConfig) Name() string

Name returns the name of the Lightsail Config.

func (*LightsailSDConfig) NewDiscoverer

NewDiscoverer returns a Discoverer for the Lightsail Config.

func (*LightsailSDConfig) NewDiscovererMetrics added in v0.50.0

NewDiscovererMetrics implements discovery.Config.

func (*LightsailSDConfig) SetDirectory added in v0.312.0

func (c *LightsailSDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*LightsailSDConfig) UnmarshalYAML

func (c *LightsailSDConfig) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for the Lightsail Config.

type MSKDiscovery added in v0.310.0

type MSKDiscovery struct {
	*refresh.Discovery
	// contains filtered or unexported fields
}

MSKDiscovery periodically performs MSK-SD requests. It implements the Discoverer interface.

func NewMSKDiscovery added in v0.310.0

func NewMSKDiscovery(conf *MSKSDConfig, opts discovery.DiscovererOptions) (*MSKDiscovery, error)

NewMSKDiscovery returns a new MSKDiscovery which periodically refreshes its targets.

type MSKSDConfig added in v0.310.0

type MSKSDConfig struct {
	Region          string         `yaml:"region"`
	Endpoint        string         `yaml:"endpoint"`
	AccessKey       string         `yaml:"access_key,omitempty"`
	SecretKey       config.Secret  `yaml:"secret_key,omitempty"`
	Profile         string         `yaml:"profile,omitempty"`
	RoleARN         string         `yaml:"role_arn,omitempty"`
	ExternalID      string         `yaml:"external_id,omitempty"`
	Clusters        []string       `yaml:"clusters,omitempty"`
	Port            int            `yaml:"port"`
	RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`

	RequestConcurrency int                     `yaml:"request_concurrency,omitempty"`
	HTTPClientConfig   config.HTTPClientConfig `yaml:",inline"`
}

MSKSDConfig is the configuration for MSK based service discovery.

func (*MSKSDConfig) Name added in v0.310.0

func (*MSKSDConfig) Name() string

Name returns the name of the MSK Config.

func (*MSKSDConfig) NewDiscoverer added in v0.310.0

NewDiscoverer returns a Discoverer for the MSK Config.

func (*MSKSDConfig) NewDiscovererMetrics added in v0.310.0

NewDiscovererMetrics implements discovery.Config.

func (*MSKSDConfig) SetDirectory added in v0.312.0

func (c *MSKSDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*MSKSDConfig) UnmarshalYAML added in v0.310.0

func (c *MSKSDConfig) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for the MSK Config.

type NodeType added in v0.310.0

type NodeType string
const (
	NodeTypeBroker     NodeType = "BROKER"
	NodeTypeController NodeType = "CONTROLLER"
)

type RDSDiscovery added in v0.311.0

type RDSDiscovery struct {
	*refresh.Discovery
	// contains filtered or unexported fields
}

RDSDiscovery periodically performs RDS-SD requests. It implements the Discoverer interface.

func NewRDSDiscovery added in v0.311.0

func NewRDSDiscovery(conf *RDSSDConfig, opts discovery.DiscovererOptions) (*RDSDiscovery, error)

NewRDSDiscovery returns a new RDSDiscovery which periodically refreshes its targets.

type RDSSDConfig added in v0.311.0

type RDSSDConfig struct {
	Region          string         `yaml:"region"`
	Endpoint        string         `yaml:"endpoint"`
	AccessKey       string         `yaml:"access_key,omitempty"`
	SecretKey       config.Secret  `yaml:"secret_key,omitempty"`
	Profile         string         `yaml:"profile,omitempty"`
	RoleARN         string         `yaml:"role_arn,omitempty"`
	ExternalID      string         `yaml:"external_id,omitempty"`
	Clusters        []string       `yaml:"clusters,omitempty"`
	Port            int            `yaml:"port"`
	RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
	Filters         []*Filter      `yaml:"filters"`

	RequestConcurrency int                     `yaml:"request_concurrency,omitempty"`
	HTTPClientConfig   config.HTTPClientConfig `yaml:",inline"`
}

RDSSDConfig is the configuration for RDS based service discovery.

func (*RDSSDConfig) Name added in v0.311.0

func (*RDSSDConfig) Name() string

Name returns the name of the RDS Config.

func (*RDSSDConfig) NewDiscoverer added in v0.311.0

NewDiscoverer returns a Discoverer for the RDS Config.

func (*RDSSDConfig) NewDiscovererMetrics added in v0.311.0

NewDiscovererMetrics implements discovery.Config.

func (*RDSSDConfig) SetDirectory added in v0.312.0

func (c *RDSSDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*RDSSDConfig) UnmarshalYAML added in v0.311.0

func (c *RDSSDConfig) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for the RDS Config.

type Role added in v0.308.0

type Role string

Role is role of the service in AWS.

const (
	RoleEC2         Role = "ec2"
	RoleECS         Role = "ecs"
	RoleElasticache Role = "elasticache"
	RoleLightsail   Role = "lightsail"
	RoleMSK         Role = "msk"
	RoleRDS         Role = "rds"
)

The valid options for Role.

func (Role) String added in v0.308.0

func (c Role) String() string

func (*Role) UnmarshalYAML added in v0.308.0

func (c *Role) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type SDConfig added in v0.308.0

type SDConfig struct {
	Role             Role                    `yaml:"role"`
	Region           string                  `yaml:"region,omitempty"`
	Endpoint         string                  `yaml:"endpoint,omitempty"`
	AccessKey        string                  `yaml:"access_key,omitempty"`
	SecretKey        config.Secret           `yaml:"secret_key,omitempty"`
	Profile          string                  `yaml:"profile,omitempty"`
	RoleARN          string                  `yaml:"role_arn,omitempty"`
	ExternalID       string                  `yaml:"external_id,omitempty"`
	RefreshInterval  model.Duration          `yaml:"refresh_interval,omitempty"`
	Port             int                     `yaml:"port,omitempty"`
	HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`

	// ec2, rds specific
	Filters []*Filter `yaml:"filters,omitempty"`

	// ecs, msk specific
	Clusters []string `yaml:"clusters,omitempty"`

	// Embedded sub-configs (internal use only, not serialized)
	*EC2SDConfig         `yaml:"-"`
	*ECSSDConfig         `yaml:"-"`
	*ElasticacheSDConfig `yaml:"-"`
	*LightsailSDConfig   `yaml:"-"`
	*MSKSDConfig         `yaml:"-"`
	*RDSSDConfig         `yaml:"-"`
}

SDConfig is the configuration for AWS service discovery.

func (*SDConfig) Name added in v0.308.0

func (*SDConfig) Name() string

Name returns the name of the AWS Config.

func (*SDConfig) NewDiscoverer added in v0.308.0

func (c *SDConfig) NewDiscoverer(opts discovery.DiscovererOptions) (discovery.Discoverer, error)

NewDiscoverer returns a Discoverer for the AWS Config.

func (*SDConfig) NewDiscovererMetrics added in v0.308.0

NewDiscovererMetrics implements discovery.Config.

func (*SDConfig) SetDirectory added in v0.312.0

func (c *SDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*SDConfig) UnmarshalYAML added in v0.308.0

func (c *SDConfig) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for SDConfig.

Jump to

Keyboard shortcuts

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