dms

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 22 Imported by: 0

README

Database Migration Service

Parity grade: A · SDK aws-sdk-go-v2/service/databasemigrationservice@v1.61.8 · last audited 2026-07-12 (d13e2307f4f1086d83076beb50c1303761fa8369)

Coverage

Operations audited 68 (66 ok, 2 partial)
Known gaps 4
Deferred items 3
Resource leaks clean
Known gaps
  • DescribeMetadataModel returns an empty {} instead of the real {Definition, MetadataModelName} shape (low-value SCT-adjacent feature; would require modeling schema-conversion SQL text, not attempted this pass).
  • ReloadReplicationTables / ReloadTables do not validate ReplicationTaskArn exists (would 404 on real AWS); currently accept any ARN silently.
  • CreateEndpoint / ModifyEndpoint do not validate EndpointType (source|target) or EngineName against AWS's enum list; accepts arbitrary strings.
  • ApplyPendingMaintenanceAction accepts ApplyAction/OptInType but never tracks a real pending-maintenance-action list (DescribePendingMaintenanceActions always returns empty), so apply is a true no-op on top of an always-empty list -- self-consistent but not a full emulation.
Deferred
  • DescribeMetadataModel{Assessments,Children,Conversions,Creations,ExportsAsScript,ExportsToTarget,Imports} -- read paths for metadata-model family verified at a high level (backed by real metadataModelRequests table) but not exhaustively wire-checked field-by-field against types.go.
  • Fleet Advisor Lsa Analysis / SchemaObjectSummary / Schemas describe ops -- static/empty responses, not deep-audited (AWS EOL'd 2026-05-20).
  • DescribeApplicableIndividualAssessments / DescribeReplicationTaskIndividualAssessments / DescribeReplicationTaskAssessmentResults -- always-empty lists; the assessment-run lifecycle (Start/Cancel/Delete/DescribeReplicationTaskAssessmentRuns) is real and persisted, but the results of an assessment run are never populated. Low value: assessments are informational pre-migration checks, not stateful resources Terraform/SDKs poll for correctness.

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a requested DMS resource cannot be found.
	ErrNotFound = awserr.New("ResourceNotFoundFault", awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a DMS resource already exists.
	ErrAlreadyExists = awserr.New("ResourceAlreadyExistsFault", awserr.ErrConflict)
	// ErrInvalidState is returned when a DMS resource is in an invalid state for the requested operation.
	ErrInvalidState = awserr.New("InvalidResourceStateFault", awserr.ErrInvalidParameter)
	// ErrValidation is returned when input validation fails.
	ErrValidation = awserr.New("ValidationException", awserr.ErrInvalidParameter)
)
View Source
var ErrNilAppContext = errors.New("DMS provider: nil AppContext")

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

Functions

This section is empty.

Types

type AssessmentRun

type AssessmentRun struct {
	ReplicationTaskAssessmentRunArn string
	ReplicationTaskArn              string
	AssessmentRunName               string
	Status                          string
	Region                          string
}

AssessmentRun represents a DMS pre-migration assessment run.

Region supports Phase 3.3's store.Table keying (see store_setup.go) -- AssessmentRun carries no other region-derived field, so the value needs its own copy to serve as a pure store.Table/store.Index key input.

type Certificate

type Certificate struct {
	CertificateIdentifier string
	CertificateArn        string
	CertificatePem        string
	AccountID             string
	Region                string
}

Certificate represents a DMS certificate.

type Connection

type Connection struct {
	ReplicationInstanceArn        string
	ReplicationInstanceIdentifier string
	EndpointArn                   string
	EndpointIdentifier            string
	Status                        string
	LastFailureMessage            string
	Region                        string
}

Connection represents a DMS connection between a replication instance and an endpoint.

Region supports Phase 3.3's store.Table keying (see store_setup.go) -- Connection carries no other region-derived field, so the value needs its own copy to serve as a pure store.Table/store.Index key input.

type DataMigration

type DataMigration struct {
	CreationTime         time.Time  `json:"creationTime"`
	Tags                 *tags.Tags `json:"-"`
	DataMigrationName    string     `json:"dataMigrationName"`
	DataMigrationArn     string     `json:"dataMigrationArn"`
	MigrationProjectArn  string     `json:"migrationProjectArn"`
	DataMigrationType    string     `json:"dataMigrationType"`
	ServiceAccessRoleArn string     `json:"serviceAccessRoleArn"`
	DataMigrationStatus  string     `json:"dataMigrationStatus"`
	AccountID            string     `json:"accountId"`
	Region               string     `json:"region"`
	SelectionRules       string     `json:"selectionRules,omitempty"`
	NumberOfJobs         int32      `json:"numberOfJobs"`
	EnableCloudwatchLogs bool       `json:"enableCloudwatchLogs"`
}

DataMigration represents an AWS DMS data migration.

type DataProvider

type DataProvider struct {
	CreationTime     time.Time  `json:"creationTime"`
	Tags             *tags.Tags `json:"-"`
	DataProviderName string     `json:"dataProviderName"`
	DataProviderArn  string     `json:"dataProviderArn"`
	Engine           string     `json:"engine"`
	Description      string     `json:"description,omitempty"`
	AccountID        string     `json:"accountId"`
	Region           string     `json:"region"`
}

DataProvider represents an AWS DMS data provider.

type Endpoint

type Endpoint struct {
	CreationTime       time.Time  `json:"creationTime"`
	Tags               *tags.Tags `json:"-"`
	EndpointIdentifier string     `json:"endpointIdentifier"`
	EndpointArn        string     `json:"endpointArn"`
	EndpointType       string     `json:"endpointType"`
	EngineName         string     `json:"engineName"`
	ServerName         string     `json:"serverName,omitempty"`
	DatabaseName       string     `json:"databaseName,omitempty"`
	Username           string     `json:"username,omitempty"`
	Status             string     `json:"status"`
	AccountID          string     `json:"accountId"`
	Region             string     `json:"region"`
	Port               int32      `json:"port,omitempty"`
}

Endpoint represents an AWS DMS endpoint.

The Tags field is backend-owned. Callers must treat the returned pointer as read-only; mutate tags only via AddTagsToResource or CreateEndpoint.

type Event

type Event struct {
	SourceIdentifier string
	SourceType       string
	Message          string
	Date             string
	EventCategories  []string
}

Event records an operational event emitted by a DMS resource.

type EventSubscription

type EventSubscription struct {
	CreationTime     time.Time  `json:"creationTime"`
	Tags             *tags.Tags `json:"-"`
	SubscriptionName string     `json:"subscriptionName"`
	SnsTopicArn      string     `json:"snsTopicArn"`
	SourceType       string     `json:"sourceType,omitempty"`
	Status           string     `json:"status"`
	AccountID        string     `json:"accountId"`
	Region           string     `json:"region"`
	SourceIDsList    []string   `json:"sourceIdsList,omitempty"`
	EventCategories  []string   `json:"eventCategories,omitempty"`
	Enabled          bool       `json:"enabled"`
}

EventSubscription represents an AWS DMS event notification subscription.

type FleetAdvisorCollector

type FleetAdvisorCollector struct {
	CreatedDate           time.Time  `json:"createdDate"`
	Tags                  *tags.Tags `json:"-"`
	CollectorName         string     `json:"collectorName"`
	CollectorReferencedID string     `json:"collectorReferencedId"`
	CollectorVersion      string     `json:"collectorVersion"`
	Description           string     `json:"description,omitempty"`
	ServiceAccessRoleArn  string     `json:"serviceAccessRoleArn"`
	S3BucketName          string     `json:"s3BucketName"`
	CollectorHealthCheck  string     `json:"collectorHealthCheck"`
	LastDataReceived      string     `json:"lastDataReceived,omitempty"`
	RegisteredDate        string     `json:"registeredDate,omitempty"`
	ModifiedDate          string     `json:"modifiedDate,omitempty"`
	AccountID             string     `json:"accountId"`
	Region                string     `json:"region"`
}

FleetAdvisorCollector represents an AWS DMS Fleet Advisor collector.

type FleetAdvisorDatabase

type FleetAdvisorDatabase struct {
	DatabaseID            string
	DatabaseName          string
	IPAddress             string
	EngineName            string
	CollectorReferencedID string
	Region                string
}

FleetAdvisorDatabase is a database discovered by a Fleet Advisor collector.

Region supports Phase 3.3's store.Table keying (see store_setup.go) -- FleetAdvisorDatabase carries no other region-derived field, so the value needs its own copy to serve as a pure store.Table/store.Index key input.

type Handler

type Handler struct {
	Backend *InMemoryBackend
	// contains filtered or unexported fields
}

Handler is the Echo HTTP handler for AWS DMS operations (JSON protocol).

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a new DMS 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 DMS 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 DMS operation name from the X-Amz-Target header.

func (*Handler) ExtractResource

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

ExtractResource extracts the primary resource identifier from the request body.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns the list of supported DMS operations, sorted alphabetically for deterministic output.

func (*Handler) Handler

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

Handler returns the Echo handler function for DMS requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset delegates to the backend Reset, clearing all in-memory 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 AWS DMS 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 AWS DMS resources.

Every named resource collection is a *store.Table[T] keyed by a composite "<region>|<identifier-or-ARN>" primary key (see store_setup.go's [regionKey]), so that same-named resources stay isolated across regions exactly as the pre-Phase-3.3 per-region nested maps did. ByARN/ByID lookups and region-scoped listing go through the accompanying *store.Index[T] fields. Callers must hold b.mu while accessing any table or index.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory DMS backend.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the AWS account ID this backend is configured for.

func (*InMemoryBackend) AddDataMigrationInternal

func (b *InMemoryBackend) AddDataMigrationInternal(name, migrationType string)

AddDataMigrationInternal seeds a data migration directly without HTTP.

func (*InMemoryBackend) AddDataProviderInternal

func (b *InMemoryBackend) AddDataProviderInternal(name, engine string)

AddDataProviderInternal seeds a data provider directly without HTTP.

func (*InMemoryBackend) AddEndpointInternal

func (b *InMemoryBackend) AddEndpointInternal(identifier, endpointType, engineName string)

AddEndpointInternal seeds an endpoint directly without HTTP.

func (*InMemoryBackend) AddEventSubscriptionInternal

func (b *InMemoryBackend) AddEventSubscriptionInternal(name, snsTopicArn string)

AddEventSubscriptionInternal seeds an event subscription directly without HTTP.

func (*InMemoryBackend) AddFleetAdvisorCollectorInternal

func (b *InMemoryBackend) AddFleetAdvisorCollectorInternal(name string)

AddFleetAdvisorCollectorInternal seeds a Fleet Advisor collector directly without HTTP.

func (*InMemoryBackend) AddInstanceProfileInternal

func (b *InMemoryBackend) AddInstanceProfileInternal(name string)

AddInstanceProfileInternal seeds an instance profile directly without HTTP.

func (*InMemoryBackend) AddReplicationInstanceInternal

func (b *InMemoryBackend) AddReplicationInstanceInternal(identifier, class string)

AddReplicationInstanceInternal seeds a replication instance directly without HTTP.

func (*InMemoryBackend) AddReplicationTaskInternal

func (b *InMemoryBackend) AddReplicationTaskInternal(
	identifier, srcARN, tgtARN, instARN, migrationType string,
)

AddReplicationTaskInternal seeds a replication task directly without HTTP.

func (*InMemoryBackend) AddTagsToResource

func (b *InMemoryBackend) AddTagsToResource(ctx context.Context, resourceArn string, kv map[string]string) error

AddTagsToResource adds tags to a DMS resource by ARN.

func (*InMemoryBackend) ApplyPendingMaintenanceAction

func (b *InMemoryBackend) ApplyPendingMaintenanceAction(
	ctx context.Context,
	replicationInstanceArn, applyAction, optInType string,
) (*ReplicationInstance, error)

ApplyPendingMaintenanceAction applies a pending maintenance action to a replication instance.

func (*InMemoryBackend) BatchStartRecommendations

func (b *InMemoryBackend) BatchStartRecommendations(ctx context.Context) error

BatchStartRecommendations starts the analysis to generate recommendations. In-memory: always returns an empty error list (all successful). BatchStartRecommendations seeds target-engine recommendations based on existing source endpoints.

func (*InMemoryBackend) CancelMetadataModelConversion

func (b *InMemoryBackend) CancelMetadataModelConversion(
	ctx context.Context,
	migrationProjectIdentifier, requestIdentifier string,
) (string, error)

CancelMetadataModelConversion cancels a pending metadata model conversion task.

func (*InMemoryBackend) CancelMetadataModelCreation

func (b *InMemoryBackend) CancelMetadataModelCreation(
	ctx context.Context,
	migrationProjectIdentifier, requestIdentifier string,
) (string, error)

CancelMetadataModelCreation cancels a pending metadata model creation task.

func (*InMemoryBackend) CancelReplicationTaskAssessmentRun

func (b *InMemoryBackend) CancelReplicationTaskAssessmentRun(
	ctx context.Context,
	replicationTaskAssessmentRunArn string,
) error

CancelReplicationTaskAssessmentRun cancels a single premigration assessment run.

func (*InMemoryBackend) CreateDataMigration

func (b *InMemoryBackend) CreateDataMigration(
	ctx context.Context,
	name, migrationProjectArn, migrationType, serviceAccessRoleArn, selectionRules string,
	numberOfJobs int32,
	enableCloudwatchLogs bool,
	kv map[string]string,
) (*DataMigration, error)

CreateDataMigration creates a new data migration.

func (*InMemoryBackend) CreateDataProvider

func (b *InMemoryBackend) CreateDataProvider(
	ctx context.Context,
	name, engine, description string,
	kv map[string]string,
) (*DataProvider, error)

CreateDataProvider creates a new data provider.

func (*InMemoryBackend) CreateEndpoint

func (b *InMemoryBackend) CreateEndpoint(
	ctx context.Context,
	identifier, endpointType, engineName, serverName, databaseName, username string,
	port int32,
	kv map[string]string,
) (*Endpoint, error)

CreateEndpoint creates a new DMS endpoint.

func (*InMemoryBackend) CreateEventSubscription

func (b *InMemoryBackend) CreateEventSubscription(
	ctx context.Context,
	subscriptionName, snsTopicArn, sourceType string,
	sourceIDs, eventCategories []string,
	enabled bool,
	kv map[string]string,
) (*EventSubscription, error)

CreateEventSubscription creates a new event subscription.

func (*InMemoryBackend) CreateFleetAdvisorCollector

func (b *InMemoryBackend) CreateFleetAdvisorCollector(
	ctx context.Context,
	collectorName, description, serviceAccessRoleArn, s3BucketName string,
) (*FleetAdvisorCollector, error)

CreateFleetAdvisorCollector creates a new Fleet Advisor collector.

func (*InMemoryBackend) CreateInstanceProfile

func (b *InMemoryBackend) CreateInstanceProfile(
	ctx context.Context,
	instanceProfileName, availabilityZone, kmsKeyArn, networkType, description, subnetGroupIdentifier string,
	publiclyAccessible bool,
	kv map[string]string,
) (*InstanceProfile, error)

CreateInstanceProfile creates a new instance profile.

func (*InMemoryBackend) CreateMigrationProject

func (b *InMemoryBackend) CreateMigrationProject(
	ctx context.Context,
	name, description string,
	kv map[string]string,
) (*MigrationProject, error)

CreateMigrationProject creates a migration project.

func (*InMemoryBackend) CreateReplicationConfig

func (b *InMemoryBackend) CreateReplicationConfig(
	ctx context.Context,
	identifier, replicationType, sourceEndpointArn, targetEndpointArn string,
	kv map[string]string,
) (*ReplicationConfig, error)

CreateReplicationConfig creates a replication config.

func (*InMemoryBackend) CreateReplicationInstance

func (b *InMemoryBackend) CreateReplicationInstance(
	ctx context.Context,
	identifier, class, engineVersion, availabilityZone string,
	allocatedStorage int32,
	multiAZ, autoMinorVersionUpgrade, publiclyAccessible bool,
	kv map[string]string,
) (*ReplicationInstance, error)

CreateReplicationInstance creates a new DMS replication instance.

func (*InMemoryBackend) CreateReplicationSubnetGroup

func (b *InMemoryBackend) CreateReplicationSubnetGroup(
	ctx context.Context,
	identifier, description, vpcID string,
	kv map[string]string,
) (*ReplicationSubnetGroup, error)

CreateReplicationSubnetGroup creates a subnet group.

func (*InMemoryBackend) CreateReplicationTask

func (b *InMemoryBackend) CreateReplicationTask(
	ctx context.Context,
	identifier, sourceEndpointArn, targetEndpointArn, replicationInstanceArn,
	migrationType, tableMappings, settings string,
	kv map[string]string,
) (*ReplicationTask, error)

CreateReplicationTask creates a new DMS replication task.

func (*InMemoryBackend) DeleteAssessmentRun

func (b *InMemoryBackend) DeleteAssessmentRun(ctx context.Context, runArn string) (*AssessmentRun, error)

DeleteAssessmentRun removes a stored assessment run.

func (*InMemoryBackend) DeleteCertificate

func (b *InMemoryBackend) DeleteCertificate(ctx context.Context, identifierOrArn string) (*Certificate, error)

DeleteCertificate deletes a certificate by identifier or ARN.

func (*InMemoryBackend) DeleteConnection

func (b *InMemoryBackend) DeleteConnection(
	ctx context.Context,
	replicationInstanceArn, endpointArn string,
) (*Connection, error)

DeleteConnection removes a connection record created by TestConnection.

func (*InMemoryBackend) DeleteDataMigration

func (b *InMemoryBackend) DeleteDataMigration(ctx context.Context, nameOrArn string) (*DataMigration, error)

DeleteDataMigration deletes a data migration by name or ARN.

func (*InMemoryBackend) DeleteDataProvider

func (b *InMemoryBackend) DeleteDataProvider(ctx context.Context, nameOrArn string) (*DataProvider, error)

DeleteDataProvider deletes a data provider by name or ARN.

func (*InMemoryBackend) DeleteEndpoint

func (b *InMemoryBackend) DeleteEndpoint(ctx context.Context, arnOrID string) (*Endpoint, error)

DeleteEndpoint deletes an endpoint by ARN or identifier. Real AWS rejects deletion if the endpoint is still referenced by any replication task.

func (*InMemoryBackend) DeleteEventSubscription

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

DeleteEventSubscription deletes an event subscription by name.

func (*InMemoryBackend) DeleteFleetAdvisorCollector

func (b *InMemoryBackend) DeleteFleetAdvisorCollector(ctx context.Context, nameOrID string) error

DeleteFleetAdvisorCollector deletes a fleet advisor collector by name or ID.

func (*InMemoryBackend) DeleteFleetAdvisorDatabases

func (b *InMemoryBackend) DeleteFleetAdvisorDatabases(ctx context.Context, ids []string) ([]string, error)

DeleteFleetAdvisorDatabases removes Fleet Advisor databases by ID and returns the deleted IDs.

func (*InMemoryBackend) DeleteInstanceProfile

func (b *InMemoryBackend) DeleteInstanceProfile(ctx context.Context, nameOrArn string) error

DeleteInstanceProfile deletes an instance profile by name or ARN.

func (*InMemoryBackend) DeleteMigrationProject

func (b *InMemoryBackend) DeleteMigrationProject(ctx context.Context, nameOrArn string) error

DeleteMigrationProject deletes a migration project by name or ARN.

func (*InMemoryBackend) DeleteReplicationConfig

func (b *InMemoryBackend) DeleteReplicationConfig(ctx context.Context, identifierOrArn string) error

DeleteReplicationConfig deletes a replication config by identifier or ARN.

func (*InMemoryBackend) DeleteReplicationInstance

func (b *InMemoryBackend) DeleteReplicationInstance(ctx context.Context, arnOrID string) error

DeleteReplicationInstance deletes a replication instance by ARN or identifier. AWS requires all replication tasks on the instance to be deleted first.

func (*InMemoryBackend) DeleteReplicationSubnetGroup

func (b *InMemoryBackend) DeleteReplicationSubnetGroup(ctx context.Context, identifierOrArn string) error

DeleteReplicationSubnetGroup deletes a subnet group by identifier or ARN.

func (*InMemoryBackend) DeleteReplicationTask

func (b *InMemoryBackend) DeleteReplicationTask(ctx context.Context, arnOrID string) (*ReplicationTask, error)

DeleteReplicationTask deletes a replication task by ARN or identifier. AWS does not allow deleting a task while it is running.

func (*InMemoryBackend) DescribeAssessmentRuns

func (b *InMemoryBackend) DescribeAssessmentRuns(ctx context.Context, taskArn string) ([]*AssessmentRun, error)

DescribeAssessmentRuns returns stored assessment runs, optionally filtered by task ARN.

func (*InMemoryBackend) DescribeCertificates

func (b *InMemoryBackend) DescribeCertificates(ctx context.Context) ([]*Certificate, error)

DescribeCertificates returns all certificates.

func (*InMemoryBackend) DescribeConnections

func (b *InMemoryBackend) DescribeConnections(
	ctx context.Context,
	replicationInstanceArn, endpointArn string,
) ([]*Connection, error)

DescribeConnections returns stored connections, optionally filtered by replication instance ARN or endpoint ARN.

func (*InMemoryBackend) DescribeDataMigrations

func (b *InMemoryBackend) DescribeDataMigrations(ctx context.Context, nameOrArn string) ([]*DataMigration, error)

DescribeDataMigrations returns all data migrations (optionally filtered by name/arn).

func (*InMemoryBackend) DescribeDataProviders

func (b *InMemoryBackend) DescribeDataProviders(ctx context.Context, nameOrArn string) ([]*DataProvider, error)

DescribeDataProviders returns all data providers (optionally filtered by name/arn).

func (*InMemoryBackend) DescribeEndpoints

func (b *InMemoryBackend) DescribeEndpoints(ctx context.Context, identifierOrArn string) ([]*Endpoint, error)

DescribeEndpoints returns endpoints, optionally filtered by identifier or ARN.

func (*InMemoryBackend) DescribeEventSubscriptions

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

DescribeEventSubscriptions returns all event subscriptions (optionally filtered by name).

func (*InMemoryBackend) DescribeEvents

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

DescribeEvents returns all recorded DMS events for the request region.

func (*InMemoryBackend) DescribeFleetAdvisorCollectors

func (b *InMemoryBackend) DescribeFleetAdvisorCollectors(ctx context.Context) ([]*FleetAdvisorCollector, error)

DescribeFleetAdvisorCollectors returns all fleet advisor collectors.

func (*InMemoryBackend) DescribeFleetAdvisorDatabases

func (b *InMemoryBackend) DescribeFleetAdvisorDatabases(ctx context.Context) ([]*FleetAdvisorDatabase, error)

DescribeFleetAdvisorDatabases returns databases discovered by Fleet Advisor collectors.

func (*InMemoryBackend) DescribeInstanceProfiles

func (b *InMemoryBackend) DescribeInstanceProfiles(ctx context.Context) ([]*InstanceProfile, error)

DescribeInstanceProfiles returns all instance profiles.

func (*InMemoryBackend) DescribeMigrationProjects

func (b *InMemoryBackend) DescribeMigrationProjects(ctx context.Context) ([]*MigrationProject, error)

DescribeMigrationProjects returns all migration projects.

func (*InMemoryBackend) DescribeRecommendations

func (b *InMemoryBackend) DescribeRecommendations(ctx context.Context) ([]*Recommendation, error)

DescribeRecommendations returns Fleet Advisor target recommendations for the request region.

func (*InMemoryBackend) DescribeReplicationConfigs

func (b *InMemoryBackend) DescribeReplicationConfigs(ctx context.Context) ([]*ReplicationConfig, error)

DescribeReplicationConfigs returns all replication configs.

func (*InMemoryBackend) DescribeReplicationInstances

func (b *InMemoryBackend) DescribeReplicationInstances(
	ctx context.Context,
	identifierOrArn string,
) ([]*ReplicationInstance, error)

DescribeReplicationInstances returns replication instances, optionally filtered by identifier or ARN.

func (*InMemoryBackend) DescribeReplicationSubnetGroups

func (b *InMemoryBackend) DescribeReplicationSubnetGroups(ctx context.Context) ([]*ReplicationSubnetGroup, error)

DescribeReplicationSubnetGroups returns all subnet groups.

func (*InMemoryBackend) DescribeReplicationTasks

func (b *InMemoryBackend) DescribeReplicationTasks(ctx context.Context, arnOrID string) ([]*ReplicationTask, error)

DescribeReplicationTasks returns replication tasks, optionally filtered by ARN or identifier.

func (*InMemoryBackend) DescribeReplications

func (b *InMemoryBackend) DescribeReplications(
	ctx context.Context,
	replicationConfigIDOrArn string,
) ([]*ReplicationConfig, error)

DescribeReplications returns DMS Serverless replication runtime state, backed by the replication configs that have had StartReplication called against them at least once. A config that has never been started still carries a valid Status ("created") from CreateReplicationConfig, matching AWS's behavior of DescribeReplications listing every config regardless of whether it has ever run. Optionally filtered by config identifier or ARN.

func (*InMemoryBackend) DescribeSchemas

func (b *InMemoryBackend) DescribeSchemas(ctx context.Context, endpointARN string) ([]string, error)

DescribeSchemas returns the schema names available on an endpoint.

func (*InMemoryBackend) ImportCertificate

func (b *InMemoryBackend) ImportCertificate(ctx context.Context, identifier, certPem string) (*Certificate, error)

ImportCertificate creates a certificate record.

func (*InMemoryBackend) ListMetadataModelRequests

func (b *InMemoryBackend) ListMetadataModelRequests(
	ctx context.Context,
	projectIdentifier, reqType string,
) ([]*MetadataModelRequest, error)

ListMetadataModelRequests returns all requests of a given type for a migration project.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceArn string) (map[string]string, error)

ListTagsForResource returns tags for a DMS resource by ARN.

func (*InMemoryBackend) ModifyDataMigration

func (b *InMemoryBackend) ModifyDataMigration(
	ctx context.Context,
	nameOrArn, migrationType, serviceAccessRoleArn string,
	numberOfJobs *int32,
) (*DataMigration, error)

ModifyDataMigration updates a data migration.

func (*InMemoryBackend) ModifyDataProvider

func (b *InMemoryBackend) ModifyDataProvider(
	ctx context.Context,
	nameOrArn, engine, description string,
) (*DataProvider, error)

ModifyDataProvider updates a data provider.

func (*InMemoryBackend) ModifyEndpoint

func (b *InMemoryBackend) ModifyEndpoint(
	ctx context.Context,
	arnOrID, serverName, databaseName, username string,
	port int32,
) (*Endpoint, error)

ModifyEndpoint updates endpoint settings.

func (*InMemoryBackend) ModifyEventSubscription

func (b *InMemoryBackend) ModifyEventSubscription(
	ctx context.Context,
	name string,
	enabled *bool,
) (*EventSubscription, error)

ModifyEventSubscription updates an event subscription.

func (*InMemoryBackend) ModifyInstanceProfile

func (b *InMemoryBackend) ModifyInstanceProfile(
	ctx context.Context,
	nameOrArn, availabilityZone, description, networkType string,
) (*InstanceProfile, error)

ModifyInstanceProfile updates an instance profile.

func (*InMemoryBackend) ModifyMigrationProject

func (b *InMemoryBackend) ModifyMigrationProject(
	ctx context.Context,
	nameOrArn, description string,
) (*MigrationProject, error)

ModifyMigrationProject updates the description of an existing migration project.

func (*InMemoryBackend) ModifyReplicationConfig

func (b *InMemoryBackend) ModifyReplicationConfig(
	ctx context.Context,
	identifierOrArn, replicationType string,
) (*ReplicationConfig, error)

ModifyReplicationConfig updates the replication type of an existing replication config.

func (*InMemoryBackend) ModifyReplicationInstance

func (b *InMemoryBackend) ModifyReplicationInstance(
	ctx context.Context,
	arnOrID, class, engineVersion string,
	multiAZ, autoMinorVersionUpgrade *bool,
	allocatedStorage *int32,
) (*ReplicationInstance, error)

ModifyReplicationInstance updates a replication instance's class and engineVersion.

func (*InMemoryBackend) ModifyReplicationSubnetGroup

func (b *InMemoryBackend) ModifyReplicationSubnetGroup(
	ctx context.Context,
	identifierOrArn, description string,
) (*ReplicationSubnetGroup, error)

ModifyReplicationSubnetGroup updates a subnet group's description by identifier or ARN. SubnetIds are accepted (as required by the real AWS request shape) but not modeled further since gopherstack does not emulate VPC subnet membership for DMS subnet groups.

func (*InMemoryBackend) ModifyReplicationTask

func (b *InMemoryBackend) ModifyReplicationTask(
	ctx context.Context,
	arnOrID, migrationType, tableMappings, replicationTaskSettings string,
) (*ReplicationTask, error)

ModifyReplicationTask updates task settings. AWS does not allow modifying a running task.

func (*InMemoryBackend) MoveReplicationTask

func (b *InMemoryBackend) MoveReplicationTask(
	ctx context.Context,
	taskArnOrID, targetInstanceArn string,
) (*ReplicationTask, error)

MoveReplicationTask moves a replication task to a different instance.

func (*InMemoryBackend) PaginationSecret

func (b *InMemoryBackend) PaginationSecret() string

PaginationSecret returns the HMAC secret for pagination tokens.

func (*InMemoryBackend) RebootReplicationInstance

func (b *InMemoryBackend) RebootReplicationInstance(ctx context.Context, arnOrID string) (*ReplicationInstance, error)

RebootReplicationInstance reboots a replication instance (no-op in memory).

func (*InMemoryBackend) RefreshSchemas

func (b *InMemoryBackend) RefreshSchemas(ctx context.Context, endpointARN string) error

RefreshSchemas seeds schema discovery for an endpoint (emulates async refresh).

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the AWS region this backend is configured for.

func (*InMemoryBackend) RemoveTagsFromResource

func (b *InMemoryBackend) RemoveTagsFromResource(ctx context.Context, resourceArn string, tagKeys []string) error

RemoveTagsFromResource removes tags from a DMS resource by ARN.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all backend state and closes all tag registries across all regions.

func (*InMemoryBackend) Restore

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

Restore loads backend state from a JSON snapshot produced by Snapshot.

func (*InMemoryBackend) Snapshot

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

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) StartAssessmentRun

func (b *InMemoryBackend) StartAssessmentRun(
	ctx context.Context,
	taskArn, _, _, assessmentRunName string,
) (*AssessmentRun, error)

StartAssessmentRun creates and stores a new premigration assessment run.

func (*InMemoryBackend) StartDataMigration

func (b *InMemoryBackend) StartDataMigration(ctx context.Context, nameOrArn string) (*DataMigration, error)

StartDataMigration transitions a data migration to running status.

func (*InMemoryBackend) StartMetadataModelRequest

func (b *InMemoryBackend) StartMetadataModelRequest(
	ctx context.Context,
	projectIdentifier, reqType, selectionRules string,
) (string, error)

StartMetadataModelRequest persists a metadata model operation request and returns its ID.

func (*InMemoryBackend) StartRecommendation

func (b *InMemoryBackend) StartRecommendation(ctx context.Context, databaseID string) error

StartRecommendation starts the analysis for a single Fleet Advisor source database and stores a resulting target-engine recommendation, visible via DescribeRecommendations. This is the single-target counterpart of BatchStartRecommendations.

func (*InMemoryBackend) StartReplication

func (b *InMemoryBackend) StartReplication(
	ctx context.Context,
	replicationConfigArn, startReplicationType string,
) (*ReplicationConfig, error)

StartReplication starts (or resumes) the DMS Serverless replication associated with a replication config. Real AWS rejects starting a replication that is already running.

func (*InMemoryBackend) StartReplicationTask

func (b *InMemoryBackend) StartReplicationTask(ctx context.Context, arnOrID string) (*ReplicationTask, error)

StartReplicationTask transitions a replication task to running status.

func (*InMemoryBackend) StopDataMigration

func (b *InMemoryBackend) StopDataMigration(ctx context.Context, nameOrArn string) (*DataMigration, error)

StopDataMigration transitions a data migration to stopped status.

func (*InMemoryBackend) StopReplication

func (b *InMemoryBackend) StopReplication(
	ctx context.Context,
	replicationConfigArn string,
) (*ReplicationConfig, error)

StopReplication stops the DMS Serverless replication associated with a replication config. Real AWS rejects stopping a replication that is not currently running.

func (*InMemoryBackend) StopReplicationTask

func (b *InMemoryBackend) StopReplicationTask(ctx context.Context, arnOrID string) (*ReplicationTask, error)

StopReplicationTask transitions a replication task to stopped status. Real AWS rejects stopping a task that is not currently running.

func (*InMemoryBackend) TestConnection

func (b *InMemoryBackend) TestConnection(
	ctx context.Context,
	replicationInstanceArn, endpointArn string,
) (*Connection, error)

TestConnection tests a DMS connection and records the result.

type InstanceProfile

type InstanceProfile struct {
	CreationTime          time.Time  `json:"creationTime"`
	Tags                  *tags.Tags `json:"-"`
	InstanceProfileName   string     `json:"instanceProfileName"`
	InstanceProfileArn    string     `json:"instanceProfileArn"`
	AvailabilityZone      string     `json:"availabilityZone,omitempty"`
	KmsKeyArn             string     `json:"kmsKeyArn,omitempty"`
	NetworkType           string     `json:"networkType,omitempty"`
	Description           string     `json:"description,omitempty"`
	SubnetGroupIdentifier string     `json:"subnetGroupIdentifier,omitempty"`
	AccountID             string     `json:"accountId"`
	Region                string     `json:"region"`
	PubliclyAccessible    bool       `json:"publiclyAccessible"`
}

InstanceProfile represents an AWS DMS instance profile.

type MetadataModelRequest

type MetadataModelRequest struct {
	RequestIdentifier          string
	MigrationProjectIdentifier string
	Status                     string
	RequestType                string
	SelectionRules             string
	Region                     string
}

MetadataModelRequest tracks a metadata model operation (assessment, conversion, etc.).

Region supports Phase 3.3's store.Table keying (see store_setup.go) -- MetadataModelRequest carries no other region-derived field, so the value needs its own copy to serve as a pure store.Table/store.Index key input.

type MigrationProject

type MigrationProject struct {
	Tags                       *tags.Tags `json:"-"`
	MigrationProjectName       string
	MigrationProjectArn        string
	MigrationProjectIdentifier string
	Description                string
	AccountID                  string
	Region                     string
}

MigrationProject represents a DMS migration project.

type Provider

type Provider struct{}

Provider implements service.Provider for AWS DMS.

func (*Provider) Init

Init initializes the DMS service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type Recommendation

type Recommendation struct {
	DatabaseID string
	EngineName string
	Status     string
}

Recommendation is a target-engine recommendation from Fleet Advisor.

type ReplicationConfig

type ReplicationConfig struct {
	Tags                        *tags.Tags `json:"-"`
	ReplicationConfigIdentifier string
	ReplicationConfigArn        string
	ReplicationType             string
	SourceEndpointArn           string
	TargetEndpointArn           string
	AccountID                   string
	Region                      string
	// Status is the runtime status of the associated Replication resource
	// (created, running, stopped, ...). It is never surfaced on the
	// ReplicationConfig wire shape itself -- only via StartReplication /
	// StopReplication / DescribeReplications, which report on the
	// "Replication" resource, not the "ReplicationConfig" resource.
	Status string
	// StartReplicationType records the StartReplicationType passed to the
	// most recent StartReplication call (start-replication, resume-processing,
	// or reload-target), echoed back on the Replication resource.
	StartReplicationType string
}

ReplicationConfig represents a DMS replication config. ReplicationConfig also tracks the runtime state of its associated DMS Serverless "Replication" resource (Status, StartReplicationType). AWS models the replication config (returned by CreateReplicationConfig / DescribeReplicationConfigs / ModifyReplicationConfig) and the replication runtime state (returned by StartReplication / StopReplication / DescribeReplications) as two distinct API shapes, but a single config has at most one associated replication in this in-memory emulation, so the runtime fields live on the same struct rather than a separate table.

type ReplicationInstance

type ReplicationInstance struct {
	CreationTime                  time.Time  `json:"creationTime"`
	Tags                          *tags.Tags `json:"-"`
	ReplicationInstanceIdentifier string     `json:"replicationInstanceIdentifier"`
	ReplicationInstanceArn        string     `json:"replicationInstanceArn"`
	ReplicationInstanceClass      string     `json:"replicationInstanceClass"`
	EngineVersion                 string     `json:"engineVersion"`
	AvailabilityZone              string     `json:"availabilityZone"`
	ReplicationInstanceStatus     string     `json:"replicationInstanceStatus"`
	PrivateIPAddress              string     `json:"privateIpAddress"`
	AccountID                     string     `json:"accountId"`
	Region                        string     `json:"region"`
	AllocatedStorage              int32      `json:"allocatedStorage"`
	MultiAZ                       bool       `json:"multiAZ"`
	AutoMinorVersionUpgrade       bool       `json:"autoMinorVersionUpgrade"`
	PubliclyAccessible            bool       `json:"publiclyAccessible"`
}

ReplicationInstance represents an AWS DMS replication instance.

The Tags field is backend-owned. Callers must treat the returned pointer as read-only; mutate tags only via AddTagsToResource or CreateReplicationInstance.

type ReplicationSubnetGroup

type ReplicationSubnetGroup struct {
	Tags                              *tags.Tags `json:"-"`
	ReplicationSubnetGroupIdentifier  string
	ReplicationSubnetGroupArn         string
	ReplicationSubnetGroupDescription string
	VpcID                             string
	AccountID                         string
	Region                            string
}

ReplicationSubnetGroup represents a DMS replication subnet group.

type ReplicationTask

type ReplicationTask struct {
	CreationTime              time.Time  `json:"creationTime"`
	Tags                      *tags.Tags `json:"-"`
	ReplicationTaskIdentifier string     `json:"replicationTaskIdentifier"`
	ReplicationTaskArn        string     `json:"replicationTaskArn"`
	SourceEndpointArn         string     `json:"sourceEndpointArn"`
	TargetEndpointArn         string     `json:"targetEndpointArn"`
	ReplicationInstanceArn    string     `json:"replicationInstanceArn"`
	MigrationType             string     `json:"migrationType"`
	TableMappings             string     `json:"tableMappings,omitempty"`
	ReplicationTaskSettings   string     `json:"replicationTaskSettings,omitempty"`
	Status                    string     `json:"status"`
	AccountID                 string     `json:"accountId"`
	Region                    string     `json:"region"`
}

ReplicationTask represents an AWS DMS replication task.

The Tags field is backend-owned. Callers must treat the returned pointer as read-only; mutate tags only via AddTagsToResource or CreateReplicationTask.

Jump to

Keyboard shortcuts

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