docdb

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 23 Imported by: 0

README

DocumentDB

Parity grade: A · SDK aws-sdk-go-v2/service/docdb@v1.48.11 · last audited 2026-07-12 (7d9bd038)

Coverage

Metric Value
Operations audited 55 (49 ok, 3 partial, 3 deferred)
Feature families 8 (7 ok, 1 partial)
Known gaps 4
Deferred items 1
Resource leaks clean
Known gaps
  • GlobalCluster has no GlobalClusterMembers subresource: CreateGlobalCluster doesn't add the source cluster as a member, DescribeGlobalClusters always reports an empty member list, RemoveFromGlobalCluster is a members-list no-op (bd: file follow-up)
  • DescribeEvents / DescribePendingMaintenanceActions / ApplyPendingMaintenanceAction have no real backing state (always return empty / don't validate the target resource exists) -- this matches the already-audited neptune service's precedent for the same DocDB/Neptune/RDS-family operations, not a new regression
  • xmlDBClusterParameter (DescribeDBClusterParameters / DescribeEngineDefaultClusterParameters) omits the optional ApplyMethod field AWS's Parameter shape carries -- cosmetic, does not break deserialization
  • CopyDBClusterSnapshot doesn't stamp a fresh SnapshotCreateTime on the copy (source snapshot's various fields are copied but not this one) -- cosmetic
Deferred
  • GlobalCluster member-tracking feature work (see gaps)

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClusterNotFound                    = awserr.New("DBClusterNotFoundFault", awserr.ErrNotFound)
	ErrClusterAlreadyExists               = awserr.New("DBClusterAlreadyExistsFault", awserr.ErrAlreadyExists)
	ErrInstanceNotFound                   = awserr.New("DBInstanceNotFound", awserr.ErrNotFound)
	ErrInstanceAlreadyExists              = awserr.New("DBInstanceAlreadyExists", awserr.ErrAlreadyExists)
	ErrSubnetGroupNotFound                = awserr.New("DBSubnetGroupNotFoundFault", awserr.ErrNotFound)
	ErrSubnetGroupAlreadyExists           = awserr.New("DBSubnetGroupAlreadyExists", awserr.ErrAlreadyExists)
	ErrSubnetGroupInUse                   = awserr.New("InvalidDBSubnetGroupStateFault", awserr.ErrInvalidParameter)
	ErrClusterParameterGroupNotFound      = awserr.New("DBParameterGroupNotFound", awserr.ErrNotFound)
	ErrClusterParameterGroupAlreadyExists = awserr.New(
		"DBParameterGroupAlreadyExists",
		awserr.ErrAlreadyExists,
	)
	ErrParameterGroupInUse            = awserr.New("InvalidDBParameterGroupState", awserr.ErrInvalidParameter)
	ErrClusterSnapshotNotFound        = awserr.New("DBClusterSnapshotNotFoundFault", awserr.ErrNotFound)
	ErrClusterSnapshotAlreadyExists   = awserr.New("DBClusterSnapshotAlreadyExistsFault", awserr.ErrAlreadyExists)
	ErrEventSubscriptionNotFound      = awserr.New("SubscriptionNotFound", awserr.ErrNotFound)
	ErrEventSubscriptionAlreadyExists = awserr.New("SubscriptionAlreadyExist", awserr.ErrAlreadyExists)
	ErrGlobalClusterNotFound          = awserr.New("GlobalClusterNotFoundFault", awserr.ErrNotFound)
	ErrGlobalClusterAlreadyExists     = awserr.New("GlobalClusterAlreadyExistsFault", awserr.ErrAlreadyExists)
	ErrInvalidParameter               = awserr.New("InvalidParameterValue", awserr.ErrInvalidParameter)
	ErrUnknownAction                  = awserr.New("InvalidAction", awserr.ErrInvalidParameter)
	ErrInvalidClusterState            = awserr.New("InvalidDBClusterStateFault", awserr.ErrInvalidParameter)
)

Error code strings below are the literal wire values the real aws-sdk-go-v2/service/docdb query-protocol error deserializers switch on (see deserializers.go's awsAwsquery_deserializeOpError* functions for each operation), NOT the Go SDK type names (which all end in "...Fault"). AWS's DocDB API is inconsistent here: some resources put "Fault" on the wire code (DBCluster, DBClusterSnapshot, GlobalCluster, InvalidDBClusterStateFault, InvalidDBSubnetGroupStateFault), while others strip it (DBInstance, DBSubnetGroup-already-exists) or additionally drop "Cluster" and reuse the plain RDS DBParameterGroup codes for DBClusterParameterGroup operations (CreateDBClusterParameterGroup, ModifyDBClusterParameterGroup, etc. all switch on "DBParameterGroupNotFound"/"DBParameterGroupAlreadyExists"/ "InvalidDBParameterGroupState", never "DBClusterParameterGroup...Fault"). A wire code that doesn't match the SDK's switch falls through to smithy.GenericAPIError, so real callers doing errors.As against the typed fault (e.g. *types.DBInstanceNotFoundFault) silently stop matching.

View Source
var ErrNilAppContext = errors.New("AppContext is required")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	CertificateIdentifier string
	CertificateType       string
	Thumbprint            string
	ValidFrom             string
	ValidTill             string
}

type CreateDBClusterOptions

type CreateDBClusterOptions struct {
	KmsKeyID                         string
	VpcSecurityGroupIDs              []string
	EnabledCloudwatchLogsExports     []string
	IAMDatabaseAuthenticationEnabled bool
}

CreateDBClusterOptions holds optional parameters for CreateDBCluster.

type CreateDBInstanceOptions

type CreateDBInstanceOptions struct {
	CACertificateIdentifier string
	CopyTagsToSnapshot      bool
}

CreateDBInstanceOptions holds optional parameters for CreateDBInstance.

type DBCluster

type DBCluster struct {
	Tags                             map[string]string `json:"tags"`
	DBClusterArn                     string            `json:"dbClusterArn"`
	EngineVersion                    string            `json:"engineVersion"`
	Engine                           string            `json:"engine"`
	PreferredMaintenanceWindow       string            `json:"preferredMaintenanceWindow"`
	MasterUsername                   string            `json:"masterUsername"`
	DatabaseName                     string            `json:"databaseName"`
	DBClusterParameterGroupName      string            `json:"dbClusterParameterGroupName"`
	Endpoint                         string            `json:"endpoint"`
	DBClusterIdentifier              string            `json:"dbClusterIdentifier"`
	ReaderEndpoint                   string            `json:"readerEndpoint"`
	Status                           string            `json:"status"`
	DBSubnetGroupName                string            `json:"dbSubnetGroupName"`
	PreferredBackupWindow            string            `json:"preferredBackupWindow"`
	ClusterCreateTime                string            `json:"clusterCreateTime"`
	HostedZoneID                     string            `json:"hostedZoneId"`
	KmsKeyID                         string            `json:"kmsKeyId"`
	ReplicationSourceIdentifier      string            `json:"replicationSourceIdentifier"`
	AvailabilityZones                []string          `json:"availabilityZones"`
	VpcSecurityGroupIDs              []string          `json:"vpcSecurityGroupIds"`
	EnabledCloudwatchLogsExports     []string          `json:"enabledCloudwatchLogsExports"`
	ReadReplicaIdentifiers           []string          `json:"readReplicaIdentifiers"`
	Port                             int               `json:"port"`
	BackupRetentionPeriod            int               `json:"backupRetentionPeriod"`
	StorageEncrypted                 bool              `json:"storageEncrypted"`
	MultiAZ                          bool              `json:"multiAZ"`
	DeletionProtection               bool              `json:"deletionProtection"`
	IAMDatabaseAuthenticationEnabled bool              `json:"iamDatabaseAuthenticationEnabled"`
	// contains filtered or unexported fields
}

type DBClusterMemberEntry

type DBClusterMemberEntry struct {
	DBInstanceIdentifier string
	PromotionTier        int
	IsClusterWriter      bool
}

DBClusterMemberEntry represents an instance that is a member of a DB cluster.

type DBClusterParameter

type DBClusterParameter struct {
	ParameterName  string
	ParameterValue string
	Description    string
	Source         string
	ApplyType      string
	DataType       string
	IsModifiable   bool
}

type DBClusterParameterGroup

type DBClusterParameterGroup struct {
	Tags                        map[string]string `json:"tags"`
	Parameters                  map[string]string `json:"parameters"`
	DBClusterParameterGroupName string            `json:"dbClusterParameterGroupName"`
	DBParameterGroupFamily      string            `json:"dbParameterGroupFamily"`
	Description                 string            `json:"description"`
	DBClusterParameterGroupArn  string            `json:"dbClusterParameterGroupArn"`
	// contains filtered or unexported fields
}

type DBClusterSnapshot

type DBClusterSnapshot struct {
	Tags                        map[string]string `json:"tags"`
	DBClusterSnapshotIdentifier string            `json:"dbClusterSnapshotIdentifier"`
	DBClusterIdentifier         string            `json:"dbClusterIdentifier"`
	DBClusterArn                string            `json:"dbClusterArn"`
	Engine                      string            `json:"engine"`
	Status                      string            `json:"status"`
	EngineVersion               string            `json:"engineVersion"`
	SnapshotType                string            `json:"snapshotType"`
	SnapshotCreateTime          string            `json:"snapshotCreateTime"`
	PercentProgress             int               `json:"percentProgress"`
	StorageEncrypted            bool              `json:"storageEncrypted"`
	// contains filtered or unexported fields
}

type DBClusterSnapshotAttribute

type DBClusterSnapshotAttribute struct {
	AttributeName   string   `json:"attributeName"`
	AttributeValues []string `json:"attributeValues"`
}

DBClusterSnapshotAttribute represents a single attribute of a cluster snapshot.

type DBClusterSnapshotAttributesResult

type DBClusterSnapshotAttributesResult struct {
	DBClusterSnapshotIdentifier string                       `json:"dbClusterSnapshotIdentifier"`
	Attributes                  []DBClusterSnapshotAttribute `json:"attributes"`
	// contains filtered or unexported fields
}

DBClusterSnapshotAttributesResult holds the attributes for a cluster snapshot.

type DBEngineVersion

type DBEngineVersion struct {
	Engine              string
	EngineVersion       string
	DBEngineDescription string
}

DBEngineVersion represents a supported DocDB engine version.

type DBInstance

type DBInstance struct {
	Tags                         map[string]string `json:"tags"`
	DBInstanceIdentifier         string            `json:"dbInstanceIdentifier"`
	DBClusterIdentifier          string            `json:"dbClusterIdentifier"`
	DBInstanceClass              string            `json:"dbInstanceClass"`
	Engine                       string            `json:"engine"`
	DBInstanceStatus             string            `json:"dbInstanceStatus"`
	Endpoint                     string            `json:"endpoint"`
	DBInstanceArn                string            `json:"dbInstanceArn"`
	EngineVersion                string            `json:"engineVersion"`
	AvailabilityZone             string            `json:"availabilityZone"`
	DBSubnetGroupName            string            `json:"dbSubnetGroupName"`
	PreferredMaintenanceWindow   string            `json:"preferredMaintenanceWindow"`
	CACertificateIdentifier      string            `json:"caCertificateIdentifier"`
	EnabledCloudwatchLogsExports []string          `json:"enabledCloudwatchLogsExports"`
	Port                         int               `json:"port"`
	PromotionTier                int               `json:"promotionTier"`
	StorageEncrypted             bool              `json:"storageEncrypted"`
	AutoMinorVersionUpgrade      bool              `json:"autoMinorVersionUpgrade"`
	PubliclyAccessible           bool              `json:"publiclyAccessible"`
	CopyTagsToSnapshot           bool              `json:"copyTagsToSnapshot"`
	// contains filtered or unexported fields
}

type DBSubnetGroup

type DBSubnetGroup struct {
	Tags                     map[string]string `json:"tags"`
	DBSubnetGroupName        string            `json:"dbSubnetGroupName"`
	DBSubnetGroupDescription string            `json:"dbSubnetGroupDescription"`
	VpcID                    string            `json:"vpcID"`
	Status                   string            `json:"status"`
	DBSubnetGroupArn         string            `json:"dbSubnetGroupArn"`
	SubnetIDs                []string          `json:"subnetIDs"`
	// contains filtered or unexported fields
}

type DeleteDBClusterOptions

type DeleteDBClusterOptions struct {
	FinalDBClusterSnapshotIdentifier string
	SkipFinalSnapshot                bool
}

DeleteDBClusterOptions holds optional parameters for DeleteDBCluster.

type EventCategoryMap

type EventCategoryMap struct {
	SourceType      string
	EventCategories []string
}

EventCategoryMap maps a source type to a list of event categories.

type EventSubscription

type EventSubscription struct {
	SubscriptionName string   `json:"subscriptionName"`
	SnsTopicARN      string   `json:"snsTopicARN"`
	Status           string   `json:"status"`
	SourceType       string   `json:"sourceType"`
	SourceIDs        []string `json:"sourceIDs"`
	EventCategories  []string `json:"eventCategories"`
	// contains filtered or unexported fields
}

type GlobalCluster

type GlobalCluster struct {
	GlobalClusterIdentifier string `json:"globalClusterIdentifier"`
	SourceDBClusterID       string `json:"sourceDBClusterID"`
	Status                  string `json:"status"`
	Engine                  string `json:"engine"`
	EngineVersion           string `json:"engineVersion"`
	GlobalClusterArn        string `json:"globalClusterArn"`
	StorageEncrypted        bool   `json:"storageEncrypted"`
	DeletionProtection      bool   `json:"deletionProtection"`
}

type Handler

type Handler struct {
	Backend *InMemoryBackend
}

Handler is the Echo HTTP handler for DocDB operations.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a new DocDB handler.

func (*Handler) ChaosOperations

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

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

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

ChaosRegions returns all regions this DocDB instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

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

func (*Handler) ExtractOperation

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

ExtractOperation extracts the DocDB action from the request.

func (*Handler) ExtractResource

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

ExtractResource returns the DB cluster identifier from the request.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns supported DocDB operations.

func (*Handler) Handler

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

Handler returns the Echo handler function.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority for DocDB (higher than RDS to intercept DocDB requests first).

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all backend state.

func (*Handler) Restore

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

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

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

RouteMatcher returns a function that matches DocDB requests.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable by delegating to the backend.

type InMemoryBackend

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

InMemoryBackend is the in-memory store for DocDB resources.

Seven resource collections that were previously nested by region (outer key = region, e.g. map[string]map[string]*DBCluster) are now each a single flat *store.Table keyed by the composite "region|id" string (see regionKey below), with a companion *store.Index grouping entries by region for per-region scans -- see store_setup.go for the full rationale. Six of the seven also have a byRegion index; snapshotAttributes does not (it is only ever looked up/written by its exact composite key, never listed by region). GlobalClusters are partition-scoped and remain a plain (non-composite-key) *store.Table. tags remains a raw nested map: its value (a bare []Tag) carries no identity of its own to key a store.Table by (see store_setup.go's doc comment for the full rationale).

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

func (*InMemoryBackend) AddDBClusterInternal

func (b *InMemoryBackend) AddDBClusterInternal(cluster *DBCluster)

AddDBClusterInternal seeds a cluster directly for testing.

func (*InMemoryBackend) AddDBClusterParameterGroupInternal

func (b *InMemoryBackend) AddDBClusterParameterGroupInternal(pg *DBClusterParameterGroup)

AddDBClusterParameterGroupInternal seeds a parameter group directly for testing.

func (*InMemoryBackend) AddDBClusterSnapshotInternal

func (b *InMemoryBackend) AddDBClusterSnapshotInternal(snap *DBClusterSnapshot)

AddDBClusterSnapshotInternal seeds a snapshot directly for testing.

func (*InMemoryBackend) AddDBInstanceInternal

func (b *InMemoryBackend) AddDBInstanceInternal(inst *DBInstance)

AddDBInstanceInternal seeds an instance directly for testing.

func (*InMemoryBackend) AddDBSubnetGroupInternal

func (b *InMemoryBackend) AddDBSubnetGroupInternal(sg *DBSubnetGroup)

AddDBSubnetGroupInternal seeds a subnet group directly for testing.

func (*InMemoryBackend) AddEventSubscriptionInternal

func (b *InMemoryBackend) AddEventSubscriptionInternal(sub *EventSubscription)

AddEventSubscriptionInternal seeds an event subscription directly for testing.

func (*InMemoryBackend) AddGlobalClusterInternal

func (b *InMemoryBackend) AddGlobalClusterInternal(gc *GlobalCluster)

AddGlobalClusterInternal seeds a global cluster directly for testing.

func (*InMemoryBackend) AddSourceIdentifierToSubscription

func (b *InMemoryBackend) AddSourceIdentifierToSubscription(
	ctx context.Context,
	subscriptionName, sourceID string,
) (*EventSubscription, error)

AddSourceIdentifierToSubscription adds a source identifier to an event subscription.

func (*InMemoryBackend) AddTagsToResource

func (b *InMemoryBackend) AddTagsToResource(ctx context.Context, arnStr string, tags []Tag) error

func (*InMemoryBackend) ApplyPendingMaintenanceAction

func (b *InMemoryBackend) ApplyPendingMaintenanceAction(
	_ context.Context,
	resourceARN, action, optInType string,
) error

ApplyPendingMaintenanceAction applies a pending maintenance action to a resource.

func (*InMemoryBackend) CopyDBClusterParameterGroup

func (b *InMemoryBackend) CopyDBClusterParameterGroup(
	ctx context.Context,
	sourceGroupName, targetName, targetDescription string,
) (*DBClusterParameterGroup, error)

CopyDBClusterParameterGroup copies a DB cluster parameter group.

func (*InMemoryBackend) CopyDBClusterSnapshot

func (b *InMemoryBackend) CopyDBClusterSnapshot(
	ctx context.Context,
	sourceSnapshotID, targetSnapshotID string,
) (*DBClusterSnapshot, error)

CopyDBClusterSnapshot copies a DB cluster snapshot.

func (*InMemoryBackend) CreateDBCluster

func (b *InMemoryBackend) CreateDBCluster(
	ctx context.Context,
	id, engine, engineVersion, masterUser, masterUserPassword, dbName, paramGroupName, subnetGroupName string,
	port int,
	storageEncrypted, deletionProtection bool,
	backupRetentionPeriod int,
	preferredBackupWindow, preferredMaintenanceWindow string,
	availabilityZones []string,
	tags map[string]string,
	opts *CreateDBClusterOptions,
) (*DBCluster, error)

func (*InMemoryBackend) CreateDBClusterParameterGroup

func (b *InMemoryBackend) CreateDBClusterParameterGroup(
	ctx context.Context,
	name, family, description string,
	tags map[string]string,
) (*DBClusterParameterGroup, error)

func (*InMemoryBackend) CreateDBClusterSnapshot

func (b *InMemoryBackend) CreateDBClusterSnapshot(
	ctx context.Context,
	snapshotID, clusterID string,
	tags map[string]string,
) (*DBClusterSnapshot, error)

func (*InMemoryBackend) CreateDBInstance

func (b *InMemoryBackend) CreateDBInstance(
	ctx context.Context,
	id, clusterID, instanceClass, engine string,
	promotionTier int,
	tags map[string]string,
	opts *CreateDBInstanceOptions,
) (*DBInstance, error)

func (*InMemoryBackend) CreateDBSubnetGroup

func (b *InMemoryBackend) CreateDBSubnetGroup(
	ctx context.Context,
	name, description, vpcID string,
	subnetIDs []string,
	tags map[string]string,
) (*DBSubnetGroup, error)

func (*InMemoryBackend) CreateEventSubscription

func (b *InMemoryBackend) CreateEventSubscription(
	ctx context.Context,
	name, snsTopicARN, sourceType string,
	eventCategories, sourceIDs []string,
) (*EventSubscription, error)

CreateEventSubscription creates an event subscription.

func (*InMemoryBackend) CreateGlobalCluster

func (b *InMemoryBackend) CreateGlobalCluster(
	_ context.Context,
	id, sourceDBClusterID, engine, engineVersion string,
) (*GlobalCluster, error)

CreateGlobalCluster creates a global cluster.

func (*InMemoryBackend) DeleteDBCluster

func (b *InMemoryBackend) DeleteDBCluster(
	ctx context.Context,
	id string,
	opts *DeleteDBClusterOptions,
) (*DBCluster, error)

func (*InMemoryBackend) DeleteDBClusterParameterGroup

func (b *InMemoryBackend) DeleteDBClusterParameterGroup(ctx context.Context, name string) error

func (*InMemoryBackend) DeleteDBClusterSnapshot

func (b *InMemoryBackend) DeleteDBClusterSnapshot(ctx context.Context, snapshotID string) (*DBClusterSnapshot, error)

func (*InMemoryBackend) DeleteDBInstance

func (b *InMemoryBackend) DeleteDBInstance(ctx context.Context, id string) (*DBInstance, error)

func (*InMemoryBackend) DeleteDBSubnetGroup

func (b *InMemoryBackend) DeleteDBSubnetGroup(ctx context.Context, name string) error

func (*InMemoryBackend) DeleteEventSubscription

func (b *InMemoryBackend) DeleteEventSubscription(ctx context.Context, name string) (*EventSubscription, error)

DeleteEventSubscription deletes an event subscription.

func (*InMemoryBackend) DeleteGlobalCluster

func (b *InMemoryBackend) DeleteGlobalCluster(_ context.Context, id string) (*GlobalCluster, error)

DeleteGlobalCluster deletes a global cluster.

func (*InMemoryBackend) DescribeCertificates

func (b *InMemoryBackend) DescribeCertificates(_ context.Context, certificateID string) []Certificate

DescribeCertificates returns certificate information.

func (*InMemoryBackend) DescribeDBClusterParameterGroups

func (b *InMemoryBackend) DescribeDBClusterParameterGroups(
	ctx context.Context,
	name string,
) ([]DBClusterParameterGroup, error)

func (*InMemoryBackend) DescribeDBClusterParameters

func (b *InMemoryBackend) DescribeDBClusterParameters(
	ctx context.Context,
	groupName string,
) ([]DBClusterParameter, error)

DescribeDBClusterParameters returns the parameters for a DB cluster parameter group.

func (*InMemoryBackend) DescribeDBClusterSnapshotAttributes

func (b *InMemoryBackend) DescribeDBClusterSnapshotAttributes(
	ctx context.Context,
	snapshotID string,
) (*DBClusterSnapshotAttributesResult, error)

DescribeDBClusterSnapshotAttributes returns attributes for a cluster snapshot.

func (*InMemoryBackend) DescribeDBClusterSnapshots

func (b *InMemoryBackend) DescribeDBClusterSnapshots(
	ctx context.Context,
	snapshotID, clusterID, snapshotType string,
) ([]DBClusterSnapshot, error)

func (*InMemoryBackend) DescribeDBClusters

func (b *InMemoryBackend) DescribeDBClusters(ctx context.Context, id string) ([]DBCluster, error)

func (*InMemoryBackend) DescribeDBEngineVersions

func (b *InMemoryBackend) DescribeDBEngineVersions(_ context.Context, engine, engineVersion string) []DBEngineVersion

DescribeDBEngineVersions returns available engine versions, optionally filtered.

func (*InMemoryBackend) DescribeDBInstances

func (b *InMemoryBackend) DescribeDBInstances(ctx context.Context, id, clusterID string) ([]DBInstance, error)

func (*InMemoryBackend) DescribeDBSubnetGroups

func (b *InMemoryBackend) DescribeDBSubnetGroups(ctx context.Context, name string) ([]DBSubnetGroup, error)

func (*InMemoryBackend) DescribeEngineDefaultClusterParameters

func (b *InMemoryBackend) DescribeEngineDefaultClusterParameters(
	_ context.Context,
	_ string,
) []DBClusterParameter

DescribeEngineDefaultClusterParameters returns the default parameters for an engine family.

func (*InMemoryBackend) DescribeEventCategories

func (b *InMemoryBackend) DescribeEventCategories(_ context.Context, sourceType string) []EventCategoryMap

DescribeEventCategories returns the event categories for DocDB.

func (*InMemoryBackend) DescribeEventSubscriptions

func (b *InMemoryBackend) DescribeEventSubscriptions(ctx context.Context, name string) []EventSubscription

DescribeEventSubscriptions returns event subscriptions, optionally filtered by name.

func (*InMemoryBackend) DescribeGlobalClusters

func (b *InMemoryBackend) DescribeGlobalClusters(_ context.Context, id string) []GlobalCluster

DescribeGlobalClusters returns global clusters, optionally filtered by ID, sorted by identifier.

func (*InMemoryBackend) DescribePendingMaintenanceActions

func (b *InMemoryBackend) DescribePendingMaintenanceActions(
	_ context.Context,
	_ string,
) []ResourcePendingMaintenanceActions

DescribePendingMaintenanceActions returns pending maintenance actions for resources. This implementation returns an empty list (in-memory emulation has no real pending actions).

func (*InMemoryBackend) FailoverDBCluster

func (b *InMemoryBackend) FailoverDBCluster(ctx context.Context, id string) (*DBCluster, error)

func (*InMemoryBackend) FailoverGlobalCluster

func (b *InMemoryBackend) FailoverGlobalCluster(_ context.Context, id, _ string) (*GlobalCluster, error)

FailoverGlobalCluster initiates a failover for a global cluster.

func (*InMemoryBackend) GetClusterMembers

func (b *InMemoryBackend) GetClusterMembers(ctx context.Context, clusterID string) []DBClusterMemberEntry

GetClusterMembers returns the instances that belong to a given cluster, ordered by identifier.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, arnStr string) []Tag

func (*InMemoryBackend) ModifyDBCluster

func (b *InMemoryBackend) ModifyDBCluster(
	ctx context.Context,
	id, paramGroupName string,
	deletionProtection *bool,
	backupRetentionPeriod int,
	preferredBackupWindow, preferredMaintenanceWindow string,
	opts *ModifyDBClusterOptions,
) (*DBCluster, error)

func (*InMemoryBackend) ModifyDBClusterParameterGroup

func (b *InMemoryBackend) ModifyDBClusterParameterGroup(
	ctx context.Context,
	name string,
	parameters map[string]string,
) (*DBClusterParameterGroup, error)

func (*InMemoryBackend) ModifyDBClusterSnapshotAttribute

func (b *InMemoryBackend) ModifyDBClusterSnapshotAttribute(
	ctx context.Context,
	snapshotID, attributeName string,
	valuesToAdd, valuesToRemove []string,
) (*DBClusterSnapshotAttributesResult, error)

func (*InMemoryBackend) ModifyDBInstance

func (b *InMemoryBackend) ModifyDBInstance(
	ctx context.Context,
	id, instanceClass string,
	autoMinorVersionUpgrade *bool,
	preferredMaintenanceWindow string,
	opts *ModifyDBInstanceOptions,
) (*DBInstance, error)

func (*InMemoryBackend) ModifyDBSubnetGroup

func (b *InMemoryBackend) ModifyDBSubnetGroup(
	ctx context.Context,
	name, description string,
	subnetIDs []string,
) (*DBSubnetGroup, error)

ModifyDBSubnetGroup modifies a DB subnet group.

func (*InMemoryBackend) ModifyEventSubscription

func (b *InMemoryBackend) ModifyEventSubscription(
	ctx context.Context,
	name, snsTopicARN, sourceType string,
	eventCategories []string,
) (*EventSubscription, error)

ModifyEventSubscription modifies an event subscription.

func (*InMemoryBackend) ModifyGlobalCluster

func (b *InMemoryBackend) ModifyGlobalCluster(
	_ context.Context,
	id, newID string,
	deletionProtection *bool,
) (*GlobalCluster, error)

ModifyGlobalCluster modifies a global cluster.

func (*InMemoryBackend) RebootDBInstance

func (b *InMemoryBackend) RebootDBInstance(ctx context.Context, id string) (*DBInstance, error)

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the backend's configured default AWS region.

func (*InMemoryBackend) RemoveFromGlobalCluster

func (b *InMemoryBackend) RemoveFromGlobalCluster(
	_ context.Context,
	globalClusterID, _ string,
) (*GlobalCluster, error)

RemoveFromGlobalCluster removes a DB cluster from a global cluster.

func (*InMemoryBackend) RemoveSourceIdentifierFromSubscription

func (b *InMemoryBackend) RemoveSourceIdentifierFromSubscription(
	ctx context.Context,
	subscriptionName, sourceID string,
) (*EventSubscription, error)

RemoveSourceIdentifierFromSubscription removes a source identifier from an event subscription.

func (*InMemoryBackend) RemoveTagsFromResource

func (b *InMemoryBackend) RemoveTagsFromResource(ctx context.Context, arnStr string, keys []string)

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all stored state, returning the backend to an empty state.

It calls b.registry.ResetAll() rather than re-registering tables: registerAllTables must run exactly once, at construction (store.Register panics on a duplicate name) -- see the doc comment on registerAllTables in store_setup.go.

func (*InMemoryBackend) ResetDBClusterParameterGroup

func (b *InMemoryBackend) ResetDBClusterParameterGroup(
	ctx context.Context,
	name string,
) (*DBClusterParameterGroup, error)

ResetDBClusterParameterGroup resets a parameter group to its default values.

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) RestoreDBClusterFromSnapshot

func (b *InMemoryBackend) RestoreDBClusterFromSnapshot(
	ctx context.Context,
	snapshotID, clusterID, engine string,
) (*DBCluster, error)

RestoreDBClusterFromSnapshot restores a new cluster from a snapshot.

func (*InMemoryBackend) RestoreDBClusterToPointInTime

func (b *InMemoryBackend) RestoreDBClusterToPointInTime(
	ctx context.Context,
	sourceClusterID, targetClusterID string,
) (*DBCluster, error)

RestoreDBClusterToPointInTime restores a new cluster to a point in time from a source cluster.

func (*InMemoryBackend) Snapshot

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

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

func (*InMemoryBackend) StartDBCluster

func (b *InMemoryBackend) StartDBCluster(ctx context.Context, id string) (*DBCluster, error)

func (*InMemoryBackend) StopDBCluster

func (b *InMemoryBackend) StopDBCluster(ctx context.Context, id string) (*DBCluster, error)

func (*InMemoryBackend) SwitchoverGlobalCluster

func (b *InMemoryBackend) SwitchoverGlobalCluster(_ context.Context, id, _ string) (*GlobalCluster, error)

SwitchoverGlobalCluster initiates a switchover for a global cluster.

type ModifyDBClusterOptions

type ModifyDBClusterOptions struct {
	EngineVersion          string
	MasterUserPassword     string
	NewDBClusterIdentifier string
	VpcSecurityGroupIDs    []string
	EnableLogsTypes        []string
	DisableLogsTypes       []string
	Port                   int
}

ModifyDBClusterOptions holds optional extra parameters for ModifyDBCluster.

type ModifyDBInstanceOptions

type ModifyDBInstanceOptions struct {
	CopyTagsToSnapshot      *bool
	PromotionTier           *int
	CACertificateIdentifier string
}

ModifyDBInstanceOptions holds optional extra parameters for ModifyDBInstance.

type PendingMaintenanceAction

type PendingMaintenanceAction struct {
	Action      string
	OptInStatus string
}

PendingMaintenanceAction describes a pending maintenance action.

type Provider

type Provider struct{}

Provider implements service.Provider for DocDB.

func (*Provider) Init

Init initializes the DocDB service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type ResourcePendingMaintenanceActions

type ResourcePendingMaintenanceActions struct {
	ResourceIdentifier string
	Actions            []PendingMaintenanceAction
}

ResourcePendingMaintenanceActions holds pending maintenance actions for a resource.

type Tag

type Tag struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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