Introducing a new way to review your PRs.

Read the announcement

floci-io / floci

Light, fluffy, and always free - The AWS Local Emulator alternative

View on GitHub

38 documents · Updated Nov 23, 2026

docs / svc-dms

Database Migration Service

Database Migration Service (DMS) provides an AWS-shaped JSON control plane for database-migration configuration. It manages replication subnet groups, endpoints, replication instances, and replication tasks within the caller's account and Region. The service also keeps tags with each resource and enforces the links between resources during control-plane changes. For nearby service boundaries, see Database and cache services and request routing and protocols.

Service boundary

JSON request handling

The service accepts a DMS action name with a JSON request and returns the matching AWS-shaped JSON response. The request handler connects the wire contract to service state and presents each resource in the field names expected by DMS clients.

Supported control-plane actions are:

  • CreateReplicationSubnetGroup
  • DescribeReplicationSubnetGroups
  • DeleteReplicationSubnetGroup
  • ListTagsForResource
  • AddTagsToResource
  • RemoveTagsFromResource
  • CreateEndpoint, DescribeEndpoints, ModifyEndpoint, and DeleteEndpoint
  • CreateReplicationInstance, DescribeReplicationInstances, ModifyReplicationInstance, and DeleteReplicationInstance
  • CreateReplicationTask, DescribeReplicationTasks, ModifyReplicationTask, DeleteReplicationTask, StartReplicationTask, and StopReplicationTask

Create, modify, and delete operations return the affected resource for endpoints, replication instances, and replication tasks. Subnet-group deletion and tag mutations return an empty response. Describe operations return a collection with an optional continuation marker. Tag operations return or change tag data without changing the resource configuration.

References: src/…/DmsJsonHandler.java• L29-93

Replication subnet-group state

A replication subnet group describes the network locations that DMS can use for migration work. The service keeps its identifier, description, VPC, status, subnet list, Availability Zone mapping, supported network type, and tags as one resource state object.

Creation uses the requested subnet IDs as an input to the EC2 network view. The group is accepted only when the subnets exist, belong to one VPC, and cover at least two Availability Zones. The service stores the identifier in lower case, keeps the requested subnet order, marks the group Complete, and reports IPv4 as its supported network type.

The group response expands each subnet into its ID, Availability Zone, and active status. Groups are caller-owned in this service, so the response marks IsReadOnly as false.

This diagram shows how a create request becomes stored DMS network state.

flowchart LR
    Request[Create request] --> Validate[Validate group fields]
    Validate --> Network[Check EC2 subnets]
    Network --> Rules[Check one VPC and two AZs]
    Rules --> State[Store replication subnet group]
    State --> Response[Return DMS group response]

References: src/…/DmsService.java• L347-359 src/…/DmsService.java• L761-810 src/…/DmsJsonHandler.java• L138-157

Group discovery and pagination

Describe requests can return all groups in a Region or select groups with the replication-subnet-group-id filter. A selected identifier that does not exist is an error rather than an empty result.

The response uses MaxRecords and an opaque Marker to continue a long result set. The default page size is 100. Valid page sizes range from 20 to 100. The response includes Marker only when another page exists, so a client can stop when the field is absent.

References: src/…/DmsService.java• L368-383 src/…/DmsJsonHandler.java• L37-49

Tag resource state

Tag lifecycle

Tags are key-value metadata attached to a DMS resource. A create request can set tags at the same time as the resource. Later requests can add or replace keys, remove selected keys, or list the current tag set.

The service checks tag shape and reserved prefixes before it changes state. Tag keys must be 1 to 128 characters. Tag values can be empty and must be no more than 256 characters. Neither may start with aws: or dms:.

ListTagsForResource supports one ResourceArn or a ResourceArnList. A single-resource response contains key and value. A list response also identifies the source ARN for each returned tag.

References: src/…/DmsService.java• L402-435 src/…/DmsService.java• L1060-1089 src/…/DmsResource.java• L20-41 src/…/DmsJsonHandler.java• L54-67

Resource ARN scope

Tag actions address a DMS resource through its resource ARN. The ARN identifies a subnet group, endpoint, replication instance, or replication task. The service also checks the account and Region in the ARN against the caller context, so a foreign account or Region cannot reach a local resource with the same name.

The subnet-group describe response does not include an ARN. Clients that need to tag a group build the DMS ARN from the group identifier, account, and Region, then use that ARN in tag requests. An invalid or unknown ARN produces a resource-not-found result.

References: src/…/DmsService.java• L977-1005 src/…/DmsService.java• L1009-1038

Control-plane lifecycle

Managed resource state

The control plane stores each endpoint, replication instance, and replication task as a DMS-shaped resource state object. The state keeps response attributes separate from tags, so describe operations can return the resource view while tag operations update metadata without changing that view. Secret endpoint settings are accepted when needed for the request contract but are not retained because DMS does not return them.

The resource relationships define which operations are safe:

  • A replication task refers to one source endpoint, one target endpoint, and one replication instance.
  • An endpoint cannot be deleted while a replication task refers to it.
  • A replication instance cannot be deleted while a replication task refers to it.
  • A replication subnet group cannot be deleted while a replication instance uses it.
  • A replication task moves between ready, running, and stopped; modification and deletion are blocked while it is running.

References: src/…/DmsResource.java• L12-41 src/…/DmsService.java• L130-177 src/…/DmsService.java• L185-247 src/…/DmsService.java• L279-345

Migration configuration operations

The control plane builds migration configuration in dependency order. Callers create compatible endpoints, place them on a replication instance, and then create a task that joins the three resources. The service does not move data; task start changes the reported task state to running until a stop request changes it to stopped.

This diagram shows the resource relationships used by the migration configuration flow.

flowchart LR
    Source[Source endpoint] --> Task[Replication task]
    Target[Target endpoint] --> Task
    Instance[Replication instance] --> Task
    Subnets[Replication subnet group] --> Instance
    Task --> State[Task state]

References: src/…/DmsService.java• L208-220 src/…/DmsService.java• L279-295 src/…/DmsService.java• L323-345

Resource operations

The control plane treats a replication subnet group as the main managed network resource. The normal lifecycle starts with a validated create request, continues with describe or tag requests, and ends with delete. Delete removes the group and its attached tags together because the tags belong to that group state.

The service reports AWS-style errors for duplicate creation, missing resources, invalid request values, invalid subnet networks, resource dependencies, and malformed JSON member types. These errors keep client behavior aligned with the request contract instead of silently coercing bad input.

References: src/…/DmsService.java• L347-400 src/…/DmsService.java• L448-474 src/…/DmsService.java• L537-595

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep action names, request member names, response member names, and AWS-style error names aligned between DmsJsonHandler and DmsService.
  • Keep subnet-group lookup normalization aligned across create, describe filters, delete, and ARN-based tag actions.
  • Keep the subnet-group response fields aligned with the state needed by tag lookup and with the EC2 subnet data used during creation.
  • Keep endpoint, replication-instance, and replication-task response attributes aligned with the resource relationships that protect delete and modify operations.
  • Keep resource attributes and tags separate when adding or changing a DMS resource model, because describe and tag actions use different state views.
  • Keep the Marker omission rule intact on the final describe page so SDK paginators can stop.
  • Keep single-ARN and ARN-list tag responses distinct because only the list form returns ResourceArn per tag.
  • Keep account and Region checks in ARN lookup aligned with the storage scope to prevent cross-scope resource access.

Important failure modes

TriggerConsequenceGuard
Create uses subnets from more than one VPCDMS rejects the group with an invalid-subnet errorResolve all subnets and compare their VPC IDs before storing the group
Create covers fewer than two Availability ZonesDMS rejects the group because it does not meet subnet-group coverage rulesCount distinct Availability Zones before persistence
Describe sends a page marker after the final pageAn SDK paginator can request pages foreverAdd Marker only when the pagination result has a next token
Tag request names another account or RegionThe target is treated as missing instead of reaching a same-named local groupValidate ARN service, resource type, account, and Region
Tag key or value uses a reserved prefix or exceeds its limitThe tag mutation is rejectedValidate every tag before updating resource state
Delete targets an endpoint, instance, or subnet group that is still in useDMS rejects the change and preserves the dependent configurationCheck task and instance references before deletion
Modify or delete targets a running replication taskDMS rejects the change until the task is stoppedEnforce the task state transition before the operation

Key files

FileWhy to read it
src/…/DmsJsonHandler.javaShows the supported JSON actions and the response shapes exposed to DMS clients.
src/…/DmsService.javaDefines resource lifecycles, relationships, EC2 subnet checks, pagination, tag changes, ARN scope, and AWS-style errors.
src/…/DmsResource.javaDefines the shared state shape for endpoints, replication instances, and replication tasks, including response attributes and tags.
src/…/ReplicationSubnetGroup.javaDefines the resource state returned by group operations and retained for later tag actions.
src/…/ResourceTag.javaDefines the tag result shape for single-resource and multi-resource list requests.