Documentation
¶
Overview ¶
Package appconfig provides an in-memory stub for the AWS AppConfig service, which manages feature flags and application configuration.
Index ¶
- Variables
- type AccountSettings
- type Application
- type ConfigurationProfile
- type DeletionProtectionSettings
- type Deployment
- type DeploymentStrategy
- type Environment
- type Extension
- type ExtensionAction
- type ExtensionAssociation
- type ExtensionParameter
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type HostedConfigurationVersion
- type InMemoryBackend
- func (b *InMemoryBackend) CreateApplication(name, description string) (*Application, error)
- func (b *InMemoryBackend) CreateConfigurationProfile(...) (*ConfigurationProfile, error)
- func (b *InMemoryBackend) CreateDeploymentStrategy(name, description string, deploymentDuration, bakeTime int32, ...) (*DeploymentStrategy, error)
- func (b *InMemoryBackend) CreateEnvironment(applicationID, name, description string, monitors []Monitor) (*Environment, error)
- func (b *InMemoryBackend) CreateExtension(name, description string, actions map[string][]ExtensionAction, ...) (*Extension, error)
- func (b *InMemoryBackend) CreateExtensionAssociation(extensionIdentifier, resourceIdentifier string, parameters map[string]string, ...) (*ExtensionAssociation, error)
- func (b *InMemoryBackend) CreateHostedConfigurationVersion(applicationID, profileID, contentType, description, versionLabel string, ...) (*HostedConfigurationVersion, error)
- func (b *InMemoryBackend) DeleteApplication(applicationID string) error
- func (b *InMemoryBackend) DeleteConfigurationProfile(applicationID, profileID string) error
- func (b *InMemoryBackend) DeleteDeploymentStrategy(strategyID string) error
- func (b *InMemoryBackend) DeleteEnvironment(applicationID, environmentID string) error
- func (b *InMemoryBackend) DeleteExtension(extensionIdentifier string) error
- func (b *InMemoryBackend) DeleteExtensionAssociation(extensionAssociationID string) error
- func (b *InMemoryBackend) DeleteHostedConfigurationVersion(applicationID, profileID string, versionNumber int32) error
- func (b *InMemoryBackend) GetAccountSettings() (*AccountSettings, error)
- func (b *InMemoryBackend) GetApplication(applicationID string) (*Application, error)
- func (b *InMemoryBackend) GetConfiguration(application, environment, configuration string) (*HostedConfigurationVersion, error)
- func (b *InMemoryBackend) GetConfigurationProfile(applicationID, profileID string) (*ConfigurationProfile, error)
- func (b *InMemoryBackend) GetDeployment(applicationID, environmentID string, deploymentNumber int32) (*Deployment, error)
- func (b *InMemoryBackend) GetDeploymentStrategy(strategyID string) (*DeploymentStrategy, error)
- func (b *InMemoryBackend) GetEnvironment(applicationID, environmentID string) (*Environment, error)
- func (b *InMemoryBackend) GetExtension(extensionIdentifier string) (*Extension, error)
- func (b *InMemoryBackend) GetExtensionAssociation(extensionAssociationID string) (*ExtensionAssociation, error)
- func (b *InMemoryBackend) GetHostedConfigurationVersion(applicationID, profileID string, versionNumber int32) (*HostedConfigurationVersion, error)
- func (b *InMemoryBackend) ListApplications(nextToken string, maxResults int) ([]Application, string)
- func (b *InMemoryBackend) ListConfigurationProfiles(applicationID, nextToken string, maxResults int) ([]ConfigurationProfile, string, error)
- func (b *InMemoryBackend) ListDeploymentStrategies(nextToken string, maxResults int) ([]DeploymentStrategy, string)
- func (b *InMemoryBackend) ListDeployments(applicationID, environmentID, nextToken string, maxResults int) ([]Deployment, string, error)
- func (b *InMemoryBackend) ListEnvironments(applicationID, nextToken string, maxResults int) ([]Environment, string, error)
- func (b *InMemoryBackend) ListExtensionAssociations(nextToken, extensionIdentifier, resourceIdentifier string, maxResults int) ([]ExtensionAssociation, string)
- func (b *InMemoryBackend) ListExtensions(nextToken string, maxResults int, nameFilter string, versionNumber int32) ([]Extension, string)
- func (b *InMemoryBackend) ListHostedConfigurationVersions(applicationID, profileID, nextToken, versionLabel string, maxResults int) ([]HostedConfigurationVersion, string, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceArn string) (map[string]string, error)
- func (b *InMemoryBackend) PaginationSecret() string
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartDeployment(...) (*Deployment, error)
- func (b *InMemoryBackend) StopDeployment(applicationID, environmentID string, deploymentNumber int32) error
- func (b *InMemoryBackend) TagResource(resourceArn string, tags map[string]string) error
- func (b *InMemoryBackend) UntagResource(resourceArn string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateAccountSettings(deletionProtection *DeletionProtectionSettings) (*AccountSettings, error)
- func (b *InMemoryBackend) UpdateApplication(applicationID string, name, description *string) (*Application, error)
- func (b *InMemoryBackend) UpdateConfigurationProfile(applicationID, profileID string, name, description, retrievalRoleArn *string, ...) (*ConfigurationProfile, error)
- func (b *InMemoryBackend) UpdateDeploymentStrategy(strategyID, name string, description *string, ...) (*DeploymentStrategy, error)
- func (b *InMemoryBackend) UpdateEnvironment(applicationID, environmentID string, name, description *string, ...) (*Environment, error)
- func (b *InMemoryBackend) UpdateExtension(extensionIdentifier string, description *string, ...) (*Extension, error)
- func (b *InMemoryBackend) UpdateExtensionAssociation(extensionAssociationID string, parameters map[string]string) (*ExtensionAssociation, error)
- func (b *InMemoryBackend) ValidateConfiguration(applicationID, profileID, _ string) error
- type Monitor
- type Provider
- type StorageBackend
- type Validator
Constants ¶
This section is empty.
Variables ¶
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) )
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 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"`
PercentageComplete float32 `json:"PercentageComplete,omitempty"`
DeploymentNumber int32 `json:"DeploymentNumber"`
}
Deployment represents an AppConfig deployment.
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 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 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 ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name based on the parsed path and HTTP method.
func (*Handler) ExtractResource ¶
ExtractResource extracts the primary resource ID from the URL path.
func (*Handler) GetSupportedOperations ¶
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 ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function matching AppConfig REST API requests.
func (*Handler) Snapshot ¶
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) (*Application, error)
CreateApplication creates a new AppConfig application.
func (*InMemoryBackend) CreateConfigurationProfile ¶
func (b *InMemoryBackend) CreateConfigurationProfile( applicationID, name, description, locationURI, profileType, retrievalRoleArn string, validators []Validator, ) (*ConfigurationProfile, error)
CreateConfigurationProfile creates a new configuration profile.
func (*InMemoryBackend) CreateDeploymentStrategy ¶
func (b *InMemoryBackend) CreateDeploymentStrategy( name, description string, deploymentDuration, bakeTime int32, growthFactor float32, growthType, replicateTo string, ) (*DeploymentStrategy, error)
CreateDeploymentStrategy creates a new deployment strategy.
func (*InMemoryBackend) CreateEnvironment ¶
func (b *InMemoryBackend) CreateEnvironment( applicationID, name, description string, monitors []Monitor, ) (*Environment, error)
CreateEnvironment creates a new environment within an application.
func (*InMemoryBackend) CreateExtension ¶
func (b *InMemoryBackend) CreateExtension( name, description string, actions map[string][]ExtensionAction, parameters map[string]ExtensionParameter, ) (*Extension, error)
CreateExtension creates a new AppConfig extension.
func (*InMemoryBackend) CreateExtensionAssociation ¶
func (b *InMemoryBackend) CreateExtensionAssociation( extensionIdentifier, resourceIdentifier string, parameters map[string]string, extensionVersionNumber *int32, ) (*ExtensionAssociation, error)
CreateExtensionAssociation creates an association between an extension and a resource.
func (*InMemoryBackend) CreateHostedConfigurationVersion ¶
func (b *InMemoryBackend) CreateHostedConfigurationVersion( applicationID, profileID, contentType, description, versionLabel string, content []byte, ) (*HostedConfigurationVersion, error)
CreateHostedConfigurationVersion creates a hosted configuration version.
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) DeleteExtension ¶
func (b *InMemoryBackend) DeleteExtension(extensionIdentifier string) error
DeleteExtension deletes an extension by identifier (ID or name).
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) GetExtension ¶
func (b *InMemoryBackend) GetExtension(extensionIdentifier string) (*Extension, error)
GetExtension retrieves an extension by identifier (ID or name).
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) 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, versionNumber int32, ) ([]Extension, string)
ListExtensions returns paginated extensions, optionally filtered by name and/or version number.
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) StopDeployment ¶
func (b *InMemoryBackend) StopDeployment( applicationID, environmentID string, deploymentNumber int32, ) error
StopDeployment stops an in-progress deployment.
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) 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. 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 ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initialises the AppConfig backend and handler.
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.
CreateApplication(name, description 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.
CreateEnvironment(
applicationID, name, description string,
monitors []Monitor,
) (*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.
CreateConfigurationProfile(
applicationID, name, description, locationURI, profileType, retrievalRoleArn string,
validators []Validator,
) (*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.
CreateHostedConfigurationVersion(
applicationID, profileID, contentType, description, versionLabel string,
content []byte,
) (*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.
CreateDeploymentStrategy(
name, description string,
deploymentDuration, bakeTime int32,
growthFactor float32,
growthType, replicateTo 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.
StopDeployment(applicationID, environmentID string, deploymentNumber int32) 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.
CreateExtension(
name, description string,
actions map[string][]ExtensionAction,
parameters map[string]ExtensionParameter,
) (*Extension, error)
// GetExtension retrieves an extension by identifier (ID or name).
GetExtension(extensionIdentifier string) (*Extension, error)
// ListExtensions returns paginated extensions, optionally filtered by name and/or version.
ListExtensions(
nextToken string,
maxResults int,
nameFilter string,
versionNumber int32,
) ([]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 by identifier (ID or name).
DeleteExtension(extensionIdentifier string) error
// CreateExtensionAssociation creates an association between an extension and a resource.
CreateExtensionAssociation(
extensionIdentifier, resourceIdentifier string,
parameters map[string]string,
extensionVersionNumber *int32,
) (*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
}
StorageBackend defines the operations supported by the AppConfig in-memory backend.
Source Files
¶
- account_settings.go
- applications.go
- configuration.go
- configuration_profiles.go
- deployment_strategies.go
- deployments.go
- environments.go
- errors.go
- extensions.go
- handler.go
- handler_account_settings.go
- handler_applications.go
- handler_configuration.go
- handler_configuration_profiles.go
- handler_deployment_strategies.go
- handler_deployments.go
- handler_environments.go
- handler_extensions.go
- handler_hosted_configuration_versions.go
- handler_tags.go
- hosted_configuration_versions.go
- interfaces.go
- models.go
- persistence.go
- provider.go
- store.go
- store_setup.go
- tags.go