awscfg

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package awscfg provides a shared AWS configuration resolver used by all AWS-backed blocks. It decouples blocks from the specifics of credential loading while keeping the public API minimal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Resolver)

Option configures a Resolver.

func WithConfig

func WithConfig(cfg aws.Config) Option

WithConfig injects a fully-built aws.Config, bypassing all automatic credential and region resolution. Use this when you manage the AWS config yourself (e.g. in tests or multi-account setups).

func WithEndpoint

func WithEndpoint(endpoint string) Option

WithEndpoint overrides the service endpoint URL. Used for local development with LocalStack, DynamoDB Local, MinIO, etc.

func WithProfile

func WithProfile(profile string) Option

WithProfile selects a named profile from the AWS shared credentials file. Ignored when WithConfig is provided.

func WithRegion

func WithRegion(region string) Option

WithRegion sets the AWS region. Ignored when WithConfig is provided.

type Resolver

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

Resolver builds an aws.Config from a prioritised set of options.

Priority (highest first):

  1. Explicit aws.Config via WithConfig
  2. Environment variables / default credential chain (with optional overrides)

func New

func New(opts []Option) *Resolver

New creates a Resolver from the supplied options.

func (*Resolver) Endpoint

func (r *Resolver) Endpoint() string

Endpoint returns the custom endpoint override (empty string if not set).

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context) (aws.Config, error)

Resolve returns a valid aws.Config, loading defaults from the environment when no explicit config was provided.

Jump to

Keyboard shortcuts

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