Commit Graph
4 Commits
Author SHA1 Message Date
Allen Sanborn 20b7a3673e fix(dms): accept explicit default subnet group on CreateReplicationInstance (#5820)
* fix(dms): accept explicit default subnet group on CreateReplicationInstance

CreateReplicationInstance with ReplicationSubnetGroupIdentifier=default
(any case) returned ResourceNotFoundFault because only stored groups were
consulted. AWS creates the default group on first use, so naming it
explicitly is one way it comes into existence. It is now accepted whenever
the region has default subnets, and the instance then makes it listed,
keeping the rule that default is listed only once an instance uses it.

* fix(dms): resolve the instance subnet group only after create validations

CreateReplicationInstance resolved ReplicationSubnetGroupIdentifier=default
before the duplicate-identifier, ResourceIdentifier and tag checks. Resolving
default reads the region's subnets, which seeds its default VPC, so a request
rejected by a later check still left a default VPC and subnets behind. The
group is now resolved after every other check has passed, just before the
instance is stored; successful requests behave as before.
2026-10-17 08:07:21 -04:00
Allen Sanborn 23e1b3a97c fix(dms): list the default replication subnet group (#5771)
* fix(dms): list the default replication subnet group

DescribeReplicationSubnetGroups read stored groups only, so filtering on
"default" faulted with ResourceNotFoundFault and the unfiltered list
omitted the group that replication instances created without one report.
Resolve both paths through findReplicationSubnetGroup, which synthesises
"default" from the region's default-VPC subnets.

* fix(dms): list the default subnet group only once an instance uses it

AWS creates the default replication subnet group the first time an
instance needs it, so a region with default subnets but no such instance
has no default group. DescribeReplicationSubnetGroups now lists and
resolves default only while a replication instance in the region was
created without a subnet group, and checks that before calling EC2, so
an unused default never seeds the region's default VPC.
2026-10-16 07:34:57 -04:00
Allen Sanborn e7ca2ece22 feat(dms): add endpoint, replication instance and replication task lifecycles (#5001)
* feat(dms): add endpoint, replication instance and replication task lifecycles

DMS dispatched only replication subnet groups and tagging, so CreateEndpoint,
CreateReplicationInstance, CreateReplicationTask and their siblings answered
UnknownOperationException and no aws_dms_endpoint, aws_dms_s3_endpoint,
aws_dms_replication_instance or aws_dms_replication_task could be applied.

Adds Create/Describe/Modify/Delete for endpoints, replication instances and
replication tasks, plus Start/StopReplicationTask, which the provider calls for
start_replication_task and before modifying or deleting a running task.

- Resources are ARN-addressed (endpoint:, rep:, task:) with a 26-character
  generated id or the caller's ResourceIdentifier, and tagged through the
  existing tagging operations.
- Instances are available and tasks ready from creation, the states the
  provider's waiters target; describe filters follow the API reference and a
  filter that matches nothing is ResourceNotFoundFault.
- Endpoint settings structures round-trip, minus every SecretString member;
  ModifyEndpoint merges them unless ExactSettings is true.
- Deleting an endpoint or instance a task uses, a subnet group an instance
  uses, or a running task is InvalidResourceStateFault.

The unsupported-operation test now uses CreateReplicationConfig, which is still
unimplemented.

* style(dms): order DmsService imports alphabetically

* docs(dms): list CdcStartTime and the missing describe actions as unimplemented

* test(dms): cover tag add and remove on endpoint, instance and task ARNs

* fix(dms): runtime-init DmsService, resolve the default subnet group, reject reversed task endpoints

- Register DmsService under --initialize-at-run-time: its static SecureRandom
  otherwise lands in the native image heap (guard test and native builds).
- Store only the three members KerberosAuthenticationSettings models instead of
  a deep copy of whatever the caller sent.
- An instance created without a subnet group now describes the "default" group
  in full (VPC, subnets, status) from the region's default-VPC subnets.
- CreateReplicationTask rejects a source ARN that is not a SOURCE endpoint and a
  target ARN that is not a TARGET endpoint.

* fix(dms): name the swallowed default-subnet exception, sync the DMS matrix count

The default-subnet fallback deliberately swallows AwsException; name it
`ignored` and say why that is safe, per AGENTS.md.

docs/services/index.md listed DMS at 6 operations; the handler dispatches 20.

Add the reverse of the reversed-endpoints test: a source endpoint passed as
TargetEndpointArn, which is the only test reaching the TARGET type check.
2026-10-05 14:14:15 -04:00
Allen Sanborn 532bae5525 feat(dms): add replication subnet group lifecycle and tagging (#3630)
* feat(dms): add replication subnet group lifecycle

AWS DMS was entirely absent, so every terraform-aws-data-storage example
using aws_dms_replication_subnet_group failed at plan with
UnknownOperationException.

Adds a minimal dms service on AWS JSON 1.1 (X-Amz-Target prefix
AmazonDMSv20160101.) implementing CreateReplicationSubnetGroup,
DescribeReplicationSubnetGroups and DeleteReplicationSubnetGroup.
Subnets are resolved against the emulated EC2 service, so the VpcId and
Availability Zones a group reports are the ones its subnets actually
have, and AWS's own rules are enforced: the identifier is stored
lowercase, "default" is reserved, subnets must share a VPC, and a group
must cover at least two Availability Zones.

Tagging actions and replication instances, endpoints and tasks are out
of scope and still report UnknownOperationException.

* feat(dms): add resource tagging for replication subnet groups

Terraform's aws_dms_replication_subnet_group reads tags back through
ListTagsForResource, so without the tagging trio the resource could be
created but never read cleanly.

Adds ListTagsForResource, AddTagsToResource and RemoveTagsFromResource,
and stores the Tags member of CreateReplicationSubnetGroup with the
group. DMS does not return a subnet group ARN from describe, so the
provider builds arn:aws:dms:<region>:<account>:subgrp:<id> client side;
Floci parses that form back to the stored group and rejects anything
else, including another account's ARN, with ResourceNotFoundFault.

* fix(dms): address review findings

Emit IsReadOnly on ReplicationSubnetGroup, the one member of the model's
seven the response was missing. It is always false: a read-only group is
one DMS manages for a zero-ETL integration, which Floci does not emulate.

Fault a cross-Region ARN the way a cross-account one already faulted.
Storage is keyed by the caller's Region, so honouring an eu-west-1 ARN
from a us-east-1 caller silently reached the caller's own group of that
name rather than the one named.

Reject a subnet with no Availability Zone as InvalidSubnet. Set.copyOf
rejects nulls, so such a subnet raised a NullPointerException and
surfaced as a 500 instead of a client error.

Adds the user-realistic minimum-AZ case: two subnets sharing one AZ,
which the previous tests did not cover because they passed one subnet.

* fix(dms): reject wrongly-typed tag, filter and arn-list members

A present member of the wrong JSON type was coerced rather than
rejected. asText() on an object yields the empty string, so a tag whose
Value was an object stored an empty value and reported success; a
Filters or ResourceArnList member that was not a list was ignored
outright, which turned a filtered describe into an unfiltered one.

Every string member now answers SerializationException when it is
present with another JSON type, matching what AWS returns when a
json-1.1 member will not deserialize, and matching how Kinesis, Cognito
and KMS already report the same class of error here. An absent member
stays a parameter error: missing and mistyped are different faults.

* fix(dms): paginate DescribeReplicationSubnetGroups and validate the description

DescribeReplicationSubnetGroups returned every matching group in one response and
ignored both MaxRecords and Marker, so an SDK or Terraform paginator diverged from a
live account as soon as more than one page of groups existed.

Page through the shared opaque-cursor helper, keyed on the group identifier, so a
Marker stays resumable across groups created or deleted between requests. MaxRecords
defaults to 100 and is rejected outside the documented 20 to 100 range rather than
clamped, with the InvalidParameterValueException a live account answers. Marker is
emitted only while a further page remains: an SDK paginator treats any Marker as "ask
again", so one on the final page loops forever.

ReplicationSubnetGroupDescription now also enforces the model's printable-character
constraint, so a value carrying a control character such as 0x01 is rejected instead
of persisted.

* docs(dms): describe the Marker as the opaque cursor it is

* fix(test): DmsTest must compile at the sdk-test-java module's Java 17 target

List.getFirst() is a Java 21 SequencedCollection method. The main project
compiles at 21, but compatibility-tests/sdk-test-java pins source/target 17, and
DmsTest was the only file in that module using getFirst() -- so the native arm64
sdk-test-java image failed to build and every test in it was skipped.

This was not caught earlier because the previous head of this PR had no CI
rollup at all; the merge that made the branch mergeable is what first ran the
job. Replaced with get(0), which is what the rest of the module uses.

* style(test): import Objects and Collectors instead of naming them inline

AGENTS.md asks for imports rather than inline fully-qualified names.
DmsServiceTest had two: java.util.Objects::nonNull and
java.util.stream.Collectors.toMap. Neither was imported; both now are.
2026-09-21 19:45:01 -04:00