fix(acm): retain certificate tags during reimport (#8119)

Keep the current tags when replacing an imported certificate under its
existing ARN. Certificate.setTags already copies the map and normalizes
null, so use that boundary for initial imports and reimports alike.

Cover tag retention and replacement material through the AWS SDK in
commercial and GovCloud regions, including later tag additions/removals
and an untagged certificate.

Signed-off-by: Andre Kurait <akurait@amazon.com>
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Co-authored-by: Andre Kurait <akurait@amazon.com>
This commit is contained in:
Jackson PriceandAndre Kurait authored and GitHub committed 2026-11-12 11:15:12 -04:00
1 parent 654473f754
commit c0a087a597
4 files changed
+118 -1

No files matched your search

@@ -478,7 +478,7 @@ public class AcmService implements ResourceProvider {
cert.setCertificateBody(certificatePem);
cert.setPrivateKey(privateKeyPem);
cert.setCertificateChain(chainPem);
cert.setTags(tags != null ? new HashMap<>(tags) : new HashMap<>());
cert.setTags(existing != null ? existing.getTags() : tags);
String storageKey = regionKey(region, certId);
if (existing != null && existing.getInUseBy() != null) {