The Service Reference ends every DMS resource type's ARN format in a wildcard where the resource goes
(arn:${Partition}:dms:${Region}:${Account}:endpoint:*), which the table reader matches as written, so no DMS request
was checked on the resource it names: one naming an endpoint, an instance or a task by its ARN stayed on *, and no
aws:ResourceTag condition on a DMS resource could match.
The DMS User Guide gives what goes there: "An ARN for an AWS DMS resource uses the following syntax:
arn:aws:dms:region:account number:resourcetype:resourcename". tools/aws/fetch_dms_arn_formats.py vendors that page
(the syntax, the sentence saying what its resource name is, and its table of formats) into
tools/aws/sources/dms-arn-formats.json, pairs the syntax with each Service Reference DMS format ending in a wildcard
by its resource type, and writes that format with the page's placeholder where the wildcard was
(arn:${Partition}:dms:${Region}:${Account}:endpoint:${resourcename}). A reworded page, or a table row whose type no
such format has, is refused. regen_iam_request_resources.py takes those formats as they stand (ARN_FORMAT_SOURCES,
granted for dms alone), each checked to differ from the Service Reference's only where its wildcard was, and verifies
the source against the live pages beside the other vendored sources.
The generator's existing machinery then names a DMS resource by the ARN a request passes, or fills the format from
the identifier a request names it by. DmsStoredResourceArns finds such an identifier, or an ARN DMS holds, as DMS
stores it (an endpoint's, an instance's or a task's ARN ends in the id DMS minted, not in its identifier; one stored before keys carried the account is the default account's and found too), and reads
the tags of an endpoint, instance, task or subnet group for aws:ResourceTag, both in place. A subnet group's ARN
ends in its identifier as DMS stores it, in lower case ("This value is stored as a lowercase string"), so the reader
resolves an ARN naming one in another case to that one (resolveStoredArn). A request leaving out
an optional ARN names the resource DMS uses for one naming none, of which it has none. A replication instance whose create
names no subnet group goes into the account's default replication subnet group, so the reader answers that group as
the one such a create acts on (findImplicitDefault), and the create is checked on subgrp:default.
The fetcher also copies what AWS answers each DMS create with, from AWS's recorded exchanges with DMS (the AWS
Emulator evaluation suite's wire tests, "a recorded exchange with AWS") and botocore's examples: whether the ARN of
what the create makes ends in a member of its request (a subnet group's in its ReplicationSubnetGroupIdentifier, an
event subscription's in its SubscriptionName) or in a value the request does not give (an endpoint's, an instance's,
a task's, a certificate's: botocore's example answers EndpointIdentifier "test-endpoint-1" with
endpoint:RAAR3R22XSH46S3PWLC3NJAWKM). The generator's rule for a variable a create's response answers, which stays open
whatever member a rule would fill it from, reads that too (with_recorded_mints), both for what a create is checked
on and for what its tags are checked on: CreateEndpoint, CreateReplicationInstance and ImportCertificate are checked on
what they make with its id open (rep:*), the tags of CreateReplicationTask, CreateDataProvider and
CreateInstanceProfile on what they make likewise, and no other row of the table changes. The creates of data
migrations, migration projects, replication configs and assessment runs have no recorded answer and keep their
fills. A modify renaming an instance is still checked on rep:<new name> beside its own ARN, nothing
being recorded for it.
The regeneration also takes the Service Reference's new SageMaker candidate, leaderboard and model monitor config
actions.
12 KiB
AWS Database Migration Service (DMS)
Protocol: AWS JSON 1.1
Signing name: dms
Floci emulates the replication subnet group, endpoint, replication instance and
replication task lifecycles, which is what aws_dms_replication_subnet_group,
aws_dms_endpoint, aws_dms_s3_endpoint, aws_dms_replication_instance and
aws_dms_replication_task need to plan, apply and destroy. Subnets are resolved against
the emulated EC2 service, so the VPC and Availability Zones a group reports are the ones
those subnets actually have. No data is migrated: the resources are control-plane state.
Supported Actions
| Action | Description |
|---|---|
CreateReplicationSubnetGroup |
Creates a replication subnet group from existing EC2 subnets. |
DescribeReplicationSubnetGroups |
Lists replication subnet groups, optionally filtered by identifier. |
DeleteReplicationSubnetGroup |
Deletes the specified replication subnet group. |
ListTagsForResource |
Lists the tags on one or more DMS resource ARNs. |
AddTagsToResource |
Merges tags into the resource, overwriting by key. |
RemoveTagsFromResource |
Removes the named tag keys from the resource. |
CreateEndpoint |
Creates a source or target endpoint; secret members are accepted and never returned. |
DescribeEndpoints |
Lists endpoints, filtered by endpoint-arn, endpoint-type, endpoint-id or engine-name. |
ModifyEndpoint |
Updates an endpoint; settings structures merge unless ExactSettings is true. |
DeleteEndpoint |
Deletes an endpoint that no replication task uses. |
CreateReplicationInstance |
Creates a replication instance, available immediately. |
DescribeReplicationInstances |
Lists replication instances, filtered by replication-instance-arn, replication-instance-id, replication-instance-class or engine-version. |
ModifyReplicationInstance |
Updates a replication instance, applied immediately. |
DeleteReplicationInstance |
Deletes a replication instance that no replication task uses. |
CreateReplicationTask |
Creates a replication task between two existing endpoints on an existing instance, ready immediately. |
DescribeReplicationTasks |
Lists replication tasks, filtered by replication-task-arn, replication-task-id, migration-type, endpoint-arn or replication-instance-arn. |
ModifyReplicationTask |
Updates a replication task that is not running. |
DeleteReplicationTask |
Deletes a replication task that is not running. |
StartReplicationTask |
Moves a task to running. |
StopReplicationTask |
Moves a running task to stopped. |
Behaviour
- The identifier is stored as a lowercase string, as AWS does, so a group created as
MyGroupis described and deleted asmygroup. ReplicationSubnetGroupIdentifiermust not bedefaultand is limited to 255 alphanumeric characters, periods, underscores, or hyphens.- A group must cover at least two Availability Zones. Fewer returns
ReplicationSubnetGroupDoesNotCoverEnoughAZs, as AWS does. - Subnets must exist and must all belong to one VPC. Otherwise
InvalidSubnet. SubnetGroupStatusis immediatelyComplete, every subnet reportsActive,SupportedNetworkTypesis["IPV4"], andIsReadOnlyis alwaysfalse: a read-only group is one DMS manages for a zero-ETL integration, which Floci does not emulate.- The
defaultgroup is synthesised from the region's default-VPC subnets, and only exists onceCreateReplicationInstancehas put an instance in it (an instance created withoutReplicationSubnetGroupIdentifier, or namingdefaultexplicitly, which is accepted whenever the region has default subnets), as AWS creates it the first time it is needed. Until then it is neither listed nor found by the filter. Unlike AWS, it disappears again once no instance in the region uses it. DescribeReplicationSubnetGroupssupports thereplication-subnet-group-idfilter. A filter naming a group that does not exist returnsResourceNotFoundFault, which is how Terraform detects a group deleted outside its state.DescribeReplicationSubnetGroupspaginates onMaxRecordsandMarker.MaxRecordsdefaults to 100 and must be between 20 and 100; a value outside that range is rejected withInvalidParameterValueExceptionrather than clamped, as AWS does. Results are ordered by identifier andMarkeris an opaque cursor that resumes after the last item of the page, so a page stays resumable across groups created or deleted between requests.Markeris returned only when a further page exists, never on the last one.ReplicationSubnetGroupDescriptionis required, must not be blank, and must contain only printable characters. A control character such as0x01returnsInvalidParameterValueException.- A member of the wrong JSON type returns
SerializationException, as AWS does, rather than being coerced. That covers aTagsentry whoseValueis an object, a filter whoseValuesis not a list, a non-string element inResourceArnList,SubnetIdsorTagKeys, and a non-string identifier. An absent member is still a parameter error, not a serialization one. - Groups are scoped per account and Region and persist through
StorageFactory.
Endpoints, replication instances and replication tasks
- Each resource gets an ARN of the form
arn:aws:dms:<region>:<account>:<type>:<id>, where<type>isendpoint,reportaskand<id>is 26 characters of the base32 alphabet, or the request'sResourceIdentifierwhen one is given. Update and delete calls address the resource by that ARN. - Identifiers must begin with a letter, contain only ASCII letters, digits and hyphens,
and not end with a hyphen or contain two consecutive hyphens (63 characters for an
instance, 255 otherwise). A replication instance identifier is stored lowercase, as AWS
documents; endpoint and task identifiers keep their case. A duplicate identifier returns
ResourceAlreadyExistsFault. - A describe whose
Filtersmatch nothing returnsResourceNotFoundFault, which the Terraform provider reads as "gone". Without filters, no resources is an empty list. Filter values compare case-insensitively. Describes paginate onMaxRecordsandMarkeras subnet groups do. - Endpoints are
activefrom creation.EndpointTypeis accepted lowercase and returned uppercase (SOURCE,TARGET), as AWS does.SslModedefaults tonone. Engine settings structures (MySQLSettings,S3Settingsand the rest) are stored as sent and returned as stored, except that every member the DMS model types as a secret (Password,SaslPassword,AuthPasswordand so on) is dropped, because DMS never returns them.ModifyEndpointmerges a settings structure into the stored one member by member, or replaces it whenExactSettingsis true. - Replication instances are
availablefrom creation and stay so through a modify. A namedReplicationSubnetGroupIdentifiermust exist (otherwiseResourceNotFoundFault) and is returned as the fullReplicationSubnetGroupstructure; without one the instance reports thedefaultgroup. Defaults:AllocatedStorage50,EngineVersion3.5.4,PubliclyAccessibletrue,MultiAZfalse,AutoMinorVersionUpgradetrue,NetworkTypeIPV4,AvailabilityZone<region>a.ModifyReplicationInstanceapplies every change at once whateverApplyImmediatelysays. - Replication tasks need existing source and target endpoints and an existing instance
(otherwise
ResourceNotFoundFault).TableMappingsandReplicationTaskSettingsmust be JSON objects and are returned exactly as sent. A task isreadyfrom creation;StartReplicationTaskmakes itrunningandStopReplicationTaskmakes itstopped. Stopping a task that is not running returnsInvalidResourceStateFaultwith "is currently not running", the message the Terraform provider treats as already stopped. Modifying or deleting a running task returnsInvalidResourceStateFault. - Deleting an endpoint or instance that a task references, or a subnet group that an
instance uses, returns
InvalidResourceStateFault. A delete returns the resource with statusdeleting, and it is gone from the next describe.
Tagging
Tags on every create are stored with the resource, and the tagging trio works against
the resource's ARN. For a subnet group that is
arn:aws:dms:<region>:<account>:subgrp:<identifier>; DMS does not return that ARN from
DescribeReplicationSubnetGroups, so Terraform builds it client side and Floci parses it
back the same way. Endpoints, instances and tasks are tagged through the ARN their create
returned.
AddTagsToResourcemerges by key, so re-tagging an existing key overwrites its value.RemoveTagsFromResourceremoves the named keys and ignores keys that are not present.ListTagsForResourceaccepts eitherResourceArnorResourceArnList. Each returned tag carries itsResourceArnonly for theResourceArnListform, which is the form AWS documents it on.- Tag keys are 1 to 128 characters, values at most 256, and neither may start with
aws:ordms:. - An ARN that is unparseable, names a different DMS resource type, names another account
or Region, or names a group that does not exist returns
ResourceNotFoundFault. Tagging is not a cross-account or cross-Region operation on AWS and is not one here either. - Deleting a resource deletes its tags with it.
IAM enforcement
With IAM enforcement on, each action is checked on the resources the AWS Service Authorization
Reference lists for it, read from the request. The reference ends each DMS type's ARN format in a
wildcard where the resource goes (arn:aws:dms:<region>:<account>:endpoint:*); the DMS User Guide
gives what goes there (arn:aws:dms:region:account number:resourcetype:resourcename), and Floci
reads each format that way. So a request naming an endpoint, a replication instance or a task by its
ARN, and the tagging calls, are checked on that ARN. A request naming a resource by its identifier
is checked on the resource Floci finds under it: an endpoint's, an instance's or a task's ARN ends
in an id DMS mints, not in the identifier, and a subnet group's ends in its identifier. A create of
an endpoint, a replication instance or a certificate is checked with that id open (rep:*), as AWS
answers it with an ARN its request does not give; a subnet group or event subscription create is
checked on the name its request gives, which its ARN ends in. An identifier that names nothing Floci
holds, such as the new name a modify gives, is checked on the ARN it would give. A request leaving
out an optional ARN, such as a CreateEndpoint with no CertificateArn, names the certificate DMS
uses for one naming none, and DMS has none; a replication instance whose create names no subnet
group is checked on the account's default subnet group, which DMS puts it in. A condition on
aws:ResourceTag reads the tags of an endpoint, an instance, a task or a subnet group.
Limitations
- No migration runs. A started task stays
runninguntil stopped; a full-load task never finishes on its own, andReplicationTaskStats,StopReasonandLastFailureMessageare not reported. - Values AWS fills in are not invented. An endpoint does not report
EngineDisplayName,ExternalIdor the settings structure AWS derives from top-level connection fields, and a task withoutReplicationTaskSettingsreports none rather than the AWS defaults. Instances report no private or public IP addresses. CdcStartTimeis ignored.CreateReplicationTask,ModifyReplicationTaskandStartReplicationTaskaccept it, but it is not stored or returned.CdcStartPositionandCdcStopPositionare stored by create and modify, and ignored byStartReplicationTask.- Not implemented:
TestConnection,DescribeConnections,MoveReplicationTask,DescribeEndpointTypes,DescribeOrderableReplicationInstances, replication configs (aws_dms_replication_config, serverless DMS), event subscriptions, certificates and theWithoutSettingsflag ofDescribeReplicationTasks. - No
ModifyReplicationSubnetGroup. A subnet change has to be a delete and recreate.
See the AWS DMS API Reference.
Configuration
| Variable | Default | Description |
|---|---|---|
FLOCI_SERVICES_DMS_ENABLED |
true |
Enable or disable DMS |