appconfigagent

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package appconfigagent reads configuration from the local AWS AppConfig Agent.

GetConfig calls the Agent or Lambda extension HTTP endpoint. Options supplies application, environment, endpoint, HTTP client and transform settings. Pass the configuration profile name and invocation context on each call.

Retrieval boundary

The Agent owns caching and polling; this adapter does not add a second provider cache. The application deploys and configures the Agent or extension. Local HTTP failures and transform errors are returned to the caller.

Use the sibling appconfig package when calling AppConfig Data directly with an application-owned AWS SDK client.

For usage and compatibility details, see the user guide.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(ctx context.Context, name string, options Options) (any, error)
Example

This example requires a configured AppConfig Agent or Lambda extension.

package main

import (
	"context"
	"time"

	"github.com/rambow-cloud/powertools-lambda-go/parameters/appconfigagent"
)

func main() {
	value, err := appconfigagent.GetConfig(context.Background(), "features",
		appconfigagent.Options{Application: "example", Environment: "development",
			Endpoint: "http://localhost:2772", Timeout: time.Second})
	if err != nil {
		panic(err)
	}
	_ = value // The Agent owns caching and polling.
}

Types

type Options

type Options struct {
	Application, Environment string
	Transform                parameters.Transform
	ThrowOnMissing           bool
	Timeout                  time.Duration
	HTTPClient               *http.Client
	// Endpoint explicitly enables HTTP outside Lambda, for a local agent or tests.
	Endpoint string
}

Jump to

Keyboard shortcuts

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