fix(cloudfront): preserve distribution WebACLId (#8707)

CloudFront now reads WebACLId, the member name the CloudFront API uses, on CreateDistribution and UpdateDistribution, and writes it under that name in GetDistributionConfig, GetDistribution and ListDistributions, where the summary now carries the stored value instead of an empty one. An empty WebACLId clears the association, and the earlier WebAclId spelling is still accepted on input when WebACLId is absent.

Part of #8645
This commit is contained in:
Jimmy Liu Jia authored and GitHub committed 2026-11-17 05:21:56 -04:00
1 parent 8b2d21498b
commit 3c54534a3d
2 files changed
+132 -8

No files matched your search

@@ -13,6 +13,7 @@ import org.jboss.logging.Logger;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
@@ -1900,7 +1901,7 @@ public class CloudFrontController {
.elem("HttpVersion", cfg.getHttpVersion() != null ? cfg.getHttpVersion() : "http2")
.elem("PriceClass", cfg.getPriceClass() != null ? cfg.getPriceClass() : "PriceClass_All")
.elem("IsIPV6Enabled", cfg.isIPV6Enabled())
.elem("WebAclId", cfg.getWebAclId() != null ? cfg.getWebAclId() : "");
.elem("WebACLId", cfg.getWebAclId() != null ? cfg.getWebAclId() : "");
List<Origin> origins = cfg.getOrigins();
xml.raw(xmlQuantityItems("Origins", "Origin", origins != null ? origins.size() : 0,
@@ -2367,6 +2368,7 @@ public class CloudFrontController {
}
private String xmlDistributionSummary(Distribution d) {
DistributionConfig cfg = d.getConfig();
XmlBuilder xml = new XmlBuilder()
.start("DistributionSummary")
.elem("Id", d.getId())
@@ -2383,9 +2385,9 @@ public class CloudFrontController {
.elem("PriceClass", d.getConfig() != null && d.getConfig().getPriceClass() != null
? d.getConfig().getPriceClass() : "PriceClass_All")
.elem("IsIPV6Enabled", d.getConfig() != null && d.getConfig().isIPV6Enabled())
.elem("WebAclId", "");
.elem("WebACLId", cfg != null && cfg.getWebAclId() != null
? cfg.getWebAclId() : "");
DistributionConfig cfg = d.getConfig();
List<Origin> origins = cfg != null ? cfg.getOrigins() : null;
xml.raw(xmlQuantityItems("Origins", "Origin",
origins != null ? origins.size() : 0,
@@ -2665,7 +2667,8 @@ public class CloudFrontController {
values.getOrDefault("PriceClass", "PriceClass_All"));
cfg.setIPV6Enabled("true".equalsIgnoreCase(
values.getOrDefault("IsIPV6Enabled", "true")));
cfg.setWebAclId(values.get("WebAclId"));
cfg.setWebAclId(values.containsKey("WebACLId")
? values.get("WebACLId") : values.get("WebAclId"));
cfg.setContinuousDeploymentPolicyId(
values.get("ContinuousDeploymentPolicyId"));
cfg.setStaging("true".equalsIgnoreCase(
@@ -2744,6 +2747,7 @@ public class CloudFrontController {
"HttpVersion",
"PriceClass",
"IsIPV6Enabled",
"WebACLId",
"WebAclId",
"ContinuousDeploymentPolicyId",
"Staging" -> true;