fix(ses): return DeliveryOptions from v1 DescribeConfigurationSet (#2841)

PutConfigurationSetDeliveryOptions already persisted the TLS policy — v2
GetConfigurationSet returned it correctly — but the v1 projection never
read it back, omitting the DeliveryOptions member even when deliveryOptions
was named in ConfigurationSetAttributeNames.

The Terraform provider reads aws_ses_configuration_set through the v1
DescribeConfigurationSet, so the missing member made every plan re-add a
delivery_options block that apply never converged.

The two APIs spell the enum differently and the write path already
normalises v1 Require/Optional to the stored REQUIRE/OPTIONAL; the read
path converts back, so each API answers in its own casing.
This commit is contained in:
Brian Taylor authored and GitHub committed 2026-08-31 21:45:09 -04:00
1 parent 10ce6be8cd
commit 7473c57720
3 files changed
+124 -1

No files matched your search

@@ -770,6 +770,12 @@ public class SesQueryHandler {
.elem("CustomRedirectDomain", cs.getTrackingOptions().getCustomRedirectDomain())
.end("TrackingOptions");
}
if (attrs.contains("deliveryOptions") && cs.getDeliveryOptions() != null
&& cs.getDeliveryOptions().getTlsPolicy() != null) {
xml.start("DeliveryOptions")
.elem("TlsPolicy", toV1TlsPolicy(cs.getDeliveryOptions().getTlsPolicy()))
.end("DeliveryOptions");
}
return Response.ok(AwsQueryResponse.envelope("DescribeConfigurationSet",
AwsNamespaces.SES, xml.build())).build();
}
@@ -951,6 +957,19 @@ public class SesQueryHandler {
"PutConfigurationSetDeliveryOptions", AwsNamespaces.SES)).build();
}
/**
* V1 spells the TLS policy {@code Require}/{@code Optional}; Floci stores the V2 canonical
* {@code REQUIRE}/{@code OPTIONAL} that {@link #handlePutConfigurationSetDeliveryOptions}
* normalises to. Anything unrecognised is passed through unchanged rather than mangled.
*/
private static String toV1TlsPolicy(String stored) {
return switch (stored) {
case "REQUIRE" -> "Require";
case "OPTIONAL" -> "Optional";
default -> stored;
};
}
private Response handleCreateReceiptRuleSet(MultivaluedMap<String, String> params, String region) {
sesService.createReceiptRuleSet(getParam(params, "RuleSetName"), region);
return Response.ok(AwsQueryResponse.envelopeEmptyResult(