Documentation
¶
Index ¶
- Constants
- Variables
- type BatchUpdateResult
- type CacheEngineVersion
- type CacheEvent
- type CacheNodeMember
- type CacheParameter
- type CacheParameterGroup
- type CacheSecurityGroup
- type CacheSnapshot
- type CacheSubnetGroup
- type CacheUsageLimits
- type Cluster
- type DNSRegistrar
- type DataStorageLimit
- type EC2SecurityGroupMembership
- type ECPUPerSecondLimit
- type EngineConfig
- type GlobalReplicationGroup
- 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) Reset()
- 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 InMemoryBackend
- func (b *InMemoryBackend) AddCacheSecurityGroupInternal(sg *CacheSecurityGroup)
- func (b *InMemoryBackend) AddGlobalReplicationGroupInternal(grg *GlobalReplicationGroup)
- func (b *InMemoryBackend) AddServerlessCacheInternal(sc *ServerlessCache)
- func (b *InMemoryBackend) AddServerlessCacheSnapshotInternal(snap *ServerlessCacheSnapshot)
- func (b *InMemoryBackend) AddTagsToResource(_ context.Context, resourceARN string, newTags map[string]string) error
- func (b *InMemoryBackend) AddUserGroupInternal(ug *UserGroup)
- func (b *InMemoryBackend) AddUserInternal(u *User)
- func (b *InMemoryBackend) AppendUpdateActions(actions []*UpdateAction)
- func (b *InMemoryBackend) AuthorizeCacheSecurityGroupIngress(ctx context.Context, ...) (*CacheSecurityGroup, error)
- func (b *InMemoryBackend) BatchApplyUpdateAction(_ context.Context, replicationGroupIDs, cacheClusterIDs []string, ...) (*BatchUpdateResult, error)
- func (b *InMemoryBackend) BatchStopUpdateAction(_ context.Context, replicationGroupIDs, cacheClusterIDs []string, ...) (*BatchUpdateResult, error)
- func (b *InMemoryBackend) CompleteMigration(ctx context.Context, replicationGroupID string, _ bool) (*ReplicationGroup, error)
- func (b *InMemoryBackend) CopyServerlessCacheSnapshot(ctx context.Context, sourceSnapshotName, targetSnapshotName string) (*ServerlessCacheSnapshot, error)
- func (b *InMemoryBackend) CopySnapshot(ctx context.Context, sourceSnapshotName, targetSnapshotName string) (*CacheSnapshot, error)
- func (b *InMemoryBackend) CopySnapshotFull(ctx context.Context, sourceSnapshotName, targetSnapshotName, kmsKeyID string) (*CacheSnapshot, error)
- func (b *InMemoryBackend) CreateCacheSecurityGroup(ctx context.Context, name, description string) (*CacheSecurityGroup, error)
- func (b *InMemoryBackend) CreateCluster(ctx context.Context, id, engine, nodeType string, port int) (*Cluster, error)
- func (b *InMemoryBackend) CreateClusterWithOptions(ctx context.Context, ...) (*Cluster, error)
- func (b *InMemoryBackend) CreateGlobalReplicationGroup(ctx context.Context, ...) (*GlobalReplicationGroup, error)
- func (b *InMemoryBackend) CreateParameterGroup(ctx context.Context, name, family, description string) (*CacheParameterGroup, error)
- func (b *InMemoryBackend) CreateReplicationGroup(ctx context.Context, id, description string) (*ReplicationGroup, error)
- func (b *InMemoryBackend) CreateReplicationGroupFull(ctx context.Context, opts ReplicationGroupCreateOpts) (*ReplicationGroup, error)
- func (b *InMemoryBackend) CreateReplicationGroupWithOptions(ctx context.Context, ...) (*ReplicationGroup, error)
- func (b *InMemoryBackend) CreateServerlessCache(ctx context.Context, name, description, engine string) (*ServerlessCache, error)
- func (b *InMemoryBackend) CreateServerlessCacheFull(ctx context.Context, opts ServerlessCreateOpts) (*ServerlessCache, error)
- func (b *InMemoryBackend) CreateServerlessCacheSnapshot(ctx context.Context, snapshotName, serverlessCacheName, kmsKeyID string) (*ServerlessCacheSnapshot, error)
- func (b *InMemoryBackend) CreateSnapshot(ctx context.Context, snapshotName, clusterID, replicationGroupID string) (*CacheSnapshot, error)
- func (b *InMemoryBackend) CreateSubnetGroup(ctx context.Context, name, description string, subnetIDs []string) (*CacheSubnetGroup, error)
- func (b *InMemoryBackend) CreateSubnetGroupFull(ctx context.Context, name, description, vpcID string, subnetIDs []string) (*CacheSubnetGroup, error)
- func (b *InMemoryBackend) CreateUser(ctx context.Context, userID, userName, accessString, engine string, ...) (*User, error)
- func (b *InMemoryBackend) CreateUserGroup(ctx context.Context, groupID, engine string, userIDs []string) (*UserGroup, error)
- func (b *InMemoryBackend) CreateUserGroupValidated(ctx context.Context, groupID, engine string, userIDs []string) (*UserGroup, error)
- func (b *InMemoryBackend) CreateUserWithAuth(ctx context.Context, userID, userName, accessString, engine, authType string, ...) (*User, error)
- func (b *InMemoryBackend) DecreaseNodeGroupsInGlobalReplicationGroup(_ context.Context, id string, nodeGroupCount int32) (*GlobalReplicationGroup, error)
- func (b *InMemoryBackend) DecreaseReplicaCount(ctx context.Context, replicationGroupID string, newReplicaCount int32) (*ReplicationGroup, error)
- func (b *InMemoryBackend) DeleteCacheSecurityGroup(ctx context.Context, name string) error
- func (b *InMemoryBackend) DeleteCluster(ctx context.Context, id string) error
- func (b *InMemoryBackend) DeleteGlobalReplicationGroup(_ context.Context, id string, _ bool) (*GlobalReplicationGroup, error)
- func (b *InMemoryBackend) DeleteParameterGroup(ctx context.Context, name string) error
- func (b *InMemoryBackend) DeleteReplicationGroup(ctx context.Context, id string) error
- func (b *InMemoryBackend) DeleteServerlessCache(ctx context.Context, name string) (*ServerlessCache, error)
- func (b *InMemoryBackend) DeleteServerlessCacheSnapshot(ctx context.Context, name string) (*ServerlessCacheSnapshot, error)
- func (b *InMemoryBackend) DeleteSnapshot(ctx context.Context, snapshotName string) (*CacheSnapshot, error)
- func (b *InMemoryBackend) DeleteSubnetGroup(ctx context.Context, name string) error
- func (b *InMemoryBackend) DeleteUser(ctx context.Context, userID string) (*User, error)
- func (b *InMemoryBackend) DeleteUserGroup(ctx context.Context, groupID string) (*UserGroup, error)
- func (b *InMemoryBackend) DeleteUserSafe(ctx context.Context, userID string) (*User, error)
- func (b *InMemoryBackend) DescribeCacheEngineVersions(_ context.Context, engine, family, engineVersion, marker string, ...) (page.Page[CacheEngineVersion], error)
- func (b *InMemoryBackend) DescribeCacheSecurityGroups(ctx context.Context, name, marker string, maxRecords int) (page.Page[CacheSecurityGroup], error)
- func (b *InMemoryBackend) DescribeClusters(ctx context.Context, id, marker string, maxRecords int, notInRG bool) (page.Page[Cluster], error)
- func (b *InMemoryBackend) DescribeEngineDefaultParameters(_ context.Context, cacheParameterGroupFamily string, marker string, ...) (page.Page[CacheParameter], error)
- func (b *InMemoryBackend) DescribeEvents(_ context.Context, sourceIdentifier, sourceType, marker string, ...) (page.Page[CacheEvent], error)
- func (b *InMemoryBackend) DescribeGlobalReplicationGroups(_ context.Context, id, marker string, maxRecords int) (page.Page[GlobalReplicationGroup], error)
- func (b *InMemoryBackend) DescribeParameterGroups(ctx context.Context, name, marker string, maxRecords int) (page.Page[CacheParameterGroup], error)
- func (b *InMemoryBackend) DescribeParameters(ctx context.Context, name, marker string, maxRecords int) (page.Page[CacheParameter], error)
- func (b *InMemoryBackend) DescribeReplicationGroups(ctx context.Context, id, marker string, maxRecords int) (page.Page[ReplicationGroup], error)
- func (b *InMemoryBackend) DescribeReservedCacheNodes(ctx context.Context, id, cacheNodeType, offeringType, marker string, ...) (page.Page[ReservedCacheNode], error)
- func (b *InMemoryBackend) DescribeReservedCacheNodesOfferings(_ context.Context, offeringID, cacheNodeType, offeringType, marker string, ...) (page.Page[ReservedCacheNodesOffering], error)
- func (b *InMemoryBackend) DescribeServerlessCacheSnapshots(ctx context.Context, serverlessCacheName, snapshotName, marker string, ...) (page.Page[ServerlessCacheSnapshot], error)
- func (b *InMemoryBackend) DescribeServerlessCaches(ctx context.Context, name, marker string, maxRecords int) (page.Page[ServerlessCache], error)
- func (b *InMemoryBackend) DescribeServiceUpdates(_ context.Context, serviceUpdateName string, marker string, maxRecords int, ...) (page.Page[ServiceUpdate], error)
- func (b *InMemoryBackend) DescribeServiceUpdatesFull(serviceUpdateName string, status []string, marker string, maxRecords int) ([]ServiceUpdate, string, error)
- func (b *InMemoryBackend) DescribeSnapshots(ctx context.Context, ...) (page.Page[CacheSnapshot], error)
- func (b *InMemoryBackend) DescribeSubnetGroups(ctx context.Context, name, marker string, maxRecords int) (page.Page[CacheSubnetGroup], error)
- func (b *InMemoryBackend) DescribeUpdateActions(_ context.Context, serviceUpdateName string, marker string, maxRecords int) (page.Page[UpdateAction], error)
- func (b *InMemoryBackend) DescribeUpdateActionsFull(serviceUpdateName, marker string, maxRecords int) ([]UpdateAction, string, error)
- func (b *InMemoryBackend) DescribeUserGroups(ctx context.Context, groupID, marker string, maxRecords int) (page.Page[UserGroup], error)
- func (b *InMemoryBackend) DescribeUsers(ctx context.Context, userID, marker string, maxRecords int) (page.Page[User], error)
- func (b *InMemoryBackend) DisassociateGlobalReplicationGroup(_ context.Context, id, _, _ string) (*GlobalReplicationGroup, error)
- func (b *InMemoryBackend) ExportServerlessCacheSnapshot(ctx context.Context, snapshotName, _ string) (*ServerlessCacheSnapshot, error)
- func (b *InMemoryBackend) FailoverGlobalReplicationGroup(_ context.Context, id, _, _ string) (*GlobalReplicationGroup, error)
- func (b *InMemoryBackend) FailoverReplicationGroup(ctx context.Context, id, _ string) (*ReplicationGroup, error)
- func (b *InMemoryBackend) IncreaseNodeGroupsInGlobalReplicationGroup(_ context.Context, id string, nodeGroupCount int32) (*GlobalReplicationGroup, error)
- func (b *InMemoryBackend) IncreaseReplicaCount(ctx context.Context, replicationGroupID string, newReplicaCount int32) (*ReplicationGroup, error)
- func (b *InMemoryBackend) ListAll() []Cluster
- func (b *InMemoryBackend) ListAllowedNodeTypeModifications(_ context.Context, _, _ string) ([]string, error)
- func (b *InMemoryBackend) ListTagsForResource(_ context.Context, arn string) (map[string]string, error)
- func (b *InMemoryBackend) ListUpdateActionsByServiceUpdate(serviceUpdateName string) []*UpdateAction
- func (b *InMemoryBackend) ModifyCluster(ctx context.Context, ...) (*Cluster, error)
- func (b *InMemoryBackend) ModifyGlobalReplicationGroup(_ context.Context, id, description, engineVersion string, ...) (*GlobalReplicationGroup, error)
- func (b *InMemoryBackend) ModifyParameterGroup(ctx context.Context, name string, params map[string]string) (*CacheParameterGroup, error)
- func (b *InMemoryBackend) ModifyReplicationGroup(ctx context.Context, ...) (*ReplicationGroup, error)
- func (b *InMemoryBackend) ModifyReplicationGroupFull(ctx context.Context, id string, opts ReplicationGroupModifyOpts) (*ReplicationGroup, error)
- func (b *InMemoryBackend) ModifyReplicationGroupShardConfiguration(ctx context.Context, replicationGroupID string, nodeGroupCount int32) (*ReplicationGroup, error)
- func (b *InMemoryBackend) ModifyServerlessCache(ctx context.Context, name, description string) (*ServerlessCache, error)
- func (b *InMemoryBackend) ModifyServerlessCacheFull(ctx context.Context, name string, opts ServerlessModifyOpts) (*ServerlessCache, error)
- func (b *InMemoryBackend) ModifySubnetGroup(ctx context.Context, name, description string, subnetIDs []string) (*CacheSubnetGroup, error)
- func (b *InMemoryBackend) ModifyUser(ctx context.Context, userID, accessString string, noPasswordRequired bool) (*User, error)
- func (b *InMemoryBackend) ModifyUserGroup(ctx context.Context, groupID string, userIDsToAdd, userIDsToRemove []string) (*UserGroup, error)
- func (b *InMemoryBackend) ModifyUserWithAuth(ctx context.Context, ...) (*User, error)
- func (b *InMemoryBackend) PurchaseReservedCacheNodesOffering(ctx context.Context, offeringID, reservedCacheNodeID string, ...) (*ReservedCacheNode, error)
- func (b *InMemoryBackend) RebalanceSlotsInGlobalReplicationGroup(_ context.Context, id string) (*GlobalReplicationGroup, error)
- func (b *InMemoryBackend) RebootCacheCluster(ctx context.Context, clusterID string, nodeIDs []string) (*Cluster, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) RemoveTagsFromResource(_ context.Context, resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) ResetParameterGroup(ctx context.Context, name string, paramNames []string, resetAll bool) (*CacheParameterGroup, error)
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RevokeCacheSecurityGroupIngress(ctx context.Context, ...) (*CacheSecurityGroup, error)
- func (b *InMemoryBackend) SetClock(clock func() time.Time)
- func (b *InMemoryBackend) SetDNSRegistrar(r DNSRegistrar)
- func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartMigration(ctx context.Context, replicationGroupID string) (*ReplicationGroup, error)
- func (b *InMemoryBackend) TaggedResources() []TaggedEntry
- func (b *InMemoryBackend) TestMigration(ctx context.Context, replicationGroupID string) (*ReplicationGroup, error)
- func (b *InMemoryBackend) TriggerAutoSnapshot(ctx context.Context, replicationGroupID string) (*CacheSnapshot, error)
- type LogDeliveryConfig
- type NodeGroup
- type NodeGroupNode
- type Provider
- type RGPendingModifiedValues
- type ReplicationGroup
- type ReplicationGroupCreateOpts
- type ReplicationGroupModifyOpts
- type ReservedCacheNode
- type ReservedCacheNodesOffering
- type ServerlessCache
- type ServerlessCacheConfigSnapshot
- type ServerlessCacheEndpoint
- type ServerlessCacheSnapshot
- type ServerlessCreateOpts
- type ServerlessModifyOpts
- type ServiceUpdate
- type StorageBackend
- type TaggedEntry
- type UpdateAction
- type UpdateActionResult
- type User
- type UserGroup
Constants ¶
const ( EngineEmbedded = "embedded" EngineDocker = "docker" EngineStub = "stub" )
Engine mode constants.
Variables ¶
var ( ErrClusterNotFound = errors.New("CacheClusterNotFound") ErrClusterAlreadyExists = errors.New("CacheClusterAlreadyExists") ErrReplicationGroupNotFound = errors.New("ReplicationGroupNotFound") ErrReplicationGroupAlreadyExists = errors.New("ReplicationGroupAlreadyExists") ErrResourceNotFound = errors.New("resource not found") ErrParameterGroupNotFound = errors.New("CacheParameterGroupNotFound") ErrParameterGroupAlreadyExists = errors.New("CacheParameterGroupAlreadyExists") ErrParameterGroupDefaultNotModifiable = errors.New("default parameter group cannot be deleted or modified") ErrInvalidParameterGroupFamily = errors.New("InvalidParameterGroupFamily") ErrSubnetGroupNotFound = errors.New("CacheSubnetGroupNotFound") ErrSubnetGroupAlreadyExists = errors.New("CacheSubnetGroupAlreadyExists") ErrSnapshotNotFound = errors.New("SnapshotNotFound") ErrSnapshotAlreadyExists = errors.New("SnapshotAlreadyExistsFault") ErrInvalidSnapshotSource = errors.New( "exactly one of CacheClusterId or ReplicationGroupId must be specified", ) )
var ( ErrClusterModeRequired = errors.New("cluster mode must be enabled for shard configuration changes") ErrDataTieringInvalid = errors.New("data tiering requires r7g node type and Redis/Valkey 7.0+") ErrTransitEncryptionModeInvalid = errors.New("transit encryption mode 'required' requires an auth token") ErrAuthTokenRequiredForMode = errors.New( "auth token must be provided when transit encryption mode is 'required'", ) )
var ( ErrClusterNotAvailable = errors.New("cache cluster is not in the available state") ErrReplicationGroupNotAvailable = errors.New("replication group is not in the available state") ErrServerlessCacheNotAvailable = errors.New("serverless cache is not in the available state") ErrGlobalReplicationGroupNotAvailable = errors.New("global replication group is not in the available state") )
State-transition guard sentinels: a resource must be "available" before it can accept a new Modify/Delete/failover-style mutation. AWS models these as Invalid<Resource>State(Fault) on every mutating op (verified against aws-sdk-go-v2's per-operation error deserializers), returned e.g. while a resource is still "creating", "modifying", or "deleting" from a prior call.
var ( ErrUserGroupNotFound = errors.New("UserGroupNotFound") ErrUserGroupAlreadyExists = errors.New("UserGroupAlreadyExistsFault") ErrReservedCacheNodeNotFound = errors.New("ReservedCacheNodeNotFound") ErrReservedCacheNodeAlreadyExists = errors.New("ReservedCacheNodeAlreadyExists") ErrReservedCacheNodesOfferingNotFound = errors.New("ReservedCacheNodesOfferingNotFound") )
var ( ErrUserNotInGroup = errors.New("user is a member of a user group and cannot be deleted") ErrUserNotFound2 = ErrUserNotFound ErrGroupUserNotFound = errors.New("one or more specified user IDs do not exist") )
var ( ErrCacheSecurityGroupNotFound = errors.New("CacheSecurityGroupNotFound") ErrCacheSecurityGroupAlreadyExists = errors.New("CacheSecurityGroupAlreadyExists") ErrGlobalReplicationGroupNotFound = errors.New("GlobalReplicationGroupNotFound") ErrGlobalReplicationGroupExists = errors.New("GlobalReplicationGroupAlreadyExistsFault") ErrServerlessCacheNotFound = errors.New("ServerlessCacheNotFound") ErrServerlessCacheAlreadyExists = errors.New("ServerlessCacheAlreadyExistsFault") ErrServerlessCacheSnapshotNotFound = errors.New("ServerlessCacheSnapshotNotFoundFault") ErrServerlessCacheSnapshotExists = errors.New("ServerlessCacheSnapshotAlreadyExistsFault") ErrUserNotFound = errors.New("UserNotFound") ErrUserAlreadyExists = errors.New("UserAlreadyExists") )
var ErrNilContext = errors.New("nil context")
Functions ¶
This section is empty.
Types ¶
type BatchUpdateResult ¶
type BatchUpdateResult struct {
ProcessedUpdateActions []UpdateActionResult `json:"processedUpdateActions"`
UnprocessedUpdateActions []UpdateActionResult `json:"unprocessedUpdateActions"`
}
BatchUpdateResult holds the results of a BatchApplyUpdateAction / BatchStopUpdateAction call.
type CacheEngineVersion ¶
type CacheEngineVersion struct {
Engine string
EngineVersion string
CacheParameterGroupFamily string
CacheEngineDescription string
CacheEngineVersionDescription string
}
CacheEngineVersion represents an engine version.
type CacheEvent ¶
type CacheEvent struct {
Date time.Time `json:"date"`
SourceIdentifier string `json:"sourceIdentifier"`
SourceType string `json:"sourceType"`
Message string `json:"message"`
}
CacheEvent represents a recorded ElastiCache operation event.
type CacheNodeMember ¶
type CacheNodeMember struct {
CacheClusterID string `json:"cacheClusterId"`
CacheNodeID string `json:"cacheNodeId"`
CacheNodeStatus string `json:"cacheNodeStatus"`
PreferredAvailabilityZone string `json:"preferredAvailabilityZone"`
CacheNodeCreateTime time.Time `json:"cacheNodeCreateTime"`
Endpoint struct {
Address string `json:"address"`
Port int `json:"port"`
} `json:"endpoint"`
}
CacheNodeMember represents a Memcached cluster node member (gap #3).
type CacheParameter ¶
type CacheParameter struct {
Name string
Value string
Description string
DataType string
AllowedValues string
IsModifiable bool
}
CacheParameter represents a single cache parameter (for DescribeParameters response).
type CacheParameterGroup ¶
type CacheParameterGroup struct {
Tags *tags.Tags `json:"tags,omitempty"`
Parameters map[string]string `json:"parameters"`
Name string `json:"name"`
Family string `json:"family"`
Description string `json:"description"`
ARN string `json:"arn"`
IsGlobal bool `json:"isGlobal"`
}
CacheParameterGroup represents an ElastiCache parameter group.
type CacheSecurityGroup ¶
type CacheSecurityGroup struct {
Tags *tags.Tags `json:"tags,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
ARN string `json:"arn"`
OwnerID string `json:"ownerId"`
}
CacheSecurityGroup represents an ElastiCache cache security group (EC2-Classic).
type CacheSnapshot ¶
type CacheSnapshot struct {
CreatedAt time.Time `json:"createdAt"`
AvailableAt time.Time `json:"availableAt,omitzero"`
Tags *tags.Tags `json:"tags,omitempty"`
SnapshotName string `json:"snapshotName"`
CacheClusterID string `json:"cacheClusterId"`
ReplicationGroupID string `json:"replicationGroupId"`
Status string `json:"status"`
PendingStatus string `json:"pendingStatus,omitempty"`
ARN string `json:"arn"`
Engine string `json:"engine"`
EngineVersion string `json:"engineVersion"`
NodeType string `json:"nodeType"`
KmsKeyID string `json:"kmsKeyId,omitempty"`
SnapshotSource string `json:"snapshotSource"` // "manual" or "automated"
}
CacheSnapshot represents an ElastiCache snapshot.
type CacheSubnetGroup ¶
type CacheSubnetGroup struct {
Tags *tags.Tags `json:"tags,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
VpcID string `json:"vpcId"`
ARN string `json:"arn"`
SubnetIDs []string `json:"subnetIds"`
}
CacheSubnetGroup represents an ElastiCache subnet group.
type CacheUsageLimits ¶ added in v1.2.0
type CacheUsageLimits struct {
DataStorage *DataStorageLimit `json:"dataStorage,omitempty"`
ECPUPerSecond *ECPUPerSecondLimit `json:"ecpuPerSecond,omitempty"`
}
CacheUsageLimits models a serverless cache's data/ECPU usage limits (aws-sdk-go-v2/service/elasticache/types.CacheUsageLimits).
type Cluster ¶
type Cluster struct {
CreatedAt time.Time
Tags *tags.Tags
ClusterID string
Engine string
EngineVersion string
Status string
Endpoint string
NodeType string
ARN string
Region string
CacheParameterGroupName string
PreferredMaintenanceWindow string
SnapshotWindow string
ReplicationGroupID string
KmsKeyID string
TransitEncryptionMode string
ConnectAddress string
PendingStatus string
AvailableAt time.Time
Members []CacheNodeMember
Port int
AllocatedPort int
NumCacheNodes int
TransitEncryptionEnabled bool
AtRestEncryptionEnabled bool
// contains filtered or unexported fields
}
Cluster represents an ElastiCache cluster.
type DNSRegistrar ¶
DNSRegistrar can register and deregister hostnames with an embedded DNS server.
type DataStorageLimit ¶ added in v1.2.0
type DataStorageLimit struct {
Unit string `json:"unit,omitempty"`
Maximum int32 `json:"maximum,omitempty"`
Minimum int32 `json:"minimum,omitempty"`
}
DataStorageLimit models the data-storage half of a serverless cache's usage limits (aws-sdk-go-v2/service/elasticache/types.DataStorage). Unit is always "GB" on real AWS (the only value DataStorageUnit currently has).
type EC2SecurityGroupMembership ¶
type EC2SecurityGroupMembership struct {
EC2SecurityGroupName string `json:"ec2SecurityGroupName"`
EC2SecurityGroupOwnerID string `json:"ec2SecurityGroupOwnerId"`
Status string `json:"status"`
}
EC2SecurityGroupMembership is a single EC2 security group authorization on a cache security group.
type ECPUPerSecondLimit ¶ added in v1.2.0
type ECPUPerSecondLimit struct {
Maximum int32 `json:"maximum,omitempty"`
Minimum int32 `json:"minimum,omitempty"`
}
ECPUPerSecondLimit models the ElastiCache-Processing-Unit half of a serverless cache's usage limits (aws-sdk-go-v2/service/elasticache/types. ECPUPerSecond).
type EngineConfig ¶
type EngineConfig interface {
GetElastiCacheEngine() string
}
EngineConfig is the interface for accessing the ElastiCache engine mode configuration (embedded, stub, or docker).
type GlobalReplicationGroup ¶
type GlobalReplicationGroup struct {
CreatedAt time.Time `json:"createdAt"`
AvailableAt time.Time `json:"availableAt,omitzero"`
Tags *tags.Tags `json:"tags,omitempty"`
SecondaryReplicationGroups map[string]string `json:"secondaryReplicationGroups,omitempty"`
GlobalReplicationGroupID string `json:"globalReplicationGroupId"`
Description string `json:"description"`
Status string `json:"status"`
PendingStatus string `json:"pendingStatus,omitempty"`
ARN string `json:"arn"`
Engine string `json:"engine"`
EngineVersion string `json:"engineVersion"`
PrimaryReplicationGroupRegion string `json:"primaryReplicationGroupRegion,omitempty"`
NodeGroupCount int32 `json:"nodeGroupCount,omitempty"`
}
GlobalReplicationGroup represents an ElastiCache global replication group.
type Handler ¶
type Handler struct {
Backend StorageBackend
AccountID string
Region string
}
Handler is the Echo HTTP handler for ElastiCache operations.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new ElastiCache handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this ElastiCache instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the Action from the form body.
func (*Handler) ExtractResource ¶
ExtractResource extracts the primary resource identifier from the request.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns all supported ElastiCache operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for ElastiCache requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a matcher for ElastiCache query-protocol requests.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is an in-memory ElastiCache backend. All regional resource maps are nested by region (outer key = region) so that same-named resources in different regions are fully isolated. GlobalReplicationGroups are global/partition-scoped (like AWS) and therefore are NOT region-nested.
func NewInMemoryBackend ¶
func NewInMemoryBackend(engineMode, accountID, region string, allocator *portalloc.Allocator) *InMemoryBackend
NewInMemoryBackend creates a new backend with the given engine mode.
func (*InMemoryBackend) AddCacheSecurityGroupInternal ¶
func (b *InMemoryBackend) AddCacheSecurityGroupInternal(sg *CacheSecurityGroup)
AddCacheSecurityGroupInternal seeds a cache security group for testing.
func (*InMemoryBackend) AddGlobalReplicationGroupInternal ¶
func (b *InMemoryBackend) AddGlobalReplicationGroupInternal(grg *GlobalReplicationGroup)
AddGlobalReplicationGroupInternal seeds a global replication group for testing.
func (*InMemoryBackend) AddServerlessCacheInternal ¶
func (b *InMemoryBackend) AddServerlessCacheInternal(sc *ServerlessCache)
AddServerlessCacheInternal seeds a serverless cache for testing.
func (*InMemoryBackend) AddServerlessCacheSnapshotInternal ¶
func (b *InMemoryBackend) AddServerlessCacheSnapshotInternal(snap *ServerlessCacheSnapshot)
AddServerlessCacheSnapshotInternal seeds a serverless cache snapshot for testing.
func (*InMemoryBackend) AddTagsToResource ¶
func (b *InMemoryBackend) AddTagsToResource(_ context.Context, resourceARN string, newTags map[string]string) error
AddTagsToResource adds or updates tags on the resource identified by resourceARN.
func (*InMemoryBackend) AddUserGroupInternal ¶
func (b *InMemoryBackend) AddUserGroupInternal(ug *UserGroup)
AddUserGroupInternal seeds a user group for testing.
func (*InMemoryBackend) AddUserInternal ¶
func (b *InMemoryBackend) AddUserInternal(u *User)
AddUserInternal seeds a user for testing.
func (*InMemoryBackend) AppendUpdateActions ¶
func (b *InMemoryBackend) AppendUpdateActions(actions []*UpdateAction)
AppendUpdateActions appends new update action records.
func (*InMemoryBackend) AuthorizeCacheSecurityGroupIngress ¶
func (b *InMemoryBackend) AuthorizeCacheSecurityGroupIngress( ctx context.Context, name, ec2SecurityGroupName, ec2SecurityGroupOwnerID string, ) (*CacheSecurityGroup, error)
AuthorizeCacheSecurityGroupIngress adds an EC2 security group authorization to the named cache security group.
func (*InMemoryBackend) BatchApplyUpdateAction ¶
func (b *InMemoryBackend) BatchApplyUpdateAction( _ context.Context, replicationGroupIDs, cacheClusterIDs []string, serviceUpdateName string, ) (*BatchUpdateResult, error)
BatchApplyUpdateAction schedules a service update for the given replication groups and clusters.
func (*InMemoryBackend) BatchStopUpdateAction ¶
func (b *InMemoryBackend) BatchStopUpdateAction( _ context.Context, replicationGroupIDs, cacheClusterIDs []string, serviceUpdateName string, ) (*BatchUpdateResult, error)
BatchStopUpdateAction stops a pending service update for the given replication groups and clusters.
func (*InMemoryBackend) CompleteMigration ¶
func (b *InMemoryBackend) CompleteMigration( ctx context.Context, replicationGroupID string, _ bool, ) (*ReplicationGroup, error)
CompleteMigration completes an online data migration from an external Redis server to this replication group.
func (*InMemoryBackend) CopyServerlessCacheSnapshot ¶
func (b *InMemoryBackend) CopyServerlessCacheSnapshot( ctx context.Context, sourceSnapshotName, targetSnapshotName string, ) (*ServerlessCacheSnapshot, error)
CopyServerlessCacheSnapshot copies a serverless cache snapshot to a new name.
func (*InMemoryBackend) CopySnapshot ¶
func (b *InMemoryBackend) CopySnapshot( ctx context.Context, sourceSnapshotName, targetSnapshotName string, ) (*CacheSnapshot, error)
CopySnapshot copies an existing snapshot to a new name.
func (*InMemoryBackend) CopySnapshotFull ¶
func (b *InMemoryBackend) CopySnapshotFull( ctx context.Context, sourceSnapshotName, targetSnapshotName, kmsKeyID string, ) (*CacheSnapshot, error)
CopySnapshotFull copies a snapshot and optionally re-encrypts with a different KMS key.
func (*InMemoryBackend) CreateCacheSecurityGroup ¶
func (b *InMemoryBackend) CreateCacheSecurityGroup( ctx context.Context, name, description string, ) (*CacheSecurityGroup, error)
CreateCacheSecurityGroup creates a new cache security group.
func (*InMemoryBackend) CreateCluster ¶
func (b *InMemoryBackend) CreateCluster(ctx context.Context, id, engine, nodeType string, port int) (*Cluster, error)
CreateCluster creates a new cache cluster.
func (*InMemoryBackend) CreateClusterWithOptions ¶
func (b *InMemoryBackend) CreateClusterWithOptions( ctx context.Context, id, engine, nodeType, paramGroupName, maintenanceWindow, snapshotWindow string, numCacheNodes, port int, ) (*Cluster, error)
CreateClusterWithOptions creates a new cache cluster with optional parameter group and scheduling windows.
func (*InMemoryBackend) CreateGlobalReplicationGroup ¶
func (b *InMemoryBackend) CreateGlobalReplicationGroup( ctx context.Context, globalReplicationGroupIDSuffix, description, primaryReplicationGroupID string, ) (*GlobalReplicationGroup, error)
CreateGlobalReplicationGroup creates a new global replication group.
func (*InMemoryBackend) CreateParameterGroup ¶
func (b *InMemoryBackend) CreateParameterGroup( ctx context.Context, name, family, description string, ) (*CacheParameterGroup, error)
CreateParameterGroup creates a new cache parameter group.
func (*InMemoryBackend) CreateReplicationGroup ¶
func (b *InMemoryBackend) CreateReplicationGroup( ctx context.Context, id, description string, ) (*ReplicationGroup, error)
CreateReplicationGroup creates a replication group.
func (*InMemoryBackend) CreateReplicationGroupFull ¶
func (b *InMemoryBackend) CreateReplicationGroupFull( ctx context.Context, opts ReplicationGroupCreateOpts, ) (*ReplicationGroup, error)
CreateReplicationGroupFull creates a replication group with the full set of options.
func (*InMemoryBackend) CreateReplicationGroupWithOptions ¶
func (b *InMemoryBackend) CreateReplicationGroupWithOptions( ctx context.Context, id, description, paramGroupName, maintenanceWindow, snapshotWindow string, ) (*ReplicationGroup, error)
CreateReplicationGroupWithOptions creates a replication group with optional parameter group and scheduling windows.
func (*InMemoryBackend) CreateServerlessCache ¶
func (b *InMemoryBackend) CreateServerlessCache( ctx context.Context, name, description, engine string, ) (*ServerlessCache, error)
CreateServerlessCache creates a new serverless cache.
func (*InMemoryBackend) CreateServerlessCacheFull ¶
func (b *InMemoryBackend) CreateServerlessCacheFull( ctx context.Context, opts ServerlessCreateOpts, ) (*ServerlessCache, error)
CreateServerlessCacheFull creates a serverless cache with the full set of options.
func (*InMemoryBackend) CreateServerlessCacheSnapshot ¶
func (b *InMemoryBackend) CreateServerlessCacheSnapshot( ctx context.Context, snapshotName, serverlessCacheName, kmsKeyID string, ) (*ServerlessCacheSnapshot, error)
CreateServerlessCacheSnapshot creates a manual snapshot of a serverless cache.
ExpiryTime is deliberately left unset: real AWS only populates it for automatically-created snapshots, never manual ones (see the doc comment on ServerlessCacheSnapshot), and every snapshot this method creates is "manual". ServerlessCacheConfiguration is populated from the source cache's current Engine/MajorEngineVersion/Name -- a genuine, non-fabricated value since the source data already exists on the backend.
func (*InMemoryBackend) CreateSnapshot ¶
func (b *InMemoryBackend) CreateSnapshot( ctx context.Context, snapshotName, clusterID, replicationGroupID string, ) (*CacheSnapshot, error)
CreateSnapshot creates a manual snapshot of a cluster or replication group.
func (*InMemoryBackend) CreateSubnetGroup ¶
func (b *InMemoryBackend) CreateSubnetGroup( ctx context.Context, name, description string, subnetIDs []string, ) (*CacheSubnetGroup, error)
CreateSubnetGroup creates a new cache subnet group.
func (*InMemoryBackend) CreateSubnetGroupFull ¶
func (b *InMemoryBackend) CreateSubnetGroupFull( ctx context.Context, name, description, vpcID string, subnetIDs []string, ) (*CacheSubnetGroup, error)
CreateSubnetGroupFull creates a cache subnet group with an explicit VPC ID.
func (*InMemoryBackend) CreateUser ¶
func (b *InMemoryBackend) CreateUser( ctx context.Context, userID, userName, accessString, engine string, noPasswordRequired bool, ) (*User, error)
CreateUser creates a new ElastiCache user using the legacy NoPasswordRequired boolean (no explicit AuthenticationMode/Passwords). Kept for callers that only need password-vs-no-password, delegating to InMemoryBackend.CreateUserWithAuth for the actual insert.
func (*InMemoryBackend) CreateUserGroup ¶
func (b *InMemoryBackend) CreateUserGroup( ctx context.Context, groupID, engine string, userIDs []string, ) (*UserGroup, error)
CreateUserGroup creates a new user group.
func (*InMemoryBackend) CreateUserGroupValidated ¶
func (b *InMemoryBackend) CreateUserGroupValidated( ctx context.Context, groupID, engine string, userIDs []string, ) (*UserGroup, error)
CreateUserGroupValidated creates a user group, validating that all specified user IDs exist.
func (*InMemoryBackend) CreateUserWithAuth ¶ added in v1.2.0
func (b *InMemoryBackend) CreateUserWithAuth( ctx context.Context, userID, userName, accessString, engine, authType string, passwordCount int, ) (*User, error)
CreateUserWithAuth creates a new ElastiCache user with the full authentication model reported on the wire: authType is one of the output values ("password", "no-password", "iam" -- see authType* constants) and passwordCount is the number of passwords on file (0 for iam/no-password, 1-2 for password auth; validated by the caller before this is invoked).
func (*InMemoryBackend) DecreaseNodeGroupsInGlobalReplicationGroup ¶
func (b *InMemoryBackend) DecreaseNodeGroupsInGlobalReplicationGroup( _ context.Context, id string, nodeGroupCount int32, ) (*GlobalReplicationGroup, error)
DecreaseNodeGroupsInGlobalReplicationGroup decreases the node group count.
func (*InMemoryBackend) DecreaseReplicaCount ¶
func (b *InMemoryBackend) DecreaseReplicaCount( ctx context.Context, replicationGroupID string, newReplicaCount int32, ) (*ReplicationGroup, error)
DecreaseReplicaCount decreases the replica count for a replication group.
func (*InMemoryBackend) DeleteCacheSecurityGroup ¶
func (b *InMemoryBackend) DeleteCacheSecurityGroup(ctx context.Context, name string) error
DeleteCacheSecurityGroup deletes a cache security group.
func (*InMemoryBackend) DeleteCluster ¶
func (b *InMemoryBackend) DeleteCluster(ctx context.Context, id string) error
DeleteCluster stops and removes a cluster.
func (*InMemoryBackend) DeleteGlobalReplicationGroup ¶
func (b *InMemoryBackend) DeleteGlobalReplicationGroup( _ context.Context, id string, _ bool, ) (*GlobalReplicationGroup, error)
DeleteGlobalReplicationGroup deletes a global replication group.
func (*InMemoryBackend) DeleteParameterGroup ¶
func (b *InMemoryBackend) DeleteParameterGroup(ctx context.Context, name string) error
DeleteParameterGroup removes a cache parameter group.
func (*InMemoryBackend) DeleteReplicationGroup ¶
func (b *InMemoryBackend) DeleteReplicationGroup(ctx context.Context, id string) error
DeleteReplicationGroup removes a replication group.
func (*InMemoryBackend) DeleteServerlessCache ¶
func (b *InMemoryBackend) DeleteServerlessCache(ctx context.Context, name string) (*ServerlessCache, error)
DeleteServerlessCache deletes a serverless cache.
func (*InMemoryBackend) DeleteServerlessCacheSnapshot ¶
func (b *InMemoryBackend) DeleteServerlessCacheSnapshot( ctx context.Context, name string, ) (*ServerlessCacheSnapshot, error)
DeleteServerlessCacheSnapshot deletes a serverless cache snapshot.
func (*InMemoryBackend) DeleteSnapshot ¶
func (b *InMemoryBackend) DeleteSnapshot(ctx context.Context, snapshotName string) (*CacheSnapshot, error)
DeleteSnapshot removes a snapshot and returns the deleted snapshot.
func (*InMemoryBackend) DeleteSubnetGroup ¶
func (b *InMemoryBackend) DeleteSubnetGroup(ctx context.Context, name string) error
DeleteSubnetGroup removes a cache subnet group.
func (*InMemoryBackend) DeleteUser ¶
DeleteUser deletes a user by ID.
func (*InMemoryBackend) DeleteUserGroup ¶
DeleteUserGroup deletes a user group by ID.
func (*InMemoryBackend) DeleteUserSafe ¶
DeleteUserSafe deletes a user, but returns an error if the user is still a member of any user group.
func (*InMemoryBackend) DescribeCacheEngineVersions ¶
func (b *InMemoryBackend) DescribeCacheEngineVersions( _ context.Context, engine, family, engineVersion, marker string, maxRecords int, ) (page.Page[CacheEngineVersion], error)
DescribeCacheEngineVersions returns engine versions, optionally filtered.
func (*InMemoryBackend) DescribeCacheSecurityGroups ¶
func (b *InMemoryBackend) DescribeCacheSecurityGroups( ctx context.Context, name, marker string, maxRecords int, ) (page.Page[CacheSecurityGroup], error)
DescribeCacheSecurityGroups returns a paginated list of cache security groups.
func (*InMemoryBackend) DescribeClusters ¶
func (b *InMemoryBackend) DescribeClusters( ctx context.Context, id, marker string, maxRecords int, notInRG bool, ) (page.Page[Cluster], error)
DescribeClusters returns one cluster by id, or a paginated list of all clusters when id is empty. When notInRG is true, only clusters with no ReplicationGroupID are returned (standalone clusters).
func (*InMemoryBackend) DescribeEngineDefaultParameters ¶
func (b *InMemoryBackend) DescribeEngineDefaultParameters( _ context.Context, cacheParameterGroupFamily string, marker string, maxRecords int, ) (page.Page[CacheParameter], error)
DescribeEngineDefaultParameters returns the default parameters for a parameter group family.
func (*InMemoryBackend) DescribeEvents ¶
func (b *InMemoryBackend) DescribeEvents( _ context.Context, sourceIdentifier, sourceType, marker string, startTime, endTime time.Time, duration, maxRecords int, ) (page.Page[CacheEvent], error)
DescribeEvents returns a paginated list of recorded events, optionally filtered by source and time.
func (*InMemoryBackend) DescribeGlobalReplicationGroups ¶
func (b *InMemoryBackend) DescribeGlobalReplicationGroups( _ context.Context, id, marker string, maxRecords int, ) (page.Page[GlobalReplicationGroup], error)
DescribeGlobalReplicationGroups returns a paginated list of global replication groups.
func (*InMemoryBackend) DescribeParameterGroups ¶
func (b *InMemoryBackend) DescribeParameterGroups( ctx context.Context, name, marker string, maxRecords int, ) (page.Page[CacheParameterGroup], error)
DescribeParameterGroups returns one parameter group by name, or a paginated list of all.
func (*InMemoryBackend) DescribeParameters ¶
func (b *InMemoryBackend) DescribeParameters( ctx context.Context, name, marker string, maxRecords int, ) (page.Page[CacheParameter], error)
DescribeParameters lists parameters in a cache parameter group.
func (*InMemoryBackend) DescribeReplicationGroups ¶
func (b *InMemoryBackend) DescribeReplicationGroups( ctx context.Context, id, marker string, maxRecords int, ) (page.Page[ReplicationGroup], error)
DescribeReplicationGroups returns one replication group by id, or a paginated list of all when id is empty.
func (*InMemoryBackend) DescribeReservedCacheNodes ¶
func (b *InMemoryBackend) DescribeReservedCacheNodes( ctx context.Context, id, cacheNodeType, offeringType, marker string, maxRecords int, ) (page.Page[ReservedCacheNode], error)
DescribeReservedCacheNodes returns a paginated list of reserved cache nodes.
func (*InMemoryBackend) DescribeReservedCacheNodesOfferings ¶
func (b *InMemoryBackend) DescribeReservedCacheNodesOfferings( _ context.Context, offeringID, cacheNodeType, offeringType, marker string, maxRecords int, ) (page.Page[ReservedCacheNodesOffering], error)
DescribeReservedCacheNodesOfferings returns a paginated list of reserved cache node offerings.
func (*InMemoryBackend) DescribeServerlessCacheSnapshots ¶
func (b *InMemoryBackend) DescribeServerlessCacheSnapshots( ctx context.Context, serverlessCacheName, snapshotName, marker string, maxRecords int, ) (page.Page[ServerlessCacheSnapshot], error)
DescribeServerlessCacheSnapshots returns a paginated list of serverless cache snapshots.
func (*InMemoryBackend) DescribeServerlessCaches ¶
func (b *InMemoryBackend) DescribeServerlessCaches( ctx context.Context, name, marker string, maxRecords int, ) (page.Page[ServerlessCache], error)
DescribeServerlessCaches returns a paginated list of serverless caches.
func (*InMemoryBackend) DescribeServiceUpdates ¶
func (b *InMemoryBackend) DescribeServiceUpdates( _ context.Context, serviceUpdateName string, marker string, maxRecords int, status []string, ) (page.Page[ServiceUpdate], error)
DescribeServiceUpdates returns service updates, filtered by name and status.
func (*InMemoryBackend) DescribeServiceUpdatesFull ¶
func (b *InMemoryBackend) DescribeServiceUpdatesFull( serviceUpdateName string, status []string, marker string, maxRecords int, ) ([]ServiceUpdate, string, error)
DescribeServiceUpdatesFull returns service updates, filtered by name and/or status list.
func (*InMemoryBackend) DescribeSnapshots ¶
func (b *InMemoryBackend) DescribeSnapshots( ctx context.Context, snapshotName, clusterID, replicationGroupID, snapshotSource, marker string, maxRecords int, ) (page.Page[CacheSnapshot], error)
DescribeSnapshots returns one snapshot by name, or a paginated list filtered by cluster/rg/source. snapshotSource mirrors the real AWS filter values: "system" matches automated snapshots, "user" matches manual snapshots, and "" returns all.
func (*InMemoryBackend) DescribeSubnetGroups ¶
func (b *InMemoryBackend) DescribeSubnetGroups( ctx context.Context, name, marker string, maxRecords int, ) (page.Page[CacheSubnetGroup], error)
DescribeSubnetGroups returns one subnet group by name, or a paginated list of all.
func (*InMemoryBackend) DescribeUpdateActions ¶
func (b *InMemoryBackend) DescribeUpdateActions( _ context.Context, serviceUpdateName string, marker string, maxRecords int, ) (page.Page[UpdateAction], error)
DescribeUpdateActions returns update actions, filtered by service update name.
func (*InMemoryBackend) DescribeUpdateActionsFull ¶
func (b *InMemoryBackend) DescribeUpdateActionsFull( serviceUpdateName, marker string, maxRecords int, ) ([]UpdateAction, string, error)
DescribeUpdateActionsFull returns update actions filtered by service update name, with pagination.
func (*InMemoryBackend) DescribeUserGroups ¶
func (b *InMemoryBackend) DescribeUserGroups( ctx context.Context, groupID, marker string, maxRecords int, ) (page.Page[UserGroup], error)
DescribeUserGroups returns a paginated list of user groups, optionally filtered by groupID.
func (*InMemoryBackend) DescribeUsers ¶
func (b *InMemoryBackend) DescribeUsers( ctx context.Context, userID, marker string, maxRecords int, ) (page.Page[User], error)
DescribeUsers returns a paginated list of users, optionally filtered by userID.
func (*InMemoryBackend) DisassociateGlobalReplicationGroup ¶
func (b *InMemoryBackend) DisassociateGlobalReplicationGroup( _ context.Context, id, _, _ string, ) (*GlobalReplicationGroup, error)
DisassociateGlobalReplicationGroup removes a secondary replication group from a global replication group.
func (*InMemoryBackend) ExportServerlessCacheSnapshot ¶
func (b *InMemoryBackend) ExportServerlessCacheSnapshot( ctx context.Context, snapshotName, _ string, ) (*ServerlessCacheSnapshot, error)
ExportServerlessCacheSnapshot exports a serverless cache snapshot to S3.
func (*InMemoryBackend) FailoverGlobalReplicationGroup ¶
func (b *InMemoryBackend) FailoverGlobalReplicationGroup( _ context.Context, id, _, _ string, ) (*GlobalReplicationGroup, error)
FailoverGlobalReplicationGroup promotes a secondary region to primary.
func (*InMemoryBackend) FailoverReplicationGroup ¶
func (b *InMemoryBackend) FailoverReplicationGroup(ctx context.Context, id, _ string) (*ReplicationGroup, error)
FailoverReplicationGroup simulates a failover for the given replication group.
func (*InMemoryBackend) IncreaseNodeGroupsInGlobalReplicationGroup ¶
func (b *InMemoryBackend) IncreaseNodeGroupsInGlobalReplicationGroup( _ context.Context, id string, nodeGroupCount int32, ) (*GlobalReplicationGroup, error)
IncreaseNodeGroupsInGlobalReplicationGroup increases the node group count.
func (*InMemoryBackend) IncreaseReplicaCount ¶
func (b *InMemoryBackend) IncreaseReplicaCount( ctx context.Context, replicationGroupID string, newReplicaCount int32, ) (*ReplicationGroup, error)
IncreaseReplicaCount increases the replica count for a replication group.
func (*InMemoryBackend) ListAll ¶
func (b *InMemoryBackend) ListAll() []Cluster
ListAll returns all clusters across all regions (used by dashboard).
func (*InMemoryBackend) ListAllowedNodeTypeModifications ¶
func (b *InMemoryBackend) ListAllowedNodeTypeModifications(_ context.Context, _, _ string) ([]string, error)
ListAllowedNodeTypeModifications returns a list of allowed node type modifications.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(_ context.Context, arn string) (map[string]string, error)
ListTagsForResource returns tags for the given ARN.
func (*InMemoryBackend) ListUpdateActionsByServiceUpdate ¶
func (b *InMemoryBackend) ListUpdateActionsByServiceUpdate(serviceUpdateName string) []*UpdateAction
ListUpdateActionsByServiceUpdate returns update actions filtered by service update name.
func (*InMemoryBackend) ModifyCluster ¶
func (b *InMemoryBackend) ModifyCluster( ctx context.Context, id, nodeType, paramGroupName, engineVersion, maintenanceWindow, snapshotWindow string, numCacheNodes int, ) (*Cluster, error)
ModifyCluster modifies an existing cache cluster.
func (*InMemoryBackend) ModifyGlobalReplicationGroup ¶
func (b *InMemoryBackend) ModifyGlobalReplicationGroup( _ context.Context, id, description, engineVersion string, automaticFailoverEnabled bool, ) (*GlobalReplicationGroup, error)
ModifyGlobalReplicationGroup modifies a global replication group.
func (*InMemoryBackend) ModifyParameterGroup ¶
func (b *InMemoryBackend) ModifyParameterGroup( ctx context.Context, name string, params map[string]string, ) (*CacheParameterGroup, error)
ModifyParameterGroup updates parameters in a cache parameter group.
func (*InMemoryBackend) ModifyReplicationGroup ¶
func (b *InMemoryBackend) ModifyReplicationGroup( ctx context.Context, id, description, paramGroupName, engineVersion, cacheNodeType, maintenanceWindow, snapshotWindow string, automaticFailoverEnabled, multiAZEnabled *bool, ) (*ReplicationGroup, error)
ModifyReplicationGroup modifies an existing replication group.
func (*InMemoryBackend) ModifyReplicationGroupFull ¶
func (b *InMemoryBackend) ModifyReplicationGroupFull( ctx context.Context, id string, opts ReplicationGroupModifyOpts, ) (*ReplicationGroup, error)
ModifyReplicationGroupFull modifies a replication group with the full set of options.
func (*InMemoryBackend) ModifyReplicationGroupShardConfiguration ¶
func (b *InMemoryBackend) ModifyReplicationGroupShardConfiguration( ctx context.Context, replicationGroupID string, nodeGroupCount int32, ) (*ReplicationGroup, error)
ModifyReplicationGroupShardConfiguration modifies the shard configuration of a replication group. Cluster mode must be enabled to use this operation.
func (*InMemoryBackend) ModifyServerlessCache ¶
func (b *InMemoryBackend) ModifyServerlessCache( ctx context.Context, name, description string, ) (*ServerlessCache, error)
ModifyServerlessCache modifies a serverless cache.
func (*InMemoryBackend) ModifyServerlessCacheFull ¶
func (b *InMemoryBackend) ModifyServerlessCacheFull( ctx context.Context, name string, opts ServerlessModifyOpts, ) (*ServerlessCache, error)
ModifyServerlessCacheFull modifies a serverless cache with the full set of options.
func (*InMemoryBackend) ModifySubnetGroup ¶
func (b *InMemoryBackend) ModifySubnetGroup( ctx context.Context, name, description string, subnetIDs []string, ) (*CacheSubnetGroup, error)
ModifySubnetGroup updates a cache subnet group.
func (*InMemoryBackend) ModifyUser ¶
func (b *InMemoryBackend) ModifyUser( ctx context.Context, userID, accessString string, noPasswordRequired bool, ) (*User, error)
ModifyUser modifies a user's access string and/or password settings using the legacy NoPasswordRequired boolean. Kept for callers that only need password-vs-no-password, delegating to InMemoryBackend.ModifyUserWithAuth.
func (*InMemoryBackend) ModifyUserGroup ¶
func (b *InMemoryBackend) ModifyUserGroup( ctx context.Context, groupID string, userIDsToAdd, userIDsToRemove []string, ) (*UserGroup, error)
ModifyUserGroup adds or removes users from a user group.
func (*InMemoryBackend) ModifyUserWithAuth ¶ added in v1.2.0
func (b *InMemoryBackend) ModifyUserWithAuth( ctx context.Context, userID, accessString, appendAccessString, engine, authType string, passwordCount *int, ) (*User, error)
ModifyUserWithAuth modifies a user's access string (overwrite or append), engine, and/or full authentication model. Empty/nil arguments leave the corresponding field unchanged; accessString and appendAccessString are mutually exclusive per AWS's ModifyUser contract (the caller is expected to only set one).
func (*InMemoryBackend) PurchaseReservedCacheNodesOffering ¶
func (b *InMemoryBackend) PurchaseReservedCacheNodesOffering( ctx context.Context, offeringID, reservedCacheNodeID string, cacheNodeCount int32, ) (*ReservedCacheNode, error)
PurchaseReservedCacheNodesOffering purchases a reserved cache node offering.
func (*InMemoryBackend) RebalanceSlotsInGlobalReplicationGroup ¶
func (b *InMemoryBackend) RebalanceSlotsInGlobalReplicationGroup( _ context.Context, id string, ) (*GlobalReplicationGroup, error)
RebalanceSlotsInGlobalReplicationGroup rebalances slots.
func (*InMemoryBackend) RebootCacheCluster ¶
func (b *InMemoryBackend) RebootCacheCluster( ctx context.Context, clusterID string, nodeIDs []string, ) (*Cluster, error)
RebootCacheCluster reboots a cache cluster.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the backend's default AWS region.
func (*InMemoryBackend) RemoveTagsFromResource ¶
func (b *InMemoryBackend) RemoveTagsFromResource(_ context.Context, resourceARN string, tagKeys []string) error
RemoveTagsFromResource removes the specified tag keys from the resource identified by resourceARN.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset closes all miniredis instances, clears all state, and re-initialises default parameter groups.
func (*InMemoryBackend) ResetParameterGroup ¶
func (b *InMemoryBackend) ResetParameterGroup( ctx context.Context, name string, paramNames []string, resetAll bool, ) (*CacheParameterGroup, error)
ResetParameterGroup resets parameters in a cache parameter group to defaults.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.
func (*InMemoryBackend) RevokeCacheSecurityGroupIngress ¶
func (b *InMemoryBackend) RevokeCacheSecurityGroupIngress( ctx context.Context, name, ec2SecurityGroupName, ec2SecurityGroupOwnerID string, ) (*CacheSecurityGroup, error)
RevokeCacheSecurityGroupIngress removes an EC2 security group authorization.
func (*InMemoryBackend) SetClock ¶
func (b *InMemoryBackend) SetClock(clock func() time.Time)
SetClock overrides the backend clock. Primarily for deterministic tests that need to advance time past a transition deadline without sleeping. Passing nil restores time.Now. Safe for concurrent use.
func (*InMemoryBackend) SetDNSRegistrar ¶
func (b *InMemoryBackend) SetDNSRegistrar(r DNSRegistrar)
SetDNSRegistrar wires a DNS server so cache cluster hostnames are automatically registered on create and deregistered on delete.
func (*InMemoryBackend) SetLifecycleDelay ¶
func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)
SetLifecycleDelay configures how long resources dwell in an intermediate state before reaching their terminal state. Zero (the default) means transitions are instant. It is safe for concurrent use.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON. It implements persistence.Persistable.
func (*InMemoryBackend) StartMigration ¶
func (b *InMemoryBackend) StartMigration(ctx context.Context, replicationGroupID string) (*ReplicationGroup, error)
StartMigration starts a migration for a replication group.
func (*InMemoryBackend) TaggedResources ¶ added in v1.2.0
func (b *InMemoryBackend) TaggedResources() []TaggedEntry
TaggedResources returns every ElastiCache resource ARN that currently has at least one tag, across every taggable resource kind (see collectTagCandidatesLocked).
func (*InMemoryBackend) TestMigration ¶
func (b *InMemoryBackend) TestMigration(ctx context.Context, replicationGroupID string) (*ReplicationGroup, error)
TestMigration tests a migration for a replication group.
func (*InMemoryBackend) TriggerAutoSnapshot ¶
func (b *InMemoryBackend) TriggerAutoSnapshot(ctx context.Context, replicationGroupID string) (*CacheSnapshot, error)
TriggerAutoSnapshot creates an automated snapshot for the given replication group.
type LogDeliveryConfig ¶
type LogDeliveryConfig struct {
DestinationDetails string `json:"destinationDetails"`
LogType string `json:"logType"` // "slow-log" or "engine-log"
DestinationType string `json:"destinationType"` // "cloudwatch-logs" or "kinesis-firehose"
LogFormat string `json:"logFormat"` // "text" or "json"
Status string `json:"status"`
Message string `json:"message,omitempty"`
}
LogDeliveryConfig holds log delivery configuration for slow-log or engine-log (gap #6).
type NodeGroup ¶
type NodeGroup struct {
PrimaryNode *NodeGroupNode `json:"primaryNode,omitempty"`
NodeGroupID string `json:"nodeGroupId"`
Status string `json:"status"`
Slots string `json:"slots"`
Replicas []NodeGroupNode `json:"replicas,omitempty"`
}
NodeGroup represents a shard / node group in a cluster-mode-enabled replication group (gap #2).
type NodeGroupNode ¶
type NodeGroupNode struct {
ReadEndpointAddress string `json:"readEndpointAddress,omitempty"`
CacheClusterID string `json:"cacheClusterId"`
CacheNodeID string `json:"cacheNodeId"`
CurrentRole string `json:"currentRole"` // "primary" or "replica"
PreferredAvailabilityZone string `json:"preferredAvailabilityZone"`
ReadEndpointPort int `json:"readEndpointPort,omitempty"`
}
NodeGroupNode represents a single node within a node group (gap #2).
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the ElastiCache service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the ElastiCache service backend and handler.
type RGPendingModifiedValues ¶
type RGPendingModifiedValues struct {
ReplicaCount *int32 `json:"replicaCount,omitempty"`
CacheNodeType string `json:"cacheNodeType,omitempty"`
EngineVersion string `json:"engineVersion,omitempty"`
AuthTokenStatus string `json:"authTokenStatus,omitempty"`
AutomaticFailoverStatus string `json:"automaticFailoverStatus,omitempty"`
}
RGPendingModifiedValues holds modifications queued for the next maintenance window (gap #7).
type ReplicationGroup ¶
type ReplicationGroup struct {
CreatedAt time.Time `json:"createdAt"`
AuthTokenLastModifiedDate *time.Time `json:"authTokenLastModifiedDate,omitempty"`
AvailableAt time.Time `json:"availableAt,omitzero"`
PendingModifiedValues *RGPendingModifiedValues `json:"pendingModifiedValues,omitempty"`
Tags *tags.Tags `json:"tags,omitempty"`
ReplicationGroupID string `json:"replicationGroupID"`
Description string `json:"description"`
Status string `json:"status"`
PendingStatus string `json:"pendingStatus,omitempty"`
ARN string `json:"arn"`
Engine string `json:"engine,omitempty"`
CacheParameterGroupName string `json:"cacheParameterGroupName,omitempty"`
AutomaticFailover string `json:"automaticFailover,omitempty"`
EngineVersion string `json:"engineVersion,omitempty"`
CacheNodeType string `json:"cacheNodeType,omitempty"`
PreferredMaintenanceWindow string `json:"preferredMaintenanceWindow,omitempty"`
SnapshotWindow string `json:"snapshotWindow,omitempty"`
AuthToken string `json:"authToken,omitempty"`
KmsKeyID string `json:"kmsKeyId,omitempty"`
NotificationTopicArn string `json:"notificationTopicArn,omitempty"`
TransitEncryptionMode string `json:"transitEncryptionMode,omitempty"`
NodeGroups []NodeGroup `json:"nodeGroups,omitempty"`
LogDeliveryConfigurations []LogDeliveryConfig `json:"logDeliveryConfigurations,omitempty"`
UserGroupIDs []string `json:"userGroupIds,omitempty"`
SnapshotRetentionLimit int `json:"snapshotRetentionLimit,omitempty"`
ReplicaCount int32 `json:"replicaCount,omitempty"`
ClusterModeEnabled bool `json:"clusterModeEnabled,omitempty"`
AuthTokenEnabled bool `json:"authTokenEnabled,omitempty"`
AtRestEncryptionEnabled bool `json:"atRestEncryptionEnabled,omitempty"`
TransitEncryptionEnabled bool `json:"transitEncryptionEnabled,omitempty"`
DataTieringEnabled bool `json:"dataTieringEnabled,omitempty"`
MultiAZEnabled bool `json:"multiAZEnabled,omitempty"`
}
ReplicationGroup represents an ElastiCache replication group.
type ReplicationGroupCreateOpts ¶
type ReplicationGroupCreateOpts struct {
Tags map[string]string
Engine string
EngineVersion string
ID string
Description string
ParameterGroupName string
// SnapshotName, when set, restores the new replication group from an
// existing snapshot: the snapshot must exist, and its engine/node type
// become defaults for any field the caller didn't explicitly set.
SnapshotName string
MaintenanceWindow string
TransitEncryptionMode string
AuthToken string
KmsKeyID string
NotificationTopicArn string
CacheNodeType string
SnapshotWindow string
UserGroupIDs []string
LogDeliveryConfigurations []LogDeliveryConfig
SnapshotRetentionLimit int
ReplicasPerNodeGroup int32
NumNodeGroups int32
ClusterModeEnabled bool
AuthTokenEnabled bool
AtRestEncryptionEnabled bool
TransitEncryptionEnabled bool
DataTieringEnabled bool
AutomaticFailoverEnabled bool
MultiAZEnabled bool
}
ReplicationGroupCreateOpts carries all fields for full replication-group creation.
type ReplicationGroupModifyOpts ¶
type ReplicationGroupModifyOpts struct {
SnapshotRetentionLimit *int
ReplicaCount *int32
AutomaticFailoverEnabled *bool
MultiAZEnabled *bool
Description string
ParameterGroupName string
EngineVersion string
CacheNodeType string
MaintenanceWindow string
SnapshotWindow string
AuthToken string
AuthTokenUpdateStrategy string
NotificationTopicArn string
TransitEncryptionMode string
LogDeliveryConfigurations []LogDeliveryConfig
UserGroupIDsToAdd []string
UserGroupIDsToRemove []string
ApplyImmediately bool
}
ReplicationGroupModifyOpts carries all fields for full replication-group modification.
type ReservedCacheNode ¶
type ReservedCacheNode struct {
StartTime time.Time `json:"startTime"`
ReservationID string `json:"reservationID,omitempty"`
ReservedCacheNodeID string `json:"reservedCacheNodeID"`
ARN string `json:"arn"`
CacheNodeType string `json:"cacheNodeType"`
OfferingType string `json:"offeringType"`
ProductDescription string `json:"productDescription"`
State string `json:"state"`
OfferingID string `json:"offeringID"`
FixedPrice float64 `json:"fixedPrice"`
UsagePrice float64 `json:"usagePrice"`
Duration int32 `json:"duration"`
CacheNodeCount int32 `json:"cacheNodeCount"`
}
ReservedCacheNode represents a purchased reserved cache node.
type ReservedCacheNodesOffering ¶
type ReservedCacheNodesOffering struct {
OfferingID string
CacheNodeType string
ProductDescription string
OfferingType string
FixedPrice float64
UsagePrice float64
Duration int32
}
ReservedCacheNodesOffering represents a reserved node offering.
type ServerlessCache ¶
type ServerlessCache struct {
CreatedAt time.Time `json:"createdAt"`
AvailableAt time.Time `json:"availableAt,omitzero"`
Tags *tags.Tags `json:"tags,omitempty"`
Endpoint *ServerlessCacheEndpoint `json:"endpoint,omitempty"`
ReaderEndpoint *ServerlessCacheEndpoint `json:"readerEndpoint,omitempty"`
CacheUsageLimits *CacheUsageLimits `json:"cacheUsageLimits,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
PendingStatus string `json:"pendingStatus,omitempty"`
ARN string `json:"arn"`
Engine string `json:"engine"`
KmsKeyID string `json:"kmsKeyId,omitempty"`
UserGroupID string `json:"userGroupId,omitempty"`
SubnetGroupName string `json:"subnetGroupName,omitempty"`
DailySnapshotTime string `json:"dailySnapshotTime,omitempty"`
MajorEngineVersion string `json:"majorEngineVersion,omitempty"`
SubnetIDs []string `json:"subnetIds,omitempty"`
SecurityGroupIDs []string `json:"securityGroupIds,omitempty"`
SnapshotRetentionLimit int32 `json:"snapshotRetentionLimit,omitempty"`
}
ServerlessCache represents an ElastiCache serverless cache.
type ServerlessCacheConfigSnapshot ¶ added in v1.2.0
type ServerlessCacheConfigSnapshot struct {
ServerlessCacheName string `json:"serverlessCacheName,omitempty"`
Engine string `json:"engine,omitempty"`
MajorEngineVersion string `json:"majorEngineVersion,omitempty"`
}
ServerlessCacheConfigSnapshot mirrors a serverless cache's configuration as it existed at the moment a snapshot was taken (aws-sdk-go-v2/service/ elasticache/types.ServerlessCacheConfiguration).
type ServerlessCacheEndpoint ¶
ServerlessCacheEndpoint holds the address and port for a serverless cache endpoint.
type ServerlessCacheSnapshot ¶
type ServerlessCacheSnapshot struct {
CreatedAt time.Time `json:"createdAt"`
ExpiryTime time.Time `json:"expiryTime,omitzero"`
Tags *tags.Tags `json:"tags,omitempty"`
ServerlessCacheConfiguration *ServerlessCacheConfigSnapshot `json:"serverlessCacheConfiguration,omitempty"`
Name string `json:"name"`
Status string `json:"status"`
ARN string `json:"arn"`
ServerlessCacheName string `json:"serverlessCacheName"`
SnapshotType string `json:"snapshotType"` // "manual" or "automated"
KmsKeyID string `json:"kmsKeyId,omitempty"`
BytesUsedForCache string `json:"bytesUsedForCache,omitempty"`
}
ServerlessCacheSnapshot represents a snapshot of a serverless cache.
ExpiryTime is deliberately left zero for every snapshot this emulator creates: real AWS only sets it for automatically-created snapshots (expiry driven by the source cache's SnapshotRetentionLimit), never for manual or copied ones -- and CreateServerlessCacheSnapshot/CopyServerlessCacheSnapshot only ever produce "manual"-type snapshots here (see SnapshotType), matching the already-documented deferred gap that this emulator has no background automated-snapshot scheduler. BytesUsedForCache is always "0": serverless caches in this emulator have no real backing data-plane engine (unlike Cluster, which uses an embedded miniredis instance) to compute an accurate byte count from, so "0" is the literal, non-fabricated true size of the (empty) data this emulator actually holds for it.
type ServerlessCreateOpts ¶
type ServerlessCreateOpts struct {
Tags map[string]string
CacheUsageLimits *CacheUsageLimits
Name string
Description string
Engine string
KmsKeyID string
UserGroupID string
SubnetGroupName string
DailySnapshotTime string
MajorEngineVersion string
SecurityGroupIDs []string
SubnetIDs []string
SnapshotRetentionLimit int32
}
ServerlessCreateOpts carries all fields for serverless cache creation.
type ServerlessModifyOpts ¶
type ServerlessModifyOpts struct {
SnapshotRetentionLimit *int32
CacheUsageLimits *CacheUsageLimits
Description string
UserGroupID string
DailySnapshotTime string
SecurityGroupIDs []string
RemoveUserGroup bool
}
ServerlessModifyOpts carries all fields for serverless cache modification.
type ServiceUpdate ¶
ServiceUpdate represents a service update.
func BuiltinServiceUpdates ¶
func BuiltinServiceUpdates() []ServiceUpdate
BuiltinServiceUpdates returns a slice of pre-seeded service updates for testing realism.
type StorageBackend ¶
type StorageBackend interface {
CreateCluster(ctx context.Context, id, engine, nodeType string, port int) (*Cluster, error)
CreateClusterWithOptions(
ctx context.Context,
id, engine, nodeType, paramGroupName, maintenanceWindow, snapshotWindow string,
numCacheNodes, port int,
) (*Cluster, error)
DeleteCluster(ctx context.Context, id string) error
DescribeClusters(ctx context.Context, id, marker string, maxRecords int, notInRG bool) (page.Page[Cluster], error)
ModifyCluster(
ctx context.Context,
id, nodeType, paramGroupName, engineVersion, maintenanceWindow, snapshotWindow string,
numCacheNodes int,
) (*Cluster, error)
ListTagsForResource(ctx context.Context, arn string) (map[string]string, error)
AddTagsToResource(ctx context.Context, arn string, newTags map[string]string) error
RemoveTagsFromResource(ctx context.Context, arn string, tagKeys []string) error
CreateReplicationGroup(ctx context.Context, id, description string) (*ReplicationGroup, error)
CreateReplicationGroupWithOptions(
ctx context.Context,
id, description, paramGroupName, maintenanceWindow, snapshotWindow string,
) (*ReplicationGroup, error)
DeleteReplicationGroup(ctx context.Context, id string) error
DescribeReplicationGroups(
ctx context.Context,
id, marker string,
maxRecords int,
) (page.Page[ReplicationGroup], error)
ModifyReplicationGroup(
ctx context.Context,
id, description, paramGroupName, engineVersion, cacheNodeType, maintenanceWindow, snapshotWindow string,
automaticFailoverEnabled, multiAZEnabled *bool,
) (*ReplicationGroup, error)
FailoverReplicationGroup(ctx context.Context, id, nodeGroupID string) (*ReplicationGroup, error)
CreateParameterGroup(ctx context.Context, name, family, description string) (*CacheParameterGroup, error)
DeleteParameterGroup(ctx context.Context, name string) error
DescribeParameterGroups(
ctx context.Context,
name, marker string,
maxRecords int,
) (page.Page[CacheParameterGroup], error)
ModifyParameterGroup(ctx context.Context, name string, params map[string]string) (*CacheParameterGroup, error)
ResetParameterGroup(
ctx context.Context,
name string,
paramNames []string,
resetAll bool,
) (*CacheParameterGroup, error)
DescribeParameters(ctx context.Context, name, marker string, maxRecords int) (page.Page[CacheParameter], error)
CreateSubnetGroup(ctx context.Context, name, description string, subnetIDs []string) (*CacheSubnetGroup, error)
CreateSubnetGroupFull(
ctx context.Context,
name, description, vpcID string,
subnetIDs []string,
) (*CacheSubnetGroup, error)
DeleteSubnetGroup(ctx context.Context, name string) error
DescribeSubnetGroups(ctx context.Context, name, marker string, maxRecords int) (page.Page[CacheSubnetGroup], error)
ModifySubnetGroup(ctx context.Context, name, description string, subnetIDs []string) (*CacheSubnetGroup, error)
CreateSnapshot(ctx context.Context, snapshotName, clusterID, replicationGroupID string) (*CacheSnapshot, error)
DeleteSnapshot(ctx context.Context, snapshotName string) (*CacheSnapshot, error)
DescribeSnapshots(
ctx context.Context,
snapshotName, clusterID, replicationGroupID, snapshotSource, marker string,
maxRecords int,
) (page.Page[CacheSnapshot], error)
CopySnapshot(ctx context.Context, sourceSnapshotName, targetSnapshotName string) (*CacheSnapshot, error)
CopySnapshotFull(
ctx context.Context,
sourceSnapshotName, targetSnapshotName, kmsKeyID string,
) (*CacheSnapshot, error)
DescribeEvents(
ctx context.Context,
sourceIdentifier, sourceType, marker string,
startTime, endTime time.Time,
duration, maxRecords int,
) (page.Page[CacheEvent], error)
// New ops
CreateCacheSecurityGroup(ctx context.Context, name, description string) (*CacheSecurityGroup, error)
AuthorizeCacheSecurityGroupIngress(
ctx context.Context,
name, ec2SecurityGroupName, ec2SecurityGroupOwnerID string,
) (*CacheSecurityGroup, error)
CreateGlobalReplicationGroup(
ctx context.Context,
globalReplicationGroupIDSuffix, description, primaryReplicationGroupID string,
) (*GlobalReplicationGroup, error)
CreateServerlessCache(ctx context.Context, name, description, engine string) (*ServerlessCache, error)
CreateServerlessCacheSnapshot(
ctx context.Context,
snapshotName, serverlessCacheName, kmsKeyID string,
) (*ServerlessCacheSnapshot, error)
CopyServerlessCacheSnapshot(
ctx context.Context,
sourceSnapshotName, targetSnapshotName string,
) (*ServerlessCacheSnapshot, error)
CreateUser(
ctx context.Context,
userID, userName, accessString, engine string,
noPasswordRequired bool,
) (*User, error)
CreateUserWithAuth(
ctx context.Context,
userID, userName, accessString, engine, authType string,
passwordCount int,
) (*User, error)
BatchApplyUpdateAction(
ctx context.Context,
replicationGroupIDs, cacheClusterIDs []string,
serviceUpdateName string,
) (*BatchUpdateResult, error)
BatchStopUpdateAction(
ctx context.Context,
replicationGroupIDs, cacheClusterIDs []string,
serviceUpdateName string,
) (*BatchUpdateResult, error)
CompleteMigration(ctx context.Context, replicationGroupID string, force bool) (*ReplicationGroup, error)
// User operations
DeleteUser(ctx context.Context, userID string) (*User, error)
DescribeUsers(ctx context.Context, userID, marker string, maxRecords int) (page.Page[User], error)
ModifyUser(ctx context.Context, userID, accessString string, noPasswordRequired bool) (*User, error)
ModifyUserWithAuth(
ctx context.Context,
userID, accessString, appendAccessString, engine, authType string,
passwordCount *int,
) (*User, error)
// UserGroup operations
CreateUserGroup(ctx context.Context, groupID, engine string, userIDs []string) (*UserGroup, error)
CreateUserGroupValidated(
ctx context.Context,
groupID, engine string,
userIDs []string,
) (*UserGroup, error)
DeleteUserGroup(ctx context.Context, groupID string) (*UserGroup, error)
DescribeUserGroups(ctx context.Context, groupID, marker string, maxRecords int) (page.Page[UserGroup], error)
ModifyUserGroup(ctx context.Context, groupID string, userIDsToAdd, userIDsToRemove []string) (*UserGroup, error)
// GlobalReplicationGroup operations
DeleteGlobalReplicationGroup(
ctx context.Context,
id string,
retainPrimaryReplicationGroup bool,
) (*GlobalReplicationGroup, error)
DescribeGlobalReplicationGroups(
ctx context.Context,
id, marker string,
maxRecords int,
) (page.Page[GlobalReplicationGroup], error)
DisassociateGlobalReplicationGroup(
ctx context.Context,
id, replicationGroupID, replicationGroupRegion string,
) (*GlobalReplicationGroup, error)
FailoverGlobalReplicationGroup(
ctx context.Context,
id, primaryRegion, primaryReplicationGroupID string,
) (*GlobalReplicationGroup, error)
IncreaseNodeGroupsInGlobalReplicationGroup(
ctx context.Context,
id string,
nodeGroupCount int32,
) (*GlobalReplicationGroup, error)
DecreaseNodeGroupsInGlobalReplicationGroup(
ctx context.Context,
id string,
nodeGroupCount int32,
) (*GlobalReplicationGroup, error)
ModifyGlobalReplicationGroup(
ctx context.Context,
id, description, engineVersion string,
automaticFailoverEnabled bool,
) (*GlobalReplicationGroup, error)
RebalanceSlotsInGlobalReplicationGroup(ctx context.Context, id string) (*GlobalReplicationGroup, error)
// ReservedCacheNodes operations
DescribeReservedCacheNodes(
ctx context.Context,
id, cacheNodeType, offeringType, marker string,
maxRecords int,
) (page.Page[ReservedCacheNode], error)
DescribeReservedCacheNodesOfferings(
ctx context.Context,
offeringID, cacheNodeType, offeringType, marker string,
maxRecords int,
) (page.Page[ReservedCacheNodesOffering], error)
PurchaseReservedCacheNodesOffering(
ctx context.Context,
offeringID, reservedCacheNodeID string,
cacheNodeCount int32,
) (*ReservedCacheNode, error)
// ServerlessCache operations
DeleteServerlessCache(ctx context.Context, name string) (*ServerlessCache, error)
DeleteServerlessCacheSnapshot(ctx context.Context, name string) (*ServerlessCacheSnapshot, error)
DescribeServerlessCaches(
ctx context.Context,
name, marker string,
maxRecords int,
) (page.Page[ServerlessCache], error)
DescribeServerlessCacheSnapshots(
ctx context.Context,
serverlessCacheName, snapshotName, marker string,
maxRecords int,
) (page.Page[ServerlessCacheSnapshot], error)
ExportServerlessCacheSnapshot(
ctx context.Context,
snapshotName, s3BucketName string,
) (*ServerlessCacheSnapshot, error)
ModifyServerlessCache(ctx context.Context, name, description string) (*ServerlessCache, error)
CreateServerlessCacheFull(ctx context.Context, opts ServerlessCreateOpts) (*ServerlessCache, error)
ModifyServerlessCacheFull(ctx context.Context, name string, opts ServerlessModifyOpts) (*ServerlessCache, error)
// Migration operations
StartMigration(ctx context.Context, replicationGroupID string) (*ReplicationGroup, error)
TestMigration(ctx context.Context, replicationGroupID string) (*ReplicationGroup, error)
IncreaseReplicaCount(
ctx context.Context,
replicationGroupID string,
newReplicaCount int32,
) (*ReplicationGroup, error)
DecreaseReplicaCount(
ctx context.Context,
replicationGroupID string,
newReplicaCount int32,
) (*ReplicationGroup, error)
ModifyReplicationGroupShardConfiguration(
ctx context.Context,
replicationGroupID string,
nodeGroupCount int32,
) (*ReplicationGroup, error)
// Cache info operations
DescribeCacheEngineVersions(
ctx context.Context,
engine, family, engineVersion, marker string,
maxRecords int,
) (page.Page[CacheEngineVersion], error)
RebootCacheCluster(ctx context.Context, clusterID string, nodeIDs []string) (*Cluster, error)
DeleteCacheSecurityGroup(ctx context.Context, name string) error
DescribeCacheSecurityGroups(
ctx context.Context,
name, marker string,
maxRecords int,
) (page.Page[CacheSecurityGroup], error)
RevokeCacheSecurityGroupIngress(
ctx context.Context,
name, ec2SecurityGroupName, ec2SecurityGroupOwnerID string,
) (*CacheSecurityGroup, error)
DescribeEngineDefaultParameters(
ctx context.Context,
cacheParameterGroupFamily, marker string,
maxRecords int,
) (page.Page[CacheParameter], error)
DescribeServiceUpdates(
ctx context.Context,
serviceUpdateName, marker string,
maxRecords int,
status []string,
) (page.Page[ServiceUpdate], error)
DescribeUpdateActions(
ctx context.Context,
serviceUpdateName, marker string,
maxRecords int,
) (page.Page[UpdateAction], error)
ListAllowedNodeTypeModifications(ctx context.Context, clusterID, replicationGroupID string) ([]string, error)
// Audit1: extended create/modify with new fields
CreateReplicationGroupFull(ctx context.Context, opts ReplicationGroupCreateOpts) (*ReplicationGroup, error)
ModifyReplicationGroupFull(
ctx context.Context,
id string,
opts ReplicationGroupModifyOpts,
) (*ReplicationGroup, error)
// Audit1: auto snapshot scheduling
TriggerAutoSnapshot(ctx context.Context, replicationGroupID string) (*CacheSnapshot, error)
// Batch-2: update action tracking
AppendUpdateActions(actions []*UpdateAction)
ListUpdateActionsByServiceUpdate(serviceUpdateName string) []*UpdateAction
// Region returns the backend's default AWS region.
Region() string
}
StorageBackend defines the interface for the ElastiCache in-memory store.
type TaggedEntry ¶ added in v1.2.0
TaggedEntry pairs a resource ARN with its tag map, for cross-service tag enumeration by the Resource Groups Tagging API (see cli.go's wireTaggingElastiCache).
type UpdateAction ¶
type UpdateAction struct {
ReplicationGroupID string
CacheClusterID string
ServiceUpdateName string
UpdateActionStatus string
}
UpdateAction represents an update action.
type UpdateActionResult ¶
type UpdateActionResult struct {
ReplicationGroupID string `json:"replicationGroupId,omitempty"`
CacheClusterID string `json:"cacheClusterId,omitempty"`
ServiceUpdateName string `json:"serviceUpdateName"`
UpdateActionStatus string `json:"updateActionStatus"`
}
UpdateActionResult represents the outcome of a single update action.
type User ¶
type User struct {
CreatedAt time.Time `json:"createdAt"`
Tags *tags.Tags `json:"tags,omitempty"`
UserID string `json:"userId"`
UserName string `json:"userName"`
Status string `json:"status"`
ARN string `json:"arn"`
Engine string `json:"engine"`
AccessString string `json:"accessString"`
AuthType string `json:"authType"`
UserGroupIDs []string `json:"userGroupIds,omitempty"`
PasswordCount int `json:"passwordCount"`
}
User represents an ElastiCache user.
AuthType holds the wire-accurate OUTPUT authentication type -- one of "password", "no-password", or "iam" (types.AuthenticationType). Note this differs from the INPUT enum accepted on Create/ModifyUser (types.InputAuthenticationType), which spells the no-password case "no-password-required"; the two must not be confused when field-diffing against the SDK. PasswordCount reflects len(Passwords) (max 2, enforced at the handler); the plaintext passwords themselves are never echoed back on the wire, matching AWS. UserGroupIDs is derived (the reverse of UserGroup.UserIDs) and populated fresh on every response, not persisted.
type UserGroup ¶
type UserGroup struct {
CreatedAt time.Time `json:"createdAt"`
Tags *tags.Tags `json:"tags,omitempty"`
UserGroupID string `json:"userGroupID"`
Status string `json:"status"`
ARN string `json:"arn"`
Engine string `json:"engine"`
UserIDs []string `json:"userIDs,omitempty"`
AssignedReplicationGroupIDs []string `json:"assignedReplicationGroupIDs,omitempty"`
}
UserGroup represents an ElastiCache user group.
AssignedReplicationGroupIDs mirrors the wire ReplicationGroups field (types.UserGroup.ReplicationGroups): the reverse of ReplicationGroup.UserGroupIDs, computed fresh on every response rather than persisted (see userGroupReplicationGroupIDsLocked), matching how User.UserGroupIDs is derived. Note: the real SDK's UserGroup type has NO Description field -- a prior pass invented one and serialized it on the wire; do not re-add it.
Source Files
¶
- cache_clusters.go
- engine_versions.go
- errors.go
- events.go
- global_replication_groups.go
- handler.go
- handler_cache_clusters.go
- handler_engine_versions.go
- handler_events.go
- handler_global_replication_groups.go
- handler_parameter_groups.go
- handler_replication_groups.go
- handler_reserved_nodes.go
- handler_security_groups.go
- handler_serverless.go
- handler_service_updates.go
- handler_snapshots.go
- handler_subnet_groups.go
- handler_tags.go
- handler_user_groups.go
- handler_users.go
- lifecycle.go
- models.go
- pagination.go
- parameter_groups.go
- persistence.go
- provider.go
- replication_groups.go
- reserved_nodes.go
- security_groups.go
- serverless.go
- service_updates.go
- snapshots.go
- store.go
- store_setup.go
- subnet_groups.go
- tags.go
- user_groups.go
- users.go