appconfig

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 26 Imported by: 0

README

AppConfig

Parity grade: A- · SDK aws-sdk-go-v2/service/appconfig@v1.48.0 · last audited 2026-07-25 (f86ef17b)

Coverage

Metric Value
Operations audited 56 (55 ok, 1 partial)
Feature families 3 (2 ok, 1 partial)
Known gaps 8
Deferred items 1
Resource leaks clean
Known gaps
  • Every real CreateInput in this service (CreateApplicationInput, CreateEnvironmentInput, CreateConfigurationProfileInput, CreateDeploymentStrategyInput, CreateExtensionInput, CreateExtensionAssociationInput) has an optional inline Tags map[string]string member, applied at creation time as an alternative to a separate TagResource call. None of the six corresponding handlers in this backend parse or apply it — a real client that tags a resource inline at creation gets a 200/201 with the tags silently dropped (ListTagsForResource on the new resource returns empty). This predates this pass (found while field-diffing Create wire shapes for the deployment/extension work, not introduced by it). NOT fixed this pass: doing so correctly requires threading a tags parameter through 6 backend method signatures + the StorageBackend interface + 6 handler request structs, which touches every existing call site of those methods across this package's test suite (dozens of call sites in ~15 files) — a larger mechanical change than fit alongside the deployment-state-machine/extension-versioning/GetConfiguration work in this pass. Tracked in bd gopherstack-lcan. The two NEW Create*-shaped ops this pass adds (CreateExperimentDefinition, StartExperimentRun) do NOT repeat this bug -- their inline Tags are applied correctly, since they were written fresh against this already-known gap rather than copy-pasted from the six broken handlers.
  • Deployment progression (StartDeployment's DEPLOYING/BAKING growth curve) runs on a fixed compressed timescale (single-digit milliseconds per step, clamped GrowthFactor) rather than being proportional to the strategy's actual configured DeploymentDurationInMinutes/FinalBakeTimeInMinutes -- e.g. a 1-minute strategy and a 1440-minute strategy complete in comparable wall-clock time. This is a deliberate, documented simplification (see deployments.go's package doc comment) matching the precedent set by services/rds and services/acm for the same reason (real AWS timings are impractical to emulate literally in a test-driven in-memory backend); not something a client can observe via any single API call, only via wall-clock timing across polls.
  • StartExperimentRun's ExposurePercentage default (when the optional field is omitted) is UNVERIFIED against real AWS -- the SDK's ExposurePercentage doc text ('Set to 0 to validate the experiment before exposing production users') implies 0 is a meaningful value but never states it is the default for an omitted field. This backend defaults to 0 (the safer, least-surprising reading: no audience exposed without an explicit non-zero value) rather than fabricate a different unverified number. A real client that always sends ExposurePercentage explicitly is unaffected; one that omits it may observe a different default than real AWS.
  • DeleteExperimentDefinition's delete_type default (when omitted) is UNVERIFIED against real AWS -- DeleteType's doc text describes ARCHIVE as 'hide but preserve' and DESTROY as the explicit opt-in to permanent removal, but the SDK documents no default for an omitted value. This backend defaults to ARCHIVE (the non-destructive choice) rather than assume irreversible deletion was intended. A real client that always sends delete_type explicitly is unaffected.
  • FlagKey (the feature flag an experiment evaluates) is validated for presence only (non-empty string) plus the referenced ConfigurationProfile.Type check -- it is never checked against actual feature-flag content, because this backend has no feature-flag-content model at all (ConfigurationProfile content, even for AWS.AppConfig.FeatureFlags-typed profiles, is opaque bytes -- see HostedConfigurationVersion.Content). A real client can create an experiment definition referencing a FlagKey that does not exist in the profile's actual flag JSON; this backend accepts it. Fixing this would require this backend to first model feature-flag content structure at all, which no existing AppConfig op depends on today -- out of scope for this pass.
  • ListExperimentDefinitions's configuration_profile_identifier/environment_identifier filters can only be resolved by NAME when application_identifier is also supplied (see the note on that op above); without an application_identifier a name-form filter value is compared literally against the ID field only and silently matches nothing. A real client is documented as able to supply any of the three identifiers independently.
  • Treatment.Key's server-generated naming scheme ('Control' for the control treatment, 'Treatment1'..'TreatmentN' 1-indexed by creation order for the rest) is an assumption: real CreateExperimentDefinitionInput/UpdateExperimentDefinitionInput's TreatmentInput has no client-supplied Key at all, so AWS itself must assign one, but the exact scheme AWS uses is not documented in the SDK. A real client that treats Key as an opaque server-assigned identifier (which is the only documented contract) is unaffected; one that asserts an exact Key string may see a different value than real AWS.
  • DeploymentParameters (accepted on StartExperimentRun/StopExperimentRun/UpdateExperimentRun) is parsed but intentionally discarded rather than stored or acted upon -- real GetExperimentRun/StartExperimentRun/etc. output shapes never echo it back either, so a real client observes nothing different; but this backend also does not create the underlying 'real' deployment AWS uses internally to actually serve treatment variations to production traffic, so DynamicExtensionParameters/Tags on that inner deployment have no addressable resource here to apply to.
Deferred
  • GetExtensionInput/DeleteExtensionInput document 'name, ID, or ARN' identifier resolution; this backend's resolveExtensionID only resolves by ID or name (pre-existing, unchanged this pass) -- ARN-based lookup was not added. Low risk: gopherstack conventionally addresses resources by ID/name elsewhere in this service too.

More

Documentation

Overview

Package appconfig -- this file implements the experiment RUN half of the A/B-testing family (experiment_definitions.go implements the definition half). Unlike deployments.go's growth-curve state machine, an experiment run has no duration to progress through automatically: real AWS AppConfig keeps a run RUNNING, serving its configured exposure percentage, until a caller explicitly stops it (or updates it). So there is no background reconciler goroutine here -- StartExperimentRun/StopExperimentRun/ UpdateExperimentRun perform their entire state transition synchronously, and ListExperimentRunEvents returns exactly what those calls recorded as they happened.

This backend does not model the underlying "real" deployment AWS creates to actually serve treatment variations to production traffic, nor an analytics engine that would compute variant metrics/statistical significance from live exposure -- see ExperimentRunResult's doc comment in models.go and the results_verdict discussion in PARITY.md for what this means for what StopExperimentRun's Result field can and cannot contain.

Package appconfig provides an in-memory stub for the AWS AppConfig service, which manages feature flags and application configuration.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrApplicationNotFound is returned when the requested application does not exist.
	ErrApplicationNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrEnvironmentNotFound is returned when the requested environment does not exist.
	ErrEnvironmentNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrConfigurationProfileNotFound is returned when the requested configuration profile does not exist.
	ErrConfigurationProfileNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrHostedConfigVersionNotFound is returned when the requested hosted configuration version does not exist.
	ErrHostedConfigVersionNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrDeploymentStrategyNotFound is returned when the requested deployment strategy does not exist.
	ErrDeploymentStrategyNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrDeploymentNotFound is returned when the requested deployment does not exist.
	ErrDeploymentNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrExtensionNotFound is returned when the requested extension does not exist.
	ErrExtensionNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrExtensionAssociationNotFound is returned when the requested extension association does not exist.
	ErrExtensionAssociationNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrExtensionAlreadyExists is returned when an extension with the same name already exists.
	ErrExtensionAlreadyExists = awserr.New("ConflictException", awserr.ErrAlreadyExists)
	// ErrBadRequest is returned when a required field is missing or invalid.
	ErrBadRequest = awserr.New("BadRequestException", awserr.ErrInvalidParameter)
	// ErrConflict is returned when a resource with the same name already exists.
	ErrConflict = awserr.New("ConflictException", awserr.ErrAlreadyExists)
	// ErrPayloadTooLarge is returned when a hosted configuration version exceeds the maximum size.
	ErrPayloadTooLarge = awserr.New("PayloadTooLargeException", awserr.ErrInvalidParameter)
	// ErrExperimentDefinitionNotFound is returned when the requested experiment definition does not exist.
	ErrExperimentDefinitionNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrExperimentRunNotFound is returned when the requested experiment run does not exist.
	ErrExperimentRunNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
)

Functions

This section is empty.

Types

type AccountSettings

type AccountSettings struct {
	DeletionProtection *DeletionProtectionSettings `json:"DeletionProtection,omitempty"`
}

AccountSettings holds account-level AppConfig settings.

type Application

type Application struct {
	CreatedAt   time.Time `json:"CreatedAt,omitzero"`
	UpdatedAt   time.Time `json:"UpdatedAt,omitzero"`
	ID          string    `json:"Id"`
	Name        string    `json:"Name"`
	Description string    `json:"Description,omitempty"`
}

Application represents an AppConfig application. JSON field names match the AWS AppConfig REST API (PascalCase).

type AppliedExtension added in v1.2.0

type AppliedExtension struct {
	Parameters             map[string]string `json:"Parameters,omitempty"`
	ExtensionAssociationID string            `json:"ExtensionAssociationId,omitempty"`
	ExtensionID            string            `json:"ExtensionId,omitempty"`
	VersionNumber          int32             `json:"VersionNumber,omitempty"`
}

AppliedExtension identifies an extension association that was in effect for an application, environment, or configuration profile when a deployment started.

type AttributeValue added in v1.2.0

type AttributeValue struct {
	BooleanValue *bool     `json:"BooleanValue,omitempty"`
	NumberValue  *float64  `json:"NumberValue,omitempty"`
	StringValue  *string   `json:"StringValue,omitempty"`
	NumberArray  []float64 `json:"NumberArray,omitempty"`
	StringArray  []string  `json:"StringArray,omitempty"`
}

AttributeValue is a single attribute value attached to a Treatment's FlagValue.AttributeValues map. Real AWS AppConfig models this as a tagged union (aws-sdk-go-v2/service/appconfig/types.AttributeValue: BooleanValue | NumberValue | StringValue | NumberArray | StringArray, selected by which JSON key is present on the wire -- see awsRestjson1_serializeDocumentAttributeValue in the SDK's serializers.go). This backend does not evaluate flag values (no flag-evaluation engine exists here, matching the family's other "storage only" fields), so rather than reimplement a Go union type it stores whichever member(s) the client sent and echoes them back unchanged on the same wire keys -- a faithful round-trip without fabricating semantics this backend can't give meaning to.

type ConfigurationProfile

type ConfigurationProfile struct {
	ApplicationID    string      `json:"ApplicationId"`
	ID               string      `json:"Id"`
	Name             string      `json:"Name"`
	Description      string      `json:"Description,omitempty"`
	LocationURI      string      `json:"LocationUri"`
	Type             string      `json:"Type,omitempty"`
	RetrievalRoleArn string      `json:"RetrievalRoleArn,omitempty"`
	Validators       []Validator `json:"Validators,omitempty"`
}

ConfigurationProfile represents an AppConfig configuration profile.

type DeletionProtectionSettings

type DeletionProtectionSettings struct {
	Enabled                   *bool  `json:"Enabled,omitempty"`
	ProtectionPeriodInMinutes *int32 `json:"ProtectionPeriodInMinutes,omitempty"`
}

DeletionProtectionSettings represents the deletion protection configuration for an account.

type Deployment

type Deployment struct {
	StartedAt                   time.Time          `json:"StartedAt,omitzero"`
	CompletedAt                 time.Time          `json:"CompletedAt,omitzero"`
	ApplicationID               string             `json:"ApplicationId"`
	EnvironmentID               string             `json:"EnvironmentId"`
	ConfigurationProfileID      string             `json:"ConfigurationProfileId"`
	DeploymentStrategyID        string             `json:"DeploymentStrategyId"`
	ConfigurationVersion        string             `json:"ConfigurationVersion"`
	State                       string             `json:"State"`
	TriggeredBy                 string             `json:"TriggeredBy,omitempty"`
	Description                 string             `json:"Description,omitempty"`
	ConfigurationName           string             `json:"ConfigurationName,omitempty"`
	ConfigurationLocationURI    string             `json:"ConfigurationLocationUri,omitempty"`
	GrowthType                  string             `json:"GrowthType,omitempty"`
	VersionLabel                string             `json:"VersionLabel,omitempty"`
	EventLog                    []DeploymentEvent  `json:"EventLog,omitempty"`
	AppliedExtensions           []AppliedExtension `json:"AppliedExtensions,omitempty"`
	PercentageComplete          float32            `json:"PercentageComplete,omitempty"`
	GrowthFactor                float32            `json:"GrowthFactor,omitempty"`
	DeploymentNumber            int32              `json:"DeploymentNumber"`
	DeploymentDurationInMinutes int32              `json:"DeploymentDurationInMinutes,omitempty"`
	FinalBakeTimeInMinutes      int32              `json:"FinalBakeTimeInMinutes,omitempty"`
}

Deployment represents an AppConfig deployment.

type DeploymentEvent added in v1.2.0

type DeploymentEvent struct {
	OccurredAt  time.Time `json:"OccurredAt,omitzero"`
	EventType   string    `json:"EventType"`
	Description string    `json:"Description,omitempty"`
	TriggeredBy string    `json:"TriggeredBy,omitempty"`
}

DeploymentEvent represents a single event in a deployment's history. ActionInvocations is intentionally unmodeled: this backend does not simulate real extension-action execution (Lambda invocation, SSM documents, ...), so a real SDK client's ActionInvocations would always come back empty here regardless -- see AppliedExtensions on Deployment for the same rationale. That matches AWS's own shape (the field is optional) rather than fabricating invocation data.

type DeploymentParameters added in v1.2.0

type DeploymentParameters struct {
	DynamicExtensionParameters map[string]string `json:"DynamicExtensionParameters,omitempty"`
	Tags                       map[string]string `json:"Tags,omitempty"`
}

DeploymentParameters carries the optional KMS/extension-parameter configuration a StartExperimentRun/StopExperimentRun/UpdateExperimentRun request can attach to the underlying deployment real AWS creates to expose treatments. This backend has no such underlying deployment to configure (see the ExperimentRun doc comment in experiment_runs.go) and real GetExperimentRun/StartExperimentRun/etc. output shapes never echo DeploymentParameters back to the caller either -- so it is accepted on input and intentionally discarded rather than stored, matching what a real client would actually observe (nothing).

type DeploymentStrategy

type DeploymentStrategy struct {
	CreatedAt                   time.Time `json:"CreatedAt,omitzero"`
	UpdatedAt                   time.Time `json:"UpdatedAt,omitzero"`
	ID                          string    `json:"Id"`
	Name                        string    `json:"Name"`
	Description                 string    `json:"Description,omitempty"`
	GrowthType                  string    `json:"GrowthType"`
	ReplicateTo                 string    `json:"ReplicateTo"`
	DeploymentDurationInMinutes int32     `json:"DeploymentDurationInMinutes"`
	GrowthFactor                float32   `json:"GrowthFactor"`
	FinalBakeTimeInMinutes      int32     `json:"FinalBakeTimeInMinutes"`
}

DeploymentStrategy represents an AppConfig deployment strategy.

type Environment

type Environment struct {
	CreatedAt     time.Time `json:"CreatedAt,omitzero"`
	UpdatedAt     time.Time `json:"UpdatedAt,omitzero"`
	ApplicationID string    `json:"ApplicationId"`
	ID            string    `json:"Id"`
	Name          string    `json:"Name"`
	Description   string    `json:"Description,omitempty"`
	State         string    `json:"State"`
	Monitors      []Monitor `json:"Monitors,omitempty"`
}

Environment represents an AppConfig environment.

type ExperimentDefinition added in v1.2.0

type ExperimentDefinition struct {
	CreatedAt              time.Time   `json:"CreatedAt,omitzero"`
	UpdatedAt              time.Time   `json:"UpdatedAt,omitzero"`
	ApplicationID          string      `json:"ApplicationId"`
	ID                     string      `json:"Id"`
	Name                   string      `json:"Name"`
	ConfigurationProfileID string      `json:"ConfigurationProfileId"`
	EnvironmentID          string      `json:"EnvironmentId"`
	FlagKey                string      `json:"FlagKey"`
	AudienceDescription    string      `json:"AudienceDescription,omitempty"`
	AudienceRule           string      `json:"AudienceRule"`
	Hypothesis             string      `json:"Hypothesis,omitempty"`
	LaunchCriteria         string      `json:"LaunchCriteria,omitempty"`
	KmsKeyIdentifier       string      `json:"KmsKeyIdentifier,omitempty"`
	Status                 string      `json:"Status"`
	Control                Treatment   `json:"Control"`
	Treatments             []Treatment `json:"Treatments,omitempty"`
}

ExperimentDefinition represents an AppConfig experiment definition: the purpose, scope, and treatment configuration of an A/B test attached to a feature-flag configuration profile.

type ExperimentDefinitionSnapshot added in v1.2.0

type ExperimentDefinitionSnapshot struct {
	ApplicationID          string      `json:"ApplicationId"`
	AudienceDescription    string      `json:"AudienceDescription,omitempty"`
	AudienceRule           string      `json:"AudienceRule"`
	ConfigurationProfileID string      `json:"ConfigurationProfileId"`
	Control                Treatment   `json:"Control"`
	EnvironmentID          string      `json:"EnvironmentId"`
	FlagKey                string      `json:"FlagKey"`
	Hypothesis             string      `json:"Hypothesis,omitempty"`
	ID                     string      `json:"Id"`
	LaunchCriteria         string      `json:"LaunchCriteria,omitempty"`
	Name                   string      `json:"Name"`
	Treatments             []Treatment `json:"Treatments,omitempty"`
}

ExperimentDefinitionSnapshot captures an ExperimentDefinition's fields at the moment StartExperimentRun was called, matching real AWS's "a snapshot of the experiment definition at the time the run was started" semantics: a later UpdateExperimentDefinition must not retroactively change what an already-started run reports it ran against.

type ExperimentRun added in v1.2.0

type ExperimentRun struct {
	StartedAt                    time.Time                     `json:"StartedAt,omitzero"`
	EndedAt                      time.Time                     `json:"EndedAt,omitzero"`
	UpdatedAt                    time.Time                     `json:"UpdatedAt,omitzero"`
	ApplicationID                string                        `json:"ApplicationId"`
	ExperimentDefinitionID       string                        `json:"ExperimentDefinitionId"`
	Description                  string                        `json:"Description,omitempty"`
	Status                       string                        `json:"Status"`
	Result                       *ExperimentRunResult          `json:"Result,omitempty"`
	ExperimentDefinitionSnapshot *ExperimentDefinitionSnapshot `json:"ExperimentDefinitionSnapshot,omitempty"`
	TreatmentOverrides           TreatmentOverrides            `json:"TreatmentOverrides,omitzero"`
	Events                       []ExperimentRunEvent          `json:"-"`
	ExposurePercentage           float32                       `json:"ExposurePercentage,omitempty"`
	Run                          int32                         `json:"Run"`
}

ExperimentRun represents one execution of an ExperimentDefinition: audience exposure, treatment overrides, and status over its lifetime. Real GetExperimentRun/StartExperimentRun/etc. output shapes have no DeploymentParameters member and no embedded event list -- events are retrieved separately via ListExperimentRunEvents -- so Events is intentionally unexported from JSON (internal bookkeeping only).

type ExperimentRunEvent added in v1.2.0

type ExperimentRunEvent struct {
	OccurredAt           time.Time          `json:"OccurredAt,omitzero"`
	TreatmentOverrides   TreatmentOverrides `json:"TreatmentOverrides,omitzero"`
	AssociatedDeployment string             `json:"AssociatedDeployment,omitempty"`
	Description          string             `json:"Description,omitempty"`
	EventType            string             `json:"EventType"`
	TriggeredBy          string             `json:"TriggeredBy,omitempty"`
	ExposurePercentage   float32            `json:"ExposurePercentage,omitempty"`
}

ExperimentRunEvent records a single lifecycle event -- run start, an exposure-percentage change, a treatment-override change, or a run stop -- observed during an experiment run. Events are recorded by this backend as they actually occur (see experiment_runs.go), never fabricated after the fact or synthesized as a plausible-looking timeline.

type ExperimentRunResult added in v1.2.0

type ExperimentRunResult struct {
	ExecutiveSummary   string `json:"ExecutiveSummary,omitempty"`
	ReasonsNotToLaunch string `json:"ReasonsNotToLaunch,omitempty"`
	ReasonsToLaunch    string `json:"ReasonsToLaunch,omitempty"`
}

ExperimentRunResult captures the free-text, client-supplied narrative outcome of an experiment run (an executive summary and launch/no-launch rationale). This backend has no analytics engine to compute these itself -- see the results_verdict discussion in PARITY.md -- so it only stores and echoes back whatever a caller (typically StopExperimentRun) supplies.

type Extension

type Extension struct {
	Actions       map[string][]ExtensionAction  `json:"Actions,omitempty"`
	Parameters    map[string]ExtensionParameter `json:"Parameters,omitempty"`
	Arn           string                        `json:"Arn"`
	Description   string                        `json:"Description,omitempty"`
	ID            string                        `json:"Id"`
	Name          string                        `json:"Name"`
	VersionNumber int32                         `json:"VersionNumber"`
}

Extension represents an AppConfig extension.

type ExtensionAction

type ExtensionAction struct {
	Name        string `json:"Name,omitempty"`
	Description string `json:"Description,omitempty"`
	RoleArn     string `json:"RoleArn,omitempty"`
	URI         string `json:"Uri,omitempty"`
}

ExtensionAction represents a single action in an AppConfig extension.

type ExtensionAssociation

type ExtensionAssociation struct {
	Parameters             map[string]string `json:"Parameters,omitempty"`
	Arn                    string            `json:"Arn"`
	ExtensionArn           string            `json:"ExtensionArn"`
	ID                     string            `json:"Id"`
	ResourceArn            string            `json:"ResourceArn"`
	ExtensionVersionNumber int32             `json:"ExtensionVersionNumber"`
}

ExtensionAssociation represents an association between an extension and an AppConfig resource.

type ExtensionParameter

type ExtensionParameter struct {
	Description string `json:"Description,omitempty"`
	Required    bool   `json:"Required,omitempty"`
}

ExtensionParameter describes a parameter accepted by an extension.

type FlagValue added in v1.2.0

type FlagValue struct {
	AttributeValues map[string]AttributeValue `json:"AttributeValues,omitempty"`
	Enabled         bool                      `json:"Enabled"`
}

FlagValue is the feature flag value served to users assigned to a Treatment.

type Handler

type Handler struct {
	Backend StorageBackend
}

Handler is the Echo HTTP handler for AppConfig operations.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new AppConfig Handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this handler instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation returns the operation name based on the parsed path and HTTP method.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the primary resource ID from the URL path.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for AppConfig operations.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function matching AppConfig REST API requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend. Handler previously had no Snapshot/Restore of its own -- and neither did InMemoryBackend -- so cli.go's generic setupPersistence (which type-asserts the registered service.Registerable, i.e. the Handler, for a Snapshot/Restore pair) never picked AppConfig up at all: dead wiring, with no persistence underneath it either. This delegation (matching the cleanrooms/codecommit/emr/workmail pattern) is what wires AppConfig into persistence for the first time.

type HostedConfigurationVersion

type HostedConfigurationVersion struct {
	CreatedAt              time.Time `json:"CreatedAt,omitzero"`
	ApplicationID          string    `json:"ApplicationId"`
	ConfigurationProfileID string    `json:"ConfigurationProfileId"`
	ContentType            string    `json:"ContentType"`
	Description            string    `json:"Description,omitempty"`
	VersionLabel           string    `json:"VersionLabel,omitempty"`
	Content                []byte    `json:"-"`
	VersionNumber          int32     `json:"VersionNumber"`
}

HostedConfigurationVersion represents a hosted configuration version.

type InMemoryBackend

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

InMemoryBackend implements StorageBackend for AppConfig using a store.Registry of store.Table-backed resource collections.

applications, deploymentStrategies, extensions, and extensionAssociations are flat, top-level collections keyed by their own real identity field (ID), matching the services/sesv2 / services/dax / services/datasync clean-direct-register template.

environments and configProfiles were previously nested two levels deep (outer key = applicationID; inner key = the resource's own ID). Both Environment.ID and ConfigurationProfile.ID are generated by the same globally-random newResourceID() every other resource in this backend uses (not parent-scoped), so -- per the opsworks/datasync "globally-unique ID, bare-ID lookups" precedent -- each registers DIRECTLY on its own ID, with a companion byApp *store.Index (grouping entries by ApplicationID) added additively for the per-application List/cascade-delete operations the nested maps used to answer directly. A second byAppName *store.Index (composite "applicationID|name" key) replaces the old environmentsByName/configProfilesByName nested reverse maps for the per-application name-uniqueness checks.

hostedConfigVersions and deployments were previously nested three levels deep (outer key = applicationID; middle key = profileID/environmentID; inner key = an int32 VersionNumber/DeploymentNumber). Unlike the resource IDs above, VersionNumber and DeploymentNumber are per-parent counters -- unique only within their owning profile/environment, not globally -- so per the composite-key rule each flattens to one *store.Table keyed by a composite "applicationID|parentID|number" string (see hcvKey/deploymentKey below), with companion *store.Index values grouping entries by profile/env (List operations) and by application (DeleteApplication's cascade delete). hostedConfigVersions additionally carries a byLabel *store.Index replacing the old versionLabelIndex raw map: VersionLabel uniqueness is answered by the index instead of a parallel set.

Left as plain maps (not store.Table-backed):

  • tags (map[string]map[string]string): its values are plain string maps, not *T, so it does not fit store.Table's keyed-by-identity-value shape.
  • versionCounters, deploymentCounters (map[string]map[string]int32): their values are int32, not *T. Both must survive Snapshot/Restore (see persistence.go) since they are the source of truth for the next version/deployment number -- reconstructing them from the tables' current contents would under-count after any delete.
  • accountSettings is a single struct, not a map at all.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new InMemoryBackend for AppConfig.

func (*InMemoryBackend) CreateApplication

func (b *InMemoryBackend) CreateApplication(name, description string, tags map[string]string) (*Application, error)

CreateApplication creates a new AppConfig application. See CreateExperimentDefinition's doc comment for why tags are applied directly to b.tags rather than via TagResource.

func (*InMemoryBackend) CreateConfigurationProfile

func (b *InMemoryBackend) CreateConfigurationProfile(
	applicationID, name, description, locationURI, profileType, retrievalRoleArn string,
	validators []Validator,
	tags map[string]string,
) (*ConfigurationProfile, error)

CreateConfigurationProfile creates a new configuration profile. See CreateExperimentDefinition's doc comment for why tags are applied directly to b.tags rather than via TagResource.

func (*InMemoryBackend) CreateDeploymentStrategy

func (b *InMemoryBackend) CreateDeploymentStrategy(
	name, description string,
	deploymentDuration, bakeTime int32,
	growthFactor float32,
	growthType, replicateTo string,
	tags map[string]string,
) (*DeploymentStrategy, error)

CreateDeploymentStrategy creates a new deployment strategy. See CreateExperimentDefinition's doc comment for why tags are applied directly to b.tags rather than via TagResource.

func (*InMemoryBackend) CreateEnvironment

func (b *InMemoryBackend) CreateEnvironment(
	applicationID, name, description string,
	monitors []Monitor,
	tags map[string]string,
) (*Environment, error)

CreateEnvironment creates a new environment within an application. See CreateExperimentDefinition's doc comment for why tags are applied directly to b.tags rather than via TagResource.

func (*InMemoryBackend) CreateExperimentDefinition added in v1.2.0

func (b *InMemoryBackend) CreateExperimentDefinition(
	applicationIdentifier, name, environmentIdentifier, configurationProfileIdentifier, flagKey,
	audienceRule, audienceDescription, hypothesis, launchCriteria string,
	control *Treatment,
	treatments []Treatment,
	tags map[string]string,
) (*ExperimentDefinition, error)

CreateExperimentDefinition creates a new experiment definition. See the StorageBackend interface doc comment for parameter semantics.

func (*InMemoryBackend) CreateExtension

func (b *InMemoryBackend) CreateExtension(
	name, description string,
	actions map[string][]ExtensionAction,
	parameters map[string]ExtensionParameter,
	tags map[string]string,
) (*Extension, error)

CreateExtension creates a new AppConfig extension at version 1. See CreateExperimentDefinition's doc comment for why tags are applied directly to b.tags rather than via TagResource.

func (*InMemoryBackend) CreateExtensionAssociation

func (b *InMemoryBackend) CreateExtensionAssociation(
	extensionIdentifier, resourceIdentifier string,
	parameters map[string]string,
	extensionVersionNumber *int32,
	tags map[string]string,
) (*ExtensionAssociation, error)

CreateExtensionAssociation creates an association between an extension and a resource. See CreateExperimentDefinition's doc comment for why tags are applied directly to b.tags rather than via TagResource.

func (*InMemoryBackend) CreateHostedConfigurationVersion

func (b *InMemoryBackend) CreateHostedConfigurationVersion(
	applicationID, profileID, contentType, description, versionLabel string,
	content []byte,
	latestVersionNumber *int32,
) (*HostedConfigurationVersion, error)

CreateHostedConfigurationVersion creates a hosted configuration version. latestVersionNumber implements real CreateHostedConfigurationVersionInput's optional optimistic-concurrency check (the "Latest-Version-Number" request header): when non-nil, it must match the profile's current highest version, or the create is rejected with a conflict rather than silently racing another writer.

func (*InMemoryBackend) CurrentDeployedConfiguration added in v1.2.0

func (b *InMemoryBackend) CurrentDeployedConfiguration(
	application, environment, configuration string,
) ([]byte, string, string, error)

CurrentDeployedConfiguration returns the content, content type, and version label of the configuration currently active (the most recently COMPLETEd deployment) for the given application/environment/configuration profile. See the StorageBackend interface doc comment for why this exists: it is a public accessor with no caller inside this package today, exposed for a future appconfig -> appconfigdata bridge.

func (*InMemoryBackend) DeleteApplication

func (b *InMemoryBackend) DeleteApplication(applicationID string) error

DeleteApplication deletes an application by ID.

func (*InMemoryBackend) DeleteConfigurationProfile

func (b *InMemoryBackend) DeleteConfigurationProfile(applicationID, profileID string) error

DeleteConfigurationProfile deletes a configuration profile.

func (*InMemoryBackend) DeleteDeploymentStrategy

func (b *InMemoryBackend) DeleteDeploymentStrategy(strategyID string) error

DeleteDeploymentStrategy deletes a deployment strategy.

func (*InMemoryBackend) DeleteEnvironment

func (b *InMemoryBackend) DeleteEnvironment(applicationID, environmentID string) error

DeleteEnvironment deletes an environment.

func (*InMemoryBackend) DeleteExperimentDefinition added in v1.2.0

func (b *InMemoryBackend) DeleteExperimentDefinition(
	applicationIdentifier, experimentDefinitionIdentifier, deleteType string,
) error

DeleteExperimentDefinition archives or permanently destroys an experiment definition. See the StorageBackend interface doc comment for deleteType semantics, including the ARCHIVE default this backend applies when deleteType is empty: the real SDK's DeleteType doc text describes ARCHIVE as "hide but preserve" and DESTROY as the explicit opt-in to permanent removal, so an omitted deleteType is treated as the non-destructive choice rather than assuming irreversible deletion was intended (unverified against real AWS -- the SDK does not document a default -- and called out here plus in PARITY.md as an assumption, not a confirmed wire fact).

func (*InMemoryBackend) DeleteExtension

func (b *InMemoryBackend) DeleteExtension(extensionIdentifier string, versionNumber int32) error

DeleteExtension deletes an extension version by identifier (ID or name). A versionNumber of 0 means "not specified" -- matching real AWS AppConfig, this deletes the highest (most recently created) version only, not every version. Deleting the last remaining version removes the extension entirely, including its tags. Returns ErrConflict (matching real AWS's ConflictException) if any ExtensionAssociation still references the version being deleted.

func (*InMemoryBackend) DeleteExtensionAssociation

func (b *InMemoryBackend) DeleteExtensionAssociation(extensionAssociationID string) error

DeleteExtensionAssociation deletes an extension association by ID.

func (*InMemoryBackend) DeleteHostedConfigurationVersion

func (b *InMemoryBackend) DeleteHostedConfigurationVersion(
	applicationID, profileID string,
	versionNumber int32,
) error

DeleteHostedConfigurationVersion deletes a hosted configuration version.

func (*InMemoryBackend) GetAccountSettings

func (b *InMemoryBackend) GetAccountSettings() (*AccountSettings, error)

GetAccountSettings returns the account-level AppConfig settings.

func (*InMemoryBackend) GetApplication

func (b *InMemoryBackend) GetApplication(applicationID string) (*Application, error)

GetApplication retrieves an application by ID.

func (*InMemoryBackend) GetConfiguration

func (b *InMemoryBackend) GetConfiguration(
	application, environment, configuration string,
) (*HostedConfigurationVersion, error)

GetConfiguration retrieves the latest DEPLOYED configuration for the given application, environment, and configuration profile (deprecated API).

func (*InMemoryBackend) GetConfigurationProfile

func (b *InMemoryBackend) GetConfigurationProfile(
	applicationID, profileID string,
) (*ConfigurationProfile, error)

GetConfigurationProfile retrieves a configuration profile.

func (*InMemoryBackend) GetDeployment

func (b *InMemoryBackend) GetDeployment(
	applicationID, environmentID string,
	deploymentNumber int32,
) (*Deployment, error)

GetDeployment retrieves a deployment.

func (*InMemoryBackend) GetDeploymentStrategy

func (b *InMemoryBackend) GetDeploymentStrategy(strategyID string) (*DeploymentStrategy, error)

GetDeploymentStrategy retrieves a deployment strategy by ID.

func (*InMemoryBackend) GetEnvironment

func (b *InMemoryBackend) GetEnvironment(
	applicationID, environmentID string,
) (*Environment, error)

GetEnvironment retrieves an environment by application and environment ID.

func (*InMemoryBackend) GetExperimentDefinition added in v1.2.0

func (b *InMemoryBackend) GetExperimentDefinition(
	applicationIdentifier, experimentDefinitionIdentifier string,
) (*ExperimentDefinition, error)

GetExperimentDefinition retrieves an experiment definition by application and experiment definition identifier (each accepted by ID or name).

func (*InMemoryBackend) GetExperimentRun added in v1.2.0

func (b *InMemoryBackend) GetExperimentRun(
	applicationIdentifier, experimentDefinitionIdentifier string, run int32,
) (*ExperimentRun, error)

GetExperimentRun retrieves an experiment run by application, experiment definition identifier, and run number.

func (*InMemoryBackend) GetExtension

func (b *InMemoryBackend) GetExtension(
	extensionIdentifier string,
	versionNumber int32,
) (*Extension, error)

GetExtension retrieves an extension by identifier (ID or name). A versionNumber of 0 means "not specified" -- matching real AWS AppConfig, this returns the highest (most recently created) version.

func (*InMemoryBackend) GetExtensionAssociation

func (b *InMemoryBackend) GetExtensionAssociation(
	extensionAssociationID string,
) (*ExtensionAssociation, error)

GetExtensionAssociation retrieves an extension association by ID.

func (*InMemoryBackend) GetHostedConfigurationVersion

func (b *InMemoryBackend) GetHostedConfigurationVersion(
	applicationID, profileID string,
	versionNumber int32,
) (*HostedConfigurationVersion, error)

GetHostedConfigurationVersion retrieves a hosted configuration version.

func (*InMemoryBackend) ListApplications

func (b *InMemoryBackend) ListApplications(
	nextToken string,
	maxResults int,
) ([]Application, string)

ListApplications returns paginated applications.

func (*InMemoryBackend) ListConfigurationProfiles

func (b *InMemoryBackend) ListConfigurationProfiles(
	applicationID, nextToken string,
	maxResults int,
) ([]ConfigurationProfile, string, error)

ListConfigurationProfiles returns paginated profiles for an application.

func (*InMemoryBackend) ListDeploymentStrategies

func (b *InMemoryBackend) ListDeploymentStrategies(
	nextToken string,
	maxResults int,
) ([]DeploymentStrategy, string)

ListDeploymentStrategies returns paginated deployment strategies.

func (*InMemoryBackend) ListDeployments

func (b *InMemoryBackend) ListDeployments(
	applicationID, environmentID, nextToken string,
	maxResults int,
) ([]Deployment, string, error)

ListDeployments returns paginated deployments for an environment.

func (*InMemoryBackend) ListEnvironments

func (b *InMemoryBackend) ListEnvironments(
	applicationID, nextToken string,
	maxResults int,
) ([]Environment, string, error)

ListEnvironments returns paginated environments for an application.

func (*InMemoryBackend) ListExperimentDefinitions added in v1.2.0

func (b *InMemoryBackend) ListExperimentDefinitions(
	applicationIdentifier, configurationProfileIdentifier, environmentIdentifier, status, nextToken string,
	maxResults int,
) ([]ExperimentDefinition, string)

ListExperimentDefinitions returns experiment definitions across the account, optionally filtered by application/configuration-profile/ environment identifier and status. See the StorageBackend interface doc comment for the identifier-filter resolution rules.

func (*InMemoryBackend) ListExperimentRunEvents added in v1.2.0

func (b *InMemoryBackend) ListExperimentRunEvents(
	applicationIdentifier, experimentDefinitionIdentifier string,
	run int32,
	nextToken string,
	maxResults int,
) ([]ExperimentRunEvent, string, error)

ListExperimentRunEvents returns the events this backend actually recorded during the run's lifecycle, most-recent-first.

func (*InMemoryBackend) ListExperimentRuns added in v1.2.0

func (b *InMemoryBackend) ListExperimentRuns(
	applicationIdentifier, experimentDefinitionIdentifier, status, nextToken string,
	maxResults int,
) ([]ExperimentRun, string, error)

ListExperimentRuns returns paginated runs for an experiment definition, optionally filtered by status.

func (*InMemoryBackend) ListExtensionAssociations

func (b *InMemoryBackend) ListExtensionAssociations(
	nextToken, extensionIdentifier, resourceIdentifier string,
	maxResults int,
) ([]ExtensionAssociation, string)

ListExtensionAssociations returns paginated extension associations, optionally filtered by extensionIdentifier (ARN prefix) and/or resourceIdentifier (ARN prefix).

func (*InMemoryBackend) ListExtensions

func (b *InMemoryBackend) ListExtensions(
	nextToken string,
	maxResults int,
	nameFilter string,
) ([]Extension, string)

ListExtensions returns paginated extensions, optionally filtered by name. Real ListExtensionsInput has no version filter (extensions are versioned resources, but ListExtensions summarizes one row per extension at its current/highest version -- there is no ListExtensionVersions API), so one row is returned per distinct extension ID, at its latest version.

func (*InMemoryBackend) ListHostedConfigurationVersions

func (b *InMemoryBackend) ListHostedConfigurationVersions(
	applicationID, profileID, nextToken, versionLabel string, maxResults int,
) ([]HostedConfigurationVersion, string, error)

ListHostedConfigurationVersions returns paginated versions for a profile, optionally filtered by versionLabel.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(resourceArn string) (map[string]string, error)

ListTagsForResource returns the tags for the given resource ARN.

func (*InMemoryBackend) PaginationSecret

func (b *InMemoryBackend) PaginationSecret() string

PaginationSecret returns the HMAC secret for pagination tokens.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore deserializes backend state from a snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serializes the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) StartDeployment

func (b *InMemoryBackend) StartDeployment(
	applicationID, environmentID, configProfileID, strategyID, configVersion, description string,
) (*Deployment, error)

StartDeployment starts a deployment.

func (*InMemoryBackend) StartExperimentRun added in v1.2.0

func (b *InMemoryBackend) StartExperimentRun(
	applicationIdentifier, experimentDefinitionIdentifier, description string,
	exposurePercentage *float32,
	treatmentOverrides map[string]string,
	tags map[string]string,
) (*ExperimentRun, error)

StartExperimentRun starts a new run of an experiment definition. See the StorageBackend interface doc comment for parameter semantics.

func (*InMemoryBackend) StopDeployment

func (b *InMemoryBackend) StopDeployment(
	applicationID, environmentID string,
	deploymentNumber int32,
	allowRevert bool,
) error

StopDeployment stops an in-progress deployment, moving it to ROLLED_BACK. When allowRevert is true and the deployment is already COMPLETE, it instead reverts the environment to the previous configuration version and moves the deployment to REVERTED -- matching real StopDeploymentInput.AllowRevert semantics.

func (*InMemoryBackend) StopExperimentRun added in v1.2.0

func (b *InMemoryBackend) StopExperimentRun(
	applicationIdentifier, experimentDefinitionIdentifier string,
	run int32,
	result *ExperimentRunResult,
) (*ExperimentRun, error)

StopExperimentRun stops a RUNNING experiment run, moving it to DONE.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceArn string, tags map[string]string) error

TagResource adds or replaces tags on the given resource ARN.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceArn string, tagKeys []string) error

UntagResource removes the specified tag keys from the given resource ARN.

func (*InMemoryBackend) UpdateAccountSettings

func (b *InMemoryBackend) UpdateAccountSettings(
	deletionProtection *DeletionProtectionSettings,
) (*AccountSettings, error)

UpdateAccountSettings updates account-level AppConfig settings.

func (*InMemoryBackend) UpdateApplication

func (b *InMemoryBackend) UpdateApplication(
	applicationID string, name, description *string,
) (*Application, error)

UpdateApplication updates an application's name and description. A nil name/description means the request omitted that field, and AWS AppConfig leaves an omitted field unchanged rather than clearing it (only an explicit, present value -- including "" -- overwrites).

func (*InMemoryBackend) UpdateConfigurationProfile

func (b *InMemoryBackend) UpdateConfigurationProfile(
	applicationID, profileID string,
	name, description, retrievalRoleArn *string,
	validators *[]Validator,
) (*ConfigurationProfile, error)

UpdateConfigurationProfile updates a configuration profile. A nil name/description/retrievalRoleArn/validators means the request omitted that field, and AWS AppConfig leaves an omitted field unchanged rather than clearing it.

func (*InMemoryBackend) UpdateDeploymentStrategy

func (b *InMemoryBackend) UpdateDeploymentStrategy(
	strategyID, name string,
	description *string,
	deploymentDuration, bakeTime int32,
	growthFactor float32,
) (*DeploymentStrategy, error)

UpdateDeploymentStrategy updates a deployment strategy. A nil description means the request omitted that field, and AWS AppConfig leaves an omitted field unchanged rather than clearing it.

func (*InMemoryBackend) UpdateEnvironment

func (b *InMemoryBackend) UpdateEnvironment(
	applicationID, environmentID string,
	name, description *string,
	monitors *[]Monitor,
) (*Environment, error)

UpdateEnvironment updates an environment's name, description, and monitors. A nil name/description/monitors means the request omitted that field, and AWS AppConfig leaves an omitted field unchanged rather than clearing it.

func (*InMemoryBackend) UpdateExperimentDefinition added in v1.2.0

func (b *InMemoryBackend) UpdateExperimentDefinition(
	applicationIdentifier, experimentDefinitionIdentifier string,
	audienceDescription, audienceRule *string,
	control *Treatment,
	hypothesis, launchCriteria *string,
	treatments *[]Treatment,
) (*ExperimentDefinition, error)

UpdateExperimentDefinition updates an experiment definition. See the StorageBackend interface doc comment for nil-means-unchanged semantics.

func (*InMemoryBackend) UpdateExperimentRun added in v1.2.0

func (b *InMemoryBackend) UpdateExperimentRun(
	applicationIdentifier, experimentDefinitionIdentifier string,
	run int32,
	description *string,
	exposurePercentage *float32,
	treatmentOverrides *TreatmentOverrides,
) (*ExperimentRun, error)

UpdateExperimentRun updates a RUNNING experiment run. See the StorageBackend interface doc comment for semantics.

func (*InMemoryBackend) UpdateExtension

func (b *InMemoryBackend) UpdateExtension(
	extensionIdentifier string,
	description *string,
	actions map[string][]ExtensionAction,
	parameters map[string]ExtensionParameter,
) (*Extension, error)

UpdateExtension updates an extension's description, actions, and parameters by creating a NEW version from the current highest version -- matching real AWS AppConfig, where every UpdateExtension call produces a new, independently addressable extension version rather than mutating one in place. A nil description means the request omitted that field, and AWS AppConfig leaves an omitted field unchanged rather than clearing it.

func (*InMemoryBackend) UpdateExtensionAssociation

func (b *InMemoryBackend) UpdateExtensionAssociation(
	extensionAssociationID string,
	parameters map[string]string,
) (*ExtensionAssociation, error)

UpdateExtensionAssociation updates an extension association's parameters.

func (*InMemoryBackend) ValidateConfiguration

func (b *InMemoryBackend) ValidateConfiguration(applicationID, profileID, _ string) error

ValidateConfiguration validates a configuration version against its validators. In this implementation, all well-formed configurations are considered valid. The configurationVersion parameter is accepted for API compatibility but not evaluated.

type Monitor

type Monitor struct {
	AlarmArn     string `json:"AlarmArn"`
	AlarmRoleArn string `json:"AlarmRoleArn,omitempty"`
}

Monitor represents an Amazon CloudWatch alarm used to monitor an AppConfig environment.

type Provider

type Provider struct{}

Provider implements service.Provider for the AppConfig service.

func (*Provider) Init

Init initialises the AppConfig backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type StorageBackend

type StorageBackend interface {
	// PaginationSecret returns the HMAC secret used to sign pagination tokens.
	PaginationSecret() string

	// Snapshot and Restore implement persistence.Persistable. Handler
	// delegates to them (see persistence.go) so cli.go's generic
	// setupPersistence picks AppConfig up.
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error

	// CreateApplication creates a new AppConfig application. tags are
	// applied inline at creation time (see CreateExperimentDefinition's
	// doc comment for why TagResource is not used for this).
	CreateApplication(name, description string, tags map[string]string) (*Application, error)
	// GetApplication retrieves an application by ID.
	GetApplication(applicationID string) (*Application, error)
	// ListApplications returns paginated applications.
	ListApplications(nextToken string, maxResults int) ([]Application, string)
	// UpdateApplication updates an application's name and description. A nil
	// name/description means the field was omitted from the request and must
	// be left unchanged (real UpdateApplicationInput.Name/Description are
	// optional *string members; only a present, non-nil member overwrites
	// the existing value -- see AWS AppConfig's UpdateApplication contract).
	UpdateApplication(applicationID string, name, description *string) (*Application, error)
	// DeleteApplication deletes an application by ID.
	DeleteApplication(applicationID string) error

	// CreateEnvironment creates a new environment within an application.
	// tags are applied inline at creation time (see CreateApplication).
	CreateEnvironment(
		applicationID, name, description string,
		monitors []Monitor,
		tags map[string]string,
	) (*Environment, error)
	// GetEnvironment retrieves an environment by application and environment ID.
	GetEnvironment(applicationID, environmentID string) (*Environment, error)
	// ListEnvironments returns paginated environments for an application.
	ListEnvironments(applicationID, nextToken string, maxResults int) ([]Environment, string, error)
	// UpdateEnvironment updates an environment's name, description, and
	// monitors. A nil name/description leaves the field unchanged (see
	// UpdateApplication doc); a nil monitors leaves the existing monitor
	// list unchanged, while a non-nil (possibly empty) slice replaces it,
	// matching UpdateEnvironmentInput's optional Monitors member.
	UpdateEnvironment(
		applicationID, environmentID string,
		name, description *string,
		monitors *[]Monitor,
	) (*Environment, error)
	// DeleteEnvironment deletes an environment.
	DeleteEnvironment(applicationID, environmentID string) error

	// CreateConfigurationProfile creates a new configuration profile. tags
	// are applied inline at creation time (see CreateApplication).
	CreateConfigurationProfile(
		applicationID, name, description, locationURI, profileType, retrievalRoleArn string,
		validators []Validator,
		tags map[string]string,
	) (*ConfigurationProfile, error)
	// GetConfigurationProfile retrieves a configuration profile.
	GetConfigurationProfile(applicationID, profileID string) (*ConfigurationProfile, error)
	// ListConfigurationProfiles returns paginated profiles for an application.
	ListConfigurationProfiles(
		applicationID, nextToken string,
		maxResults int,
	) ([]ConfigurationProfile, string, error)
	// UpdateConfigurationProfile updates a configuration profile. Nil
	// name/description/retrievalRoleArn leave the field unchanged; a nil
	// validators leaves the existing validator list unchanged, while a
	// non-nil (possibly empty) slice replaces it -- matching
	// UpdateConfigurationProfileInput's optional members.
	UpdateConfigurationProfile(
		applicationID, profileID string,
		name, description, retrievalRoleArn *string,
		validators *[]Validator,
	) (*ConfigurationProfile, error)
	// DeleteConfigurationProfile deletes a configuration profile.
	DeleteConfigurationProfile(applicationID, profileID string) error

	// CreateHostedConfigurationVersion creates a hosted configuration
	// version. latestVersionNumber implements the optional
	// optimistic-concurrency check real AWS binds to the
	// "Latest-Version-Number" request header: when non-nil, it must match
	// the profile's current latest version or the call is rejected.
	CreateHostedConfigurationVersion(
		applicationID, profileID, contentType, description, versionLabel string,
		content []byte,
		latestVersionNumber *int32,
	) (*HostedConfigurationVersion, error)
	// GetHostedConfigurationVersion retrieves a hosted configuration version.
	GetHostedConfigurationVersion(
		applicationID, profileID string,
		versionNumber int32,
	) (*HostedConfigurationVersion, error)
	// ListHostedConfigurationVersions returns paginated versions for a profile.
	ListHostedConfigurationVersions(
		applicationID, profileID, nextToken, versionLabel string,
		maxResults int,
	) ([]HostedConfigurationVersion, string, error)
	// DeleteHostedConfigurationVersion deletes a hosted configuration version.
	DeleteHostedConfigurationVersion(applicationID, profileID string, versionNumber int32) error

	// CreateDeploymentStrategy creates a new deployment strategy. tags are
	// applied inline at creation time (see CreateApplication).
	CreateDeploymentStrategy(
		name, description string,
		deploymentDuration, bakeTime int32,
		growthFactor float32,
		growthType, replicateTo string,
		tags map[string]string,
	) (*DeploymentStrategy, error)
	// GetDeploymentStrategy retrieves a deployment strategy by ID.
	GetDeploymentStrategy(strategyID string) (*DeploymentStrategy, error)
	// ListDeploymentStrategies returns paginated deployment strategies.
	ListDeploymentStrategies(nextToken string, maxResults int) ([]DeploymentStrategy, string)
	// UpdateDeploymentStrategy updates a deployment strategy. A nil
	// description leaves the field unchanged (real
	// UpdateDeploymentStrategyInput.Description is an optional *string
	// member); name has no counterpart in the real API and is applied only
	// when non-empty, matching this backend's pre-existing behavior.
	UpdateDeploymentStrategy(
		strategyID, name string,
		description *string,
		deploymentDuration, bakeTime int32,
		growthFactor float32,
	) (*DeploymentStrategy, error)
	// DeleteDeploymentStrategy deletes a deployment strategy.
	DeleteDeploymentStrategy(strategyID string) error

	// StartDeployment starts a deployment.
	StartDeployment(
		applicationID, environmentID, configProfileID, strategyID, configVersion, description string,
	) (*Deployment, error)
	// GetDeployment retrieves a deployment by application, environment, and deployment number.
	GetDeployment(applicationID, environmentID string, deploymentNumber int32) (*Deployment, error)
	// ListDeployments returns paginated deployments for an environment.
	ListDeployments(
		applicationID, environmentID, nextToken string,
		maxResults int,
	) ([]Deployment, string, error)
	// StopDeployment stops an in-progress deployment, or -- when
	// allowRevert is true and the deployment is already COMPLETE --
	// reverts the environment to the previous configuration version
	// (real StopDeploymentInput.AllowRevert semantics).
	StopDeployment(applicationID, environmentID string, deploymentNumber int32, allowRevert bool) error

	// ListTagsForResource returns the tags for a resource by ARN.
	ListTagsForResource(resourceArn string) (map[string]string, error)
	// TagResource adds or updates tags on a resource.
	TagResource(resourceArn string, tags map[string]string) error
	// UntagResource removes tags from a resource.
	UntagResource(resourceArn string, tagKeys []string) error

	// CreateExtension creates a new AppConfig extension. tags are applied
	// inline at creation time (see CreateApplication).
	CreateExtension(
		name, description string,
		actions map[string][]ExtensionAction,
		parameters map[string]ExtensionParameter,
		tags map[string]string,
	) (*Extension, error)
	// GetExtension retrieves an extension by identifier (ID or name) and
	// optional version number (0 means unspecified: the highest version).
	GetExtension(extensionIdentifier string, versionNumber int32) (*Extension, error)
	// ListExtensions returns paginated extensions, optionally filtered by name.
	ListExtensions(
		nextToken string,
		maxResults int,
		nameFilter string,
	) ([]Extension, string)
	// UpdateExtension updates an extension's description, actions, and
	// parameters. A nil description leaves the field unchanged (real
	// UpdateExtensionInput.Description is an optional *string member).
	UpdateExtension(
		extensionIdentifier string,
		description *string,
		actions map[string][]ExtensionAction,
		parameters map[string]ExtensionParameter,
	) (*Extension, error)
	// DeleteExtension deletes an extension version by identifier (ID or
	// name) and optional version number (0 means unspecified: the highest
	// version).
	DeleteExtension(extensionIdentifier string, versionNumber int32) error

	// CreateExtensionAssociation creates an association between an
	// extension and a resource. tags are applied inline at creation time
	// (see CreateApplication).
	CreateExtensionAssociation(
		extensionIdentifier, resourceIdentifier string,
		parameters map[string]string,
		extensionVersionNumber *int32,
		tags map[string]string,
	) (*ExtensionAssociation, error)
	// GetExtensionAssociation retrieves an extension association by ID.
	GetExtensionAssociation(extensionAssociationID string) (*ExtensionAssociation, error)
	// ListExtensionAssociations returns paginated extension associations.
	ListExtensionAssociations(
		nextToken, extensionIdentifier, resourceIdentifier string,
		maxResults int,
	) ([]ExtensionAssociation, string)
	// UpdateExtensionAssociation updates an extension association's parameters.
	UpdateExtensionAssociation(
		extensionAssociationID string,
		parameters map[string]string,
	) (*ExtensionAssociation, error)
	// DeleteExtensionAssociation deletes an extension association by ID.
	DeleteExtensionAssociation(extensionAssociationID string) error

	// GetAccountSettings returns the account-level AppConfig settings.
	GetAccountSettings() (*AccountSettings, error)
	// UpdateAccountSettings updates account-level AppConfig settings.
	UpdateAccountSettings(deletionProtection *DeletionProtectionSettings) (*AccountSettings, error)

	// GetConfiguration retrieves the latest deployed configuration (deprecated API).
	GetConfiguration(
		application, environment, configuration string,
	) (*HostedConfigurationVersion, error)
	// ValidateConfiguration validates a configuration version against its validators.
	ValidateConfiguration(applicationID, profileID, configurationVersion string) error

	// CurrentDeployedConfiguration returns the content, content type, and
	// version label of the configuration currently active (the most
	// recently COMPLETEd deployment) for the given
	// application/environment/configuration-profile, each resolved by ID
	// or name exactly like GetConfiguration. It has no caller within this
	// package today -- it is a public read accessor exposed for a future
	// appconfig -> appconfigdata bridge (bd gopherstack-uiyi): once a
	// deployment completes, cli.go wiring (out of scope for this change)
	// can call this and push the result into
	// appconfigdata's SetConfiguration(app, env, profile, content,
	// contentType) so GetLatestConfiguration polling reflects real
	// deployment state instead of an unpopulated store.
	CurrentDeployedConfiguration(
		application, environment, configuration string,
	) (content []byte, contentType, versionLabel string, err error)

	// CreateExperimentDefinition creates a new experiment definition
	// attached to a feature-flag configuration profile. applicationIdentifier,
	// environmentIdentifier, and configurationProfileIdentifier are each
	// resolved by ID or name and validated against real backend state.
	// control must be non-nil with a non-nil FlagValue; every element of
	// treatments must likewise carry a non-nil FlagValue. Key on both is
	// server-generated (see the Treatment doc comment in models.go). tags
	// are applied inline to the new definition's ARN at creation time (see
	// CreateExperimentDefinition's doc comment in experiment_definitions.go
	// for why -- avoids the inline-Tags-dropped bug tracked by bd
	// gopherstack-lcan).
	CreateExperimentDefinition(
		applicationIdentifier, name, environmentIdentifier, configurationProfileIdentifier, flagKey,
		audienceRule, audienceDescription, hypothesis, launchCriteria string,
		control *Treatment,
		treatments []Treatment,
		tags map[string]string,
	) (*ExperimentDefinition, error)
	// GetExperimentDefinition retrieves an experiment definition by
	// application and experiment definition identifier (each accepted by
	// ID or name).
	GetExperimentDefinition(
		applicationIdentifier, experimentDefinitionIdentifier string,
	) (*ExperimentDefinition, error)
	// ListExperimentDefinitions returns experiment definitions across the
	// account, optionally filtered by application/configuration-profile/
	// environment identifier and status. An identifier filter that cannot
	// be resolved yields an empty result (a filter with no matches), not
	// an error.
	ListExperimentDefinitions(
		applicationIdentifier, configurationProfileIdentifier, environmentIdentifier, status, nextToken string,
		maxResults int,
	) ([]ExperimentDefinition, string)
	// UpdateExperimentDefinition updates an experiment definition. A nil
	// pointer field means the request omitted it and it is left unchanged;
	// a non-nil treatments fully replaces the treatment list (fresh Keys
	// assigned). Returns ErrConflict if a RUNNING run currently exists for
	// this definition, matching real AWS's "cannot update ... while an
	// experiment run is active."
	UpdateExperimentDefinition(
		applicationIdentifier, experimentDefinitionIdentifier string,
		audienceDescription, audienceRule *string,
		control *Treatment,
		hypothesis, launchCriteria *string,
		treatments *[]Treatment,
	) (*ExperimentDefinition, error)
	// DeleteExperimentDefinition archives (deleteType "ARCHIVE", the
	// default this backend applies when deleteType is empty -- see the doc
	// comment in experiment_definitions.go for why) or permanently
	// destroys (deleteType "DESTROY") an experiment definition. DESTROY
	// cascade-deletes every run, run event, and tag scoped to it.
	DeleteExperimentDefinition(applicationIdentifier, experimentDefinitionIdentifier, deleteType string) error

	// StartExperimentRun starts a new run of an experiment definition.
	// Only one run may be RUNNING per definition at a time (ErrConflict
	// otherwise). exposurePercentage nil defaults to 0 -- see the doc
	// comment in experiment_runs.go. tags are applied inline to the new
	// run's own ARN, same inline-tagging fix as CreateExperimentDefinition.
	StartExperimentRun(
		applicationIdentifier, experimentDefinitionIdentifier, description string,
		exposurePercentage *float32,
		treatmentOverrides map[string]string,
		tags map[string]string,
	) (*ExperimentRun, error)
	// GetExperimentRun retrieves an experiment run by application,
	// experiment definition identifier, and run number.
	GetExperimentRun(
		applicationIdentifier, experimentDefinitionIdentifier string, run int32,
	) (*ExperimentRun, error)
	// ListExperimentRuns returns paginated runs for an experiment
	// definition, optionally filtered by status.
	ListExperimentRuns(
		applicationIdentifier, experimentDefinitionIdentifier, status, nextToken string,
		maxResults int,
	) ([]ExperimentRun, string, error)
	// UpdateExperimentRun updates a RUNNING experiment run's description,
	// exposure percentage (which can only increase, matching real AWS),
	// and/or treatment overrides. A nil field is left unchanged. Returns
	// ErrBadRequest if the run is not RUNNING or the new exposure
	// percentage would decrease it.
	UpdateExperimentRun(
		applicationIdentifier, experimentDefinitionIdentifier string,
		run int32,
		description *string,
		exposurePercentage *float32,
		treatmentOverrides *TreatmentOverrides,
	) (*ExperimentRun, error)
	// StopExperimentRun stops a RUNNING experiment run, moving it to DONE.
	// Returns ErrBadRequest if the run is not currently RUNNING.
	StopExperimentRun(
		applicationIdentifier, experimentDefinitionIdentifier string,
		run int32,
		result *ExperimentRunResult,
	) (*ExperimentRun, error)
	// ListExperimentRunEvents returns the events this backend actually
	// recorded during the run's lifecycle (RUN_STARTED/EXPOSURE_UPDATED/
	// OVERRIDES_UPDATED/RUN_STOPPED), most-recent-first -- never a
	// fabricated timeline.
	ListExperimentRunEvents(
		applicationIdentifier, experimentDefinitionIdentifier string,
		run int32,
		nextToken string,
		maxResults int,
	) ([]ExperimentRunEvent, string, error)
}

StorageBackend defines the operations supported by the AppConfig in-memory backend.

type Treatment added in v1.2.0

type Treatment struct {
	FlagValue   *FlagValue `json:"FlagValue,omitempty"`
	Description string     `json:"Description,omitempty"`
	Key         string     `json:"Key,omitempty"`
	Weight      float32    `json:"Weight"`
}

Treatment represents one variation (or the control) evaluated during an experiment. Key is server-generated: real CreateExperimentDefinition's TreatmentInput/UpdateExperimentDefinitionInput carry no client-supplied key at all (only Description/FlagValue/Weight), so AWS itself must assign it. This backend assigns "Control" to the control treatment and "Treatment1".."TreatmentN" (1-indexed, in the order supplied) to the rest -- see CreateExperimentDefinition's doc comment in experiment_definitions.go for why this specific, deterministic scheme was chosen over a random one.

type TreatmentOverrides added in v1.2.0

type TreatmentOverrides struct {
	Inline map[string]string `json:"Inline,omitempty"`
}

TreatmentOverrides assigns specific entity IDs directly to treatment keys, bypassing random assignment. Real AWS models this as a tagged union (types.TreatmentOverrides) with exactly one known member, "Inline" (a map of entity ID -> treatment key, see awsRestjson1_serializeDocumentTreatmentOverrides in the SDK); this backend models the union directly as that one member since it is the only variant the SDK ships.

type Validator

type Validator struct {
	Type    string `json:"Type"`    // JSON_SCHEMA or LAMBDA
	Content string `json:"Content"` // JSON schema doc or Lambda ARN
}

Validator represents a validator for a configuration profile.

Jump to

Keyboard shortcuts

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