docdb

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 48 Imported by: 0

README

DocumentDB

Parity grade: A · SDK aws-sdk-go-v2/service/docdb@v1.51.4 · last audited 2026-10-12 (6279ba35a)

Coverage

Metric Value
PARITY entries audited 55 (55 ok)
Feature families 9 (9 ok)
Known gaps 2
Structural gaps (can't be emulated) 5
Deferred items 1
Resource leaks clean
Known gaps
  • UNVERIFIABLE: MasterUserSecret.KmsKeyId stays empty when MasterUserSecretKmsKeyId is unset; ModifyDBCluster docs say only that aws/secretsmanager is used, not the KmsKeyId value AWS returns (key ARN vs alias).
  • UNVERIFIABLE: DescribeDBEngineVersions ValidUpgradeTarget (which version pairs are upgradable is not in the SDK or API reference), DescribeOrderableDBInstanceOptions LicenseModel filter (no documented value), DBCluster IOOptimizedNextAllowedModificationTime (no interval stated), CloneGroupId (no documented format), and the cluster parameters beyond audit_logs/tls/ttl_monitor (the developer guide examples list only those three with AllowedValues).
Structural gaps

These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.

  • Docker engine (--docdb-engine=docker): one mongo container per cluster (3.6/4.0 map to mongo:4.4, 5.0 to mongo:5.0), plaintext unless DOCDB_TLS=true (see the 2026-10-18 note); the master user is a mongod root user, so SCRAM-SHA-1/SCRAM-SHA-256 are enforced by mongod itself, but the cluster tls parameter does not toggle TLS per cluster; instances share the cluster container (one endpoint serves Endpoint, ReaderEndpoint and every instance), and restore-from-snapshot/PITR/persistence-restore relaunch an empty container with a random password because no data is carried.
  • DBInstance PendingModifiedValues/StatusInfos, DBCluster PercentProgress and GlobalCluster FailoverState describe async windows this backend never has: every Modify/Failover/Restore applies synchronously.
  • DBCluster AssociatedRoles: the docdb API has no role-association operation.
  • CreateDBCluster/CopyDBClusterSnapshot SourceRegion and PreSignedUrl: no cross-region copy; RebootDBInstance ForceFailover: instances have no Multi-AZ attribute; RestoreDBClusterToPointInTime copy-on-write: no shared storage layer, a full copy is made.
  • DescribeDBClusterSnapshots IncludePublic/IncludeShared: single-account emulator has no cross-account snapshots, so the filters have no observable effect.
Deferred
  • Failover/Switchover to a target that is not a member of the global cluster is a silent no-op or attaches a known local cluster as writer rather than erroring: the pinned SDK documents no error code for the case.

More

Documentation

Index

Constants

View Source
const (
	EngineStub   = "stub"
	EngineDocker = "docker"
)

Engine modes for DocDB.

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)
	// ErrClusterParameterGroupRefNotFound is the code CreateDBCluster/ModifyDBCluster declare for a bad group name.
	ErrClusterParameterGroupRefNotFound   = awserr.New("DBClusterParameterGroupNotFound", 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)
	ErrInvalidParameterCombination    = awserr.New("InvalidParameterCombination", awserr.ErrInvalidParameter)
	ErrNetworkTypeNotSupported        = awserr.New("NetworkTypeNotSupported", awserr.ErrInvalidParameter)
	ErrUnknownAction                  = awserr.New("InvalidAction", awserr.ErrInvalidParameter)
	ErrInvalidClusterState            = awserr.New("InvalidDBClusterStateFault", awserr.ErrInvalidParameter)
	ErrInvalidInstanceState           = awserr.New("InvalidDBInstanceState", awserr.ErrInvalidParameter)
	ErrInvalidGlobalClusterState      = awserr.New("InvalidGlobalClusterStateFault", 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
	CertificateArn        string
	Thumbprint            string
	ValidFrom             string
	ValidTill             string
}

type ClusterExtras

type ClusterExtras struct {
	Scaling     *ServerlessV2Scaling
	NetworkType string
}

ClusterExtras holds the NetworkType and serverless scaling inputs shared by the cluster create, modify and restore operations.

type CreateDBClusterOptions

type CreateDBClusterOptions struct {
	ClusterExtras
	MasterSecretRequest
	GlobalClusterIdentifier      string
	KmsKeyID                     string
	StorageType                  string
	VpcSecurityGroupIDs          []string
	EnabledCloudwatchLogsExports []string
}

CreateDBClusterOptions holds optional parameters for CreateDBCluster.

type CreateDBInstanceOptions

type CreateDBInstanceOptions struct {
	CACertificateIdentifier     string
	PerformanceInsightsKMSKeyID string
	CopyTagsToSnapshot          bool
	EnablePerformanceInsights   bool
}

CreateDBInstanceOptions holds optional parameters for CreateDBInstance.

type CreateGlobalClusterOptions

type CreateGlobalClusterOptions struct {
	DeletionProtection *bool
	StorageEncrypted   *bool
	DatabaseName       string
}

CreateGlobalClusterOptions carries CreateGlobalCluster's optional members.

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"`
	DBClusterParameterGroupName string               `json:"dbClusterParameterGroupName"`
	Endpoint                    string               `json:"endpoint"`
	DBClusterIdentifier         string               `json:"dbClusterIdentifier"`
	ReaderEndpoint              string               `json:"readerEndpoint"`
	Status                      string               `json:"status"`
	StorageType                 string               `json:"storageType"`
	DBSubnetGroupName           string               `json:"dbSubnetGroupName"`
	PreferredBackupWindow       string               `json:"preferredBackupWindow"`
	ClusterCreateTime           string               `json:"clusterCreateTime"`
	HostedZoneID                string               `json:"hostedZoneId"`
	KmsKeyID                    string               `json:"kmsKeyId"`
	ReplicationSourceIdentifier string               `json:"replicationSourceIdentifier"`
	DBClusterResourceID         string               `json:"dbClusterResourceId,omitempty"`
	NetworkType                 string               `json:"networkType,omitempty"`
	MasterUserSecretARN         string               `json:"masterUserSecretArn,omitempty"`
	MasterUserSecretStatus      string               `json:"masterUserSecretStatus,omitempty"`
	MasterUserSecretKmsKeyID    string               `json:"masterUserSecretKmsKeyId,omitempty"`
	ServerlessV2Scaling         *ServerlessV2Scaling `json:"serverlessV2Scaling,omitempty"`
	// WriterInstanceID names the cluster member FailoverDBCluster last
	// promoted to writer; empty means GetClusterMembers falls back to its
	// default (alphabetically first member). Backend-internal state, never
	// itself on the wire -- only reflected via DBClusterMembers.IsClusterWriter.
	WriterInstanceID             string   `json:"writerInstanceId"`
	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"`
	// contains filtered or unexported fields
}

type DBClusterMemberEntry

type DBClusterMemberEntry struct {
	DBInstanceIdentifier string
	ParameterGroupStatus 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
	AllowedValues  string
	Source         string
	ApplyType      string
	ApplyMethod    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"`
	SnapshotType        string            `json:"snapshotType"`
	SnapshotCreateTime  string            `json:"snapshotCreateTime"`
	DBClusterIdentifier string            `json:"dbClusterIdentifier"`

	DBClusterSnapshotArn        string   `json:"dbClusterSnapshotArn"`
	SourceDBClusterSnapshotArn  string   `json:"sourceDBClusterSnapshotArn"`
	Engine                      string   `json:"engine"`
	Status                      string   `json:"status"`
	DBClusterSnapshotIdentifier string   `json:"dbClusterSnapshotIdentifier"`
	EngineVersion               string   `json:"engineVersion"`
	DBClusterArn                string   `json:"dbClusterArn"`
	ClusterCreateTime           string   `json:"clusterCreateTime"`
	KmsKeyID                    string   `json:"kmsKeyId"`
	MasterUsername              string   `json:"masterUsername"`
	StorageType                 string   `json:"storageType,omitempty"`
	VpcID                       string   `json:"vpcID,omitempty"`
	AvailabilityZones           []string `json:"availabilityZones"`
	Port                        int      `json:"port"`
	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
	ExportableLogTypes  []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"`
	InstanceCreateTime           string            `json:"instanceCreateTime"`
	PerformanceInsightsKMSKeyID  string            `json:"performanceInsightsKMSKeyId"`
	DbiResourceID                string            `json:"dbiResourceId,omitempty"`
	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"`
	PerformanceInsightsEnabled   bool              `json:"performanceInsightsEnabled"`
	ParameterPendingReboot       bool              `json:"parameterPendingReboot,omitempty"`
	// 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"`
	SupportedNetworkTypes    []string          `json:"-"`
	Status                   string            `json:"status"`
	DBSubnetGroupArn         string            `json:"dbSubnetGroupArn"`
	SubnetIDs                []string          `json:"subnetIDs"`
	// contains filtered or unexported fields
}

type DeleteDBClusterOptions

type DeleteDBClusterOptions struct {
	FinalDBSnapshotIdentifier string
	SkipFinalSnapshot         bool
}

DeleteDBClusterOptions holds optional parameters for DeleteDBCluster.

type EngineConfig

type EngineConfig struct {
	Runtime      EngineRuntime
	Ports        *portalloc.Allocator
	Probe        func(ctx context.Context, addr string) error
	SetPassword  func(ctx context.Context, change PasswordChange) error
	Host         string
	StartTimeout time.Duration
	TLS          bool
}

EngineConfig configures docker-backed DocDB clusters.

type EngineModeConfig

type EngineModeConfig interface {
	GetDocDBEngine() string
}

EngineModeConfig exposes the DocDB engine mode (stub or docker).

type EngineRuntime

type EngineRuntime interface {
	CreateAndStart(ctx context.Context, spec container.Spec) (string, error)
	StopAndRemove(ctx context.Context, containerID string) error
	StopContainer(ctx context.Context, containerID string) error
	StartContainer(ctx context.Context, containerID string) error
	Exec(ctx context.Context, containerID string, cmd []string) (container.ExecResult, error)
}

EngineRuntime is the slice of the container runtime the MongoDB engine needs.

type Event added in v1.2.0

type Event struct {
	SourceIdentifier string   `json:"sourceIdentifier"`
	SourceType       string   `json:"sourceType"`
	Message          string   `json:"message"`
	SourceArn        string   `json:"sourceArn"`
	Date             string   `json:"date"`
	EventCategories  []string `json:"eventCategories"`
}

Event represents a single DocDB account-activity event (types.Event: Date/EventCategories/Message/SourceArn/SourceIdentifier/SourceType). It backs the real event log fed by recordEvent (events.go) from the key cluster/instance/snapshot lifecycle mutators.

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"`
	EventSubscriptionArn     string   `json:"eventSubscriptionArn"`
	CustomerAwsID            string   `json:"customerAwsID"`
	SubscriptionCreationTime string   `json:"subscriptionCreationTime"`
	SourceIDs                []string `json:"sourceIDs"`
	EventCategories          []string `json:"eventCategories"`
	Enabled                  bool     `json:"enabled"`
	// contains filtered or unexported fields
}

type EventsFilter added in v1.2.0

type EventsFilter struct {
	SourceIdentifier string
	SourceType       string
	StartTime        string
	EndTime          string
	EventCategories  []string
	Duration         int
}

EventsFilter holds the filter values DescribeEvents accepts (DescribeEventsInput: SourceIdentifier/SourceType/StartTime/EndTime/ Duration/EventCategories -- Filters is documented "not currently supported" by AWS itself, so it is intentionally not modeled here).

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"`
	DatabaseName            string                `json:"databaseName,omitempty"`
	GlobalClusterResourceID string                `json:"globalClusterResourceId,omitempty"`
	GlobalClusterMembers    []GlobalClusterMember `json:"globalClusterMembers"`
	StorageEncrypted        bool                  `json:"storageEncrypted"`
	DeletionProtection      bool                  `json:"deletionProtection"`
}

type GlobalClusterMember added in v1.2.0

type GlobalClusterMember struct {
	DBClusterArn          string   `json:"dbClusterArn"`
	SynchronizationStatus string   `json:"synchronizationStatus"`
	Readers               []string `json:"readers"`
	IsWriter              bool     `json:"isWriter"`
}

GlobalClusterMember represents a single DB cluster's membership in a global cluster (types.GlobalClusterMember: DBClusterArn/IsWriter/Readers/ SynchronizationStatus).

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

func (h *Handler) Shutdown(_ context.Context)

Shutdown removes every cluster container.

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) AddPendingMaintenanceActionInternal added in v1.2.0

func (b *InMemoryBackend) AddPendingMaintenanceActionInternal(
	resourceARN, action, description string,
) *PendingMaintenanceAction

AddPendingMaintenanceActionInternal queues a maintenance action for a resource, bypassing normal validation. Used for seeding tests.

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,
) (*ResourcePendingMaintenanceActions, error)

ApplyPendingMaintenanceAction applies (or opts in/out of) a queued maintenance action for a resource, returning that resource's current full set of pending actions -- matching AWS's ApplyPendingMaintenanceActionOutput, which always echoes ResourcePendingMaintenanceActions rather than just the one action touched. Calling Apply for a resource/action combination that was never queued (nothing was ever seeded/became eligible) is not an error -- it mirrors AWS's own opt-in semantics, where opting into a maintenance action that doesn't currently apply to the resource is a harmless no-op -- so it simply returns whatever (possibly empty) pending-action set the resource already has.

func (*InMemoryBackend) Close

func (b *InMemoryBackend) Close()

Close removes every cluster container and waits for in-flight work to finish.

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,
	tags map[string]string,
	copyTagsFromSource bool,
) (*DBClusterSnapshot, error)

CopyDBClusterSnapshot copies a DB cluster snapshot. tags is the target's own explicit "Tags" request member; copyTagsFromSource mirrors the request's "CopyTags" flag ("Set to true to copy all tags from the source cluster snapshot to the target cluster snapshot", CopyDBClusterSnapshotInput doc comment). Neither was read from the request at all before this fix, so a real client's CopyTags=true/Tags request was silently a no-op. The SDK doc comment doesn't state a precedence rule for tags+CopyTags used together, so this takes the more-specific explicit tags when given and falls back to the source's tags only when tags is empty -- an interpretation, not a confirmed AWS rule.

func (*InMemoryBackend) CreateDBCluster

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

CreateDBCluster creates a cluster. The unnamed string parameter between masterUserPassword and paramGroupName is a deliberately ignored database-name slot, kept only to hold this exported method's positional signature stable for call sites outside this package; docdb's real CreateDBClusterInput has no DatabaseName member at all (verified against docdb@v1.51.4, gopherstack-xou3), so the value is never read from the wire and never stored -- see handleCreateDBCluster, which no longer parses it.

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,
	enabled *bool,
	tags map[string]string,
) (*EventSubscription, error)

CreateEventSubscription creates an event subscription. enabled mirrors CreateEventSubscriptionInput.Enabled (a real request field this backend previously dropped on the floor -- never parsed by the handler, never stored, never echoed back); when the caller doesn't specify it, AWS activates new subscriptions by default, so a nil enabled defaults to true.

func (*InMemoryBackend) CreateGlobalCluster

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

CreateGlobalCluster creates a global cluster. When sourceDBClusterID resolves to a real cluster in the caller's region, it is added as the initial (and, per AWS's current one-item limit, sole) writer member.

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(ctx context.Context, id string) (*GlobalCluster, error)

DeleteGlobalCluster deletes a global cluster.

func (*InMemoryBackend) DescribeCertificates

func (b *InMemoryBackend) DescribeCertificates(ctx 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, source 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,
	defaultOnly bool,
) []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, error)

DescribeEventSubscriptions returns event subscriptions, optionally filtered by name. Real AWS's DescribeEventSubscriptions declares SubscriptionNotFoundFault (deserializers.go's awsAwsquery_deserializeOpErrorDescribeEventSubscriptions, docdb@v1.51.4) for an unmatched SubscriptionName -- unlike ListLocations-style ops that treat an unmatched filter as an empty result, this one hard-fails.

func (*InMemoryBackend) DescribeEvents added in v1.2.0

func (b *InMemoryBackend) DescribeEvents(ctx context.Context, filter EventsFilter) []Event

DescribeEvents returns the account activity events recorded for the request's region, filtered per filter. Matches AWS's default lookback window (Duration minutes, default 60) when no explicit StartTime is given.

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, resourceARN string,
) []ResourcePendingMaintenanceActions

DescribePendingMaintenanceActions returns the pending maintenance actions for every resource that has at least one queued (resourceARN, when non-empty, restricts results to a single resource ARN, matching DescribePendingMaintenanceActionsInput.ResourceIdentifier) -- AWS never includes a ResourcePendingMaintenanceActions entry with an empty PendingMaintenanceActionDetails list.

func (*InMemoryBackend) EnableEngine

func (b *InMemoryBackend) EnableEngine(cfg EngineConfig)

EnableEngine switches the backend to docker mode: each cluster gets a real MongoDB container.

func (*InMemoryBackend) FailoverDBCluster

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

func (*InMemoryBackend) FailoverGlobalCluster

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

FailoverGlobalCluster initiates a failover for a global cluster, promoting targetDBClusterID to the new writer -- see promoteGlobalClusterWriter.

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) HasTaggableResource added in v1.2.0

func (b *InMemoryBackend) HasTaggableResource(ctx context.Context, arnStr string) bool

HasTaggableResource reports whether arnStr refers to a resource DocDB actually stores, resolving the region from the ARN (falling back to ctx) exactly as AddTagsToResource does. AddTagsToResource/RemoveTagsFromResource above do not themselves validate that an ARN corresponds to a real resource -- they accept and store tags for any ARN, matching this backend's existing permissive semantics -- so this exists solely for cross-service tagging (resourcegroupstaggingapi, wired in cli.go's wireTaggingDocDB): every DocumentDB resource kind builds its ARN under the "rds" ARN service (clusterARN, instanceARN, subnetGroupARN, clusterParameterGroupARN, clusterSnapshotARN, globalClusterARN, and eventSubscriptionARN in store.go:232-266), the same service segment the separate RDS backend claims, so ownership must be checked explicitly before a cross-service TagResources call is allowed to claim an ARN that might really belong to RDS.

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,
	enabled *bool,
) (*EventSubscription, error)

ModifyEventSubscription modifies an event subscription. enabled mirrors ModifyEventSubscriptionInput.Enabled -- nil means the caller didn't specify it (leave the existing value alone), matching this backend's existing convention for other optional-bool fields (see e.g. ModifyDBCluster's deletionProtection *bool).

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(
	ctx context.Context,
	globalClusterID, dbClusterID string,
) (*GlobalCluster, error)

RemoveFromGlobalCluster removes a DB cluster from a global cluster, deleting the member entry whose ARN matches dbClusterID (accepted as either an ARN or a bare identifier, resolved the same way as Failover/ Switchover's target).

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,
	resetAll bool,
	paramNames []string,
) (*DBClusterParameterGroup, error)

ResetDBClusterParameterGroup resets a parameter group to its default values: when resetAll is true, every user override is discarded (the whole group reverts to engine defaults); otherwise only the overrides named in paramNames are discarded, leaving the rest untouched. This previously validated the group and returned an unchanged clone without ever touching pg.Parameters -- a disguised no-op that made ResetDBClusterParameterGroup silently do nothing regardless of what a real caller asked to reset (real AWS's own doc comment: "To reset the entire cluster parameter group, specify ... ResetAllParameters. To reset specific parameters, submit a list of ... ParameterName").

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,
	opts *RestoreDBClusterOptions,
) (*DBCluster, error)

RestoreDBClusterFromSnapshot restores a new cluster from a snapshot.

func (*InMemoryBackend) RestoreDBClusterToPointInTime

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

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

func (*InMemoryBackend) SetLifecycleDelay

func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)

SetLifecycleDelay sets how long newly created clusters and instances report "creating" before "available". Zero (the default) settles instantly.

func (*InMemoryBackend) SetSecretsStore

func (b *InMemoryBackend) SetSecretsStore(s SecretsStore)

SetSecretsStore wires the Secrets Manager accessor used for ManageMasterUserPassword.

func (*InMemoryBackend) SetSubnetResolver

func (b *InMemoryBackend) SetSubnetResolver(r SubnetResolver)

SetSubnetResolver wires the EC2 lookup used for subnet-group VpcId and SupportedNetworkTypes.

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(
	ctx context.Context, id, targetDBClusterID string,
) (*GlobalCluster, error)

SwitchoverGlobalCluster initiates a switchover for a global cluster, promoting targetDBClusterID the same way FailoverGlobalCluster does -- the two AWS operations differ in data-loss guarantees (switchover is graceful, failover is not), a distinction this synchronous in-memory backend has no failure window to model, so both perform the same real member promotion.

func (*InMemoryBackend) TLSCAPEM

func (b *InMemoryBackend) TLSCAPEM() []byte

TLSCAPEM returns the CA certificate (PEM) that signs the docker engine's mongod certificates, or nil when TLS is off; clients pass it as tlsCAFile.

func (*InMemoryBackend) TaggedResources added in v1.2.0

func (b *InMemoryBackend) TaggedResources() []TaggedEntry

TaggedResources returns every DocDB resource ARN, across all regions, that currently has at least one tag.

type MasterSecretRequest

type MasterSecretRequest struct {
	MasterUserSecretKmsKeyID string
	ManageMasterUserPassword bool
	ManageSet                bool
	RotateMasterUserPassword bool
}

MasterSecretRequest carries ManageMasterUserPassword and MasterUserSecretKmsKeyId.

type ModifyDBClusterOptions

type ModifyDBClusterOptions struct {
	ClusterExtras
	MasterSecretRequest
	EngineVersion          string
	MasterUserPassword     string
	NewDBClusterIdentifier string
	StorageType            string
	VpcSecurityGroupIDs    []string
	EnableLogsTypes        []string
	DisableLogsTypes       []string
	Port                   int
	// ApplyImmediately is read for wire-declaration parity but this backend
	// applies every ModifyDBCluster change immediately regardless of its
	// value -- same disclosed simplification as rds's ModifyDBCluster (see
	// services/rds/handler_db_clusters.go), no deferred/pending-reboot state
	// is modeled here either.
	ApplyImmediately         bool
	AllowMajorVersionUpgrade bool
}

ModifyDBClusterOptions holds optional extra parameters for ModifyDBCluster.

type ModifyDBInstanceOptions

type ModifyDBInstanceOptions struct {
	CopyTagsToSnapshot          *bool
	EnablePerformanceInsights   *bool
	PromotionTier               *int
	CACertificateIdentifier     string
	NewDBInstanceIdentifier     string
	PerformanceInsightsKMSKeyID string
	// ApplyImmediately and CertificateRotationRestart are read for
	// wire-declaration parity but this backend applies every ModifyDBInstance
	// change immediately regardless of their values -- same disclosed
	// simplification as ModifyDBClusterOptions.ApplyImmediately above; no
	// deferred/pending-reboot state is modeled.
	ApplyImmediately           bool
	CertificateRotationRestart bool
}

ModifyDBInstanceOptions holds optional extra parameters for ModifyDBInstance.

type PasswordChange

type PasswordChange struct {
	ContainerID string
	Version     string
	User        string
	OldPassword string
	NewPassword string
	// TLSCAFile is the in-container CA path the shell must trust; empty when the cluster is plaintext.
	TLSCAFile string
}

PasswordChange describes a master password change inside a running MongoDB container.

type PendingMaintenanceAction

type PendingMaintenanceAction struct {
	Action               string
	Description          string
	OptInStatus          string
	AutoAppliedAfterDate string
	CurrentApplyDate     string
	ForcedApplyDate      string
}

PendingMaintenanceAction describes a pending maintenance action (types.PendingMaintenanceAction: Action/AutoAppliedAfterDate/ CurrentApplyDate/Description/ForcedApplyDate/OptInStatus).

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 RestoreDBClusterOptions

type RestoreDBClusterOptions struct {
	ClusterExtras
	StorageType string
	// RestoreToTime and UseLatestRestorableTime are mutually exclusive per
	// docdb@v1.51.4 api_op_RestoreDBClusterToPointInTime.go:127-134 ("Must be
	// specified if the UseLatestRestorableTime parameter is not provided" /
	// "Cannot be specified if the UseLatestRestorableTime parameter is
	// true"); RestoreDBClusterFromSnapshot never reads these two.
	RestoreToTime           string
	RestoreType             string
	UseLatestRestorableTime bool
}

RestoreDBClusterOptions holds optional extra parameters shared by the restore-a-new-cluster operations (RestoreDBClusterFromSnapshot, RestoreDBClusterToPointInTime).

type SecretsStore

type SecretsStore interface {
	CreateManagedSecret(region, name, kmsKeyID, secretString string) (string, error)
	PutManagedSecretValue(region, secretARN, secretString string) error
	DeleteManagedSecret(region, secretARN string) error
}

SecretsStore creates and removes the Secrets Manager secrets behind managed master passwords.

type ServerlessV2Scaling

type ServerlessV2Scaling struct {
	MinCapacity *float64 `json:"minCapacity,omitempty"`
	MaxCapacity *float64 `json:"maxCapacity,omitempty"`
}

ServerlessV2Scaling mirrors the SDK's ServerlessV2ScalingConfiguration (DCUs).

type SubnetResolver

type SubnetResolver interface {
	// SubnetNetwork returns the subnet's VPC and whether it has both IPv4 and IPv6 CIDRs; found is false for an
	// unknown subnet.
	SubnetNetwork(id string) (vpcID string, dual, found bool)
}

SubnetResolver looks up the EC2 subnets behind a DB subnet group.

type Tag

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

type TaggedEntry added in v1.2.0

type TaggedEntry struct {
	Tags map[string]string
	ARN  string
}

TaggedEntry pairs a resource ARN with its tag map, for cross-service tag enumeration by the Resource Groups Tagging API (see cli.go's wireTaggingDocDB). DocDB keeps tags in a region-nested, flat ARN-keyed map (b.tags[region]arn) covering every resource kind it supports, so this is a walk of that map across every observed region rather than one per-kind loop.

Jump to

Keyboard shortcuts

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