<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Feng He on Medium]]></title>
        <description><![CDATA[Stories by Feng He on Medium]]></description>
        <link>https://medium.com/@frankhe.cn?source=rss-b83a1df9fe6c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*OGkvwDOsw75rXKKU.</url>
            <title>Stories by Feng He on Medium</title>
            <link>https://medium.com/@frankhe.cn?source=rss-b83a1df9fe6c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:45:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@frankhe.cn/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[47-Day TLS Certificates: What They Mean for mTLS on AWS]]></title>
            <link>https://medium.com/@frankhe.cn/47-day-tls-certificates-what-they-mean-for-mtls-on-aws-3ce510ef2e75?source=rss-b83a1df9fe6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ce510ef2e75</guid>
            <category><![CDATA[aws-certificate-manager]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[mtls-authentication]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws-acm]]></category>
            <dc:creator><![CDATA[Feng He]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 08:17:24 GMT</pubDate>
            <atom:updated>2026-10-12T08:25:54.228Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have bought or renewed a public SSL/TLS certificate recently, you probably noticed it is valid for about 200 days, where it used to be 398. This applies to every publicly trusted certificate, whether it comes from DigiCert, Sectigo, Let’s Encrypt or AWS Certificate Manager (ACM). The whole industry is reducing the maximum lifetime of public TLS certificates in stages, down to 47 days in 2029.</p><p>The focus here is AWS workloads; other clouds have different certificate services.</p><p>On AWS, how much the change affects you depends on where the certificate is used and who installs it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vAZBIvq0zkfEoOFRw7JjeA.png" /></figure><p>Standard ACM certificates work only on AWS services, where they are free and <a href="https://docs.aws.amazon.com/acm/latest/userguide/dns-renewal-validation.html">renew automatically </a>as long as they use DNS validation and stay attached to a service. When you need the private key, for servers in your own data center, a third-party gateway or a Kubernetes cluster, use an ACME client with Let’s Encrypt or <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-acme.html">ACM’s ACME endpoint </a>, or <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-exportable-certificates.html">ACM exportable certificates </a>with automated export. Certificates bought from a commercial CA and renewed by hand go from about one renewal a year to about eight by 2029, but that work stays inside your own team.</p><p>Automating your own side does not solve the third case: the partner must also change its certificate. That is the focus of the rest of this article.</p><h3>1. What changed, and why lifetimes keep getting shorter</h3><p>In April 2025 the CA/Browser Forum passed <a href="https://cabforum.org/2025/04/11/ballot-sc081v3-introduce-schedule-of-reducing-validity-and-data-reuse-periods/">Ballot SC-081v3 </a>. It reduces the maximum validity of publicly trusted TLS certificates, and also how long a CA may reuse an earlier domain control validation (DCV), the check that you control the domain:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4lGj27Wm0HODuAVrJmwJQ.png" /></figure><p>This continues a long trend. Before 2012 there was no common limit and certificates valid for five years or more were normal. The limit then went to 60 months (2012), 39 months (2015), 825 days (2018) and 398 days (2020). Browsers pushed the recent cuts because revocation does not work reliably and shorter lifetimes limit the time in which a stolen key or wrongly issued certificate can be used. Sections 2 and 3 explain who the CA/Browser Forum is, why it can set these limits, and why browsers want shorter lifetimes.</p><h3>2. The CA/Browser Forum, and why it can set these limits</h3><h3>2.1 The CA/Browser Forum</h3><p>The <a href="https://cabforum.org/">CA/Browser Forum </a>is a voluntary group with two kinds of members. Certificate Issuers are the Certificate Authorities (CAs), such as DigiCert, Sectigo, GlobalSign and Let’s Encrypt. Certificate Consumers are the companies whose software decides whether to trust a certificate, mainly Google, Apple, Mozilla and Microsoft.</p><p>The Forum publishes the Baseline Requirements, the minimum rules every public CA must follow: how domains are validated, how long certificates may last, which extensions they may contain. It began around 2005, when validation practices varied widely between CAs.</p><h3>2.2 Where the power comes from</h3><p>The Forum has no legal authority of its own. Its rules work because of the root stores.</p><p>Every browser and operating system ships with a list of trusted root CA certificates. Google, Apple, Mozilla and Microsoft control much of the software that uses those lists: Google makes Chrome, Android and ChromeOS; Apple makes Safari, iOS and macOS; Mozilla makes Firefox; and Microsoft makes Windows and Edge. Because the list ships inside their products, each of them runs a root program that decides which CAs are on it. If any one of these four companies removes a CA’s root certificate from its root store, every certificate issued under it shows a full-page security warning on that company’s browsers or devices. No customer can accept that for, say, every iPhone or every Chrome user, so for a commercial CA a single removal ends the business.</p><p>CAs and browsers vote on Forum rules, but root programs can impose additional requirements. In a disagreement, a root program can set the effective rule for the certificates it trusts. That influence grew through responses to CA failures.</p><h3>2.3 CA failures</h3><p>The main cases where browsers stopped trusting a public CA:</p><ul><li>DigiNotar, 2011: The Dutch CA was hacked and the attacker issued hundreds of fraudulent certificates, including one for *.google.com that was used to intercept the traffic of users in Iran. DigiNotar knew about the intrusion for weeks before it became public. Browsers removed it and the company went bankrupt the same month. (<a href="https://www.eff.org/deeplinks/2011/09/post-mortem-iranian-diginotar-attack">EFF </a>, <a href="https://www.computerworld.com/article/1432585/hackers-stole-google-ssl-certificate-dutch-firm-admits-2.html">Computerworld </a>)</li><li>WoSign and StartCom, 2016: Mozilla found a long list of problems, including backdated certificates to get around the SHA-1 deadline, and WoSign hiding the fact that it had bought StartCom. Mozilla and Google stopped trusting new certificates from both. (<a href="https://blog.mozilla.org/security/2016/10/24/distrusting-new-wosign-and-startcom-certificates/">Mozilla </a>)</li><li>Symantec, 2017: Then one of the largest CAs, owning the VeriSign, Thawte, GeoTrust and RapidSSL brands. Investigations found large numbers of certificates issued without proper validation. Chrome removed trust in stages and Symantec sold the business to DigiCert. (<a href="https://security.googleblog.com/2017/09/chromes-plan-to-distrust-symantec.html">Google </a>, <a href="https://wiki.mozilla.org/CA/Symantec_Issues">Mozilla </a>)</li><li>Camerfirma, 2021: Distrusted after years of compliance problems that were not fixed. (<a href="https://www.theregister.com/2021/02/02/chrome_camerfirma_certificates/">The Register </a>)</li><li>TrustCor, 2022: Removed by Mozilla, Microsoft and then Google after press reports linked it to spyware vendors. (<a href="https://www.techtarget.com/cybersecurity/news/252527914/Mozilla-Microsoft-drop-Trustcor-as-root-certificate-authority">TechTarget </a>)</li><li>Entrust, 2024: A large and long-established CA. Google stopped trusting its new certificates after a pattern of compliance failures, and Entrust later sold its public certificate business to Sectigo. (<a href="https://security.googleblog.com/2024/06/sustaining-digital-certificate-security.html">Google </a>)</li></ul><p>None of these CAs recovered. And in each case, once a CA had misbehaved, there was no reliable way to deal with the certificates it had already issued.</p><h3>2.4 How browsers took control</h3><p>After DigiNotar, Google engineers designed <a href="https://certificate.transparency.dev/community/">Certificate Transparency </a>(CT). Public certificates must be written to public, append-only logs, and Chrome and Safari reject certificates that are not logged. Domain owners can watch the logs and see every certificate issued for their names, so mis-issuance can no longer stay hidden.</p><p>Browsers also stopped giving EV certificates special treatment. Public certificates were sold at three levels. For DV (Domain Validated) the CA only checks domain control. OV (Organization Validated) adds a check that the organization exists. EV (Extended Validation) is a stricter check of legal identity, and browsers used to reward it by showing the company name in green next to the URL. EV certificates cost much more.</p><p>In 2019 <a href="https://www.zdnet.com/article/google-mozilla-were-changing-what-you-see-in-chrome-firefox-address-bars/">Chrome 77 and Firefox 70 removed the EV indicator </a>. Google’s Chrome Security UX team had <a href="https://www.computerworld.com/article/1657214/chrome-firefox-to-expunge-extended-validation-cert-signals.html">concluded from its own research and academic studies </a>that the indicator did not change what users did. It could also be faked: in 2017 a researcher registered a company called “Stripe, Inc” in Kentucky for about $100 and bought an EV certificate for it for $77. Safari showed “Stripe, Inc” in the address bar, exactly as it did for the real payment company in Delaware. (<a href="https://arstechnica.com/information-technology/2017/12/nope-this-isnt-the-https-validated-stripe-website-you-think-it-is/">Ars Technica </a>, <a href="https://simonwillison.net/2017/dec/12/extended-validation-is-broken">Simon Willison </a>)</p><p>Since then DV, OV and EV certificates look the same in a browser. To the browser, a certificate only proves that the server controls the domain name. OV and EV checks can still matter for some contracts or compliance requirements, but users no longer see them, and CAs lost one of their most profitable products.</p><p>The longest fight was over lifetimes. In 2019 Google proposed <a href="https://cabforum.org/2019/09/10/ballot-sc22-reduce-certificate-lifetimes-v2/">Ballot SC22 </a>to cut the maximum lifetime to about a year. All browsers voted for it and <a href="https://securityboulevard.com/2019/09/ssl-certificates-one-year-max-validity-ballot-fails-at-the-ca-b-forum/">the CAs voted it down </a>.</p><p>In February 2020 Apple announced that Safari would <a href="https://support.apple.com/en-au/HT211025">not trust certificates issued after 1 September 2020 with a validity over 398 days </a>. There was no vote. Safari runs on every iPhone and Mac, so CAs had to comply, and the other browsers adopted the same limit. (<a href="https://www.zdnet.com/article/apple-strong-arms-entire-ca-industry-into-one-year-certificate-lifespans">ZDNet </a>)</p><p>In 2025 Apple proposed the 47-day schedule. This time a CA, Sectigo, sponsored it, and it <a href="https://cabforum.org/2025/04/11/ballot-sc081v3-introduce-schedule-of-reducing-validity-and-data-reuse-periods/">passed with no votes against </a>. After 2020 the CAs knew the browsers could impose the change through their root programs if the ballot failed.</p><h3>3. Why not rely on revocation?</h3><p>Certificates already have a way to be withdrawn before they expire: revocation. If it worked well, lifetimes would matter much less.</p><p>There are two mechanisms. With a CRL (Certificate Revocation List), the CA publishes a list of revoked serial numbers for clients to download. With OCSP (Online Certificate Status Protocol), the client asks the CA’s server about a specific certificate during the connection.</p><p>Both work badly in practice. If the client cannot reach the CRL or OCSP server, most clients continue anyway (soft-fail), and an attacker who can intercept the connection can usually block the check too. In 2012 Google engineer Adam Langley called soft-fail checks <a href="https://www.wired.com/2012/02/google-to-strip-chrome-of-ssl-revocation-checking/">“a seat-belt that snaps when you crash” </a>, and Chrome replaced online checks with its own centrally distributed list. Checks also add latency to the handshake, and OCSP tells the CA which sites each user visits. Privacy was one of the main reasons <a href="https://letsencrypt.org/2025/08/06/ocsp-service-has-reached-end-of-life.html">Let’s Encrypt shut down OCSP in August 2025 </a>.</p><p>Without reliable revocation, the expiry date is the only dependable limit on a stolen key or a wrongly issued certificate. That is the main argument for short lifetimes. A compromised certificate valid for 47 days is useful to an attacker for about an eighth as long as one valid for 398 days.</p><p>There are two further arguments. A certificate only proves someone controlled the domain when it was validated. Domains change hands, DNS records change, and cloud resource names are reused, so limiting the reuse of domain control validation to 10 days keeps that proof recent. And lifetimes this short make manual renewal impractical. Once renewal is automated everywhere, the ecosystem can react quickly when a CA has to be distrusted or an algorithm has to be replaced, for example in a move to post-quantum cryptography. Certificates renewed by hand once a year cannot be replaced quickly.</p><h3>4. How Let’s Encrypt made short lifetimes practical</h3><p><a href="https://www.eff.org/deeplinks/2014/11/certificate-authority-encrypt-entire-web">Let’s Encrypt was announced in November 2014 </a>by the Internet Security Research Group (ISRG), a non-profit backed by Mozilla, the EFF, the University of Michigan and others, and began issuing certificates in late 2015.</p><p>It was created to get more of the web onto HTTPS, not in response to the CA failures. Certificates cost money, and the EFF found that installing one by hand typically took a developer one to three hours. Let’s Encrypt made certificates free and automated issuance through a new protocol, ACME (Automatic Certificate Management Environment), now an IETF standard (RFC 8555) that most CAs support.</p><p>It also changed the balance between browsers and CAs. Its certificates have always been valid for only 90 days, and it became the largest CA on the web by number of certificates. That showed short lifetimes work at very large scale, and ACME gave everyone a free way to automate renewal. When browsers pushed for shorter lifetimes, CAs could no longer argue that customers would not cope.</p><p>Let’s Encrypt is still ahead of the rules:</p><ul><li>It <a href="https://letsencrypt.org/2025/12/02/from-90-to-45">is reducing its default lifetime from 90 to 45 days </a>, in stages until 2028.</li><li><a href="https://letsencrypt.org/2026/01/15/6day-and-ip-general-availability.html">6-day certificates and certificates for IP addresses are generally available </a>. IP address certificates are only offered with the short lifetime.</li><li>It <a href="https://letsencrypt.org/2025/08/06/ocsp-service-has-reached-end-of-life.html">shut down OCSP </a>in 2025.</li><li>It <a href="https://letsencrypt.org/upcoming-features/">no longer issues certificates with the TLS Client Authentication EKU </a>. This was removed from the default profile on 11 February 2026, and the temporary tlsclient profile was retired on 8 July 2026.</li></ul><h3>5. The second change: clientAuth is leaving public certificates</h3><h3>5.1 What mTLS is</h3><p>In normal TLS only the client verifies the server. Your browser checks that the certificate matches the domain and chains to a trusted root, but the server does not learn who the client is at the TLS layer. If it needs to know, it uses a password, an API key or an OAuth token at the application layer.</p><p>Mutual TLS (mTLS) adds the other direction. The client also presents a certificate and proves it holds the private key, and the server checks it during the handshake, before any application data is sent.</p><p>It is mostly used between machines:</p><ul><li>APIs between organizations, such as a company and a payment provider, bank or partner. Many payment and open-banking standards require it.</li><li>Traffic between services inside a company, for example in a service mesh or a zero-trust network.</li><li>Devices and clients such as IoT devices, company laptops and VPN clients.</li></ul><p>Compared with an API key, the secret is never sent over the network, a stolen certificate is useless without its private key, and the key can be kept in hardware or a secrets store. Clients without a valid certificate are rejected before they reach the application.</p><p>The external-partner case is the focus here because renewal requires people in two organizations.</p><p>The handshake has one certificate check in each direction:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4_tDi2RO31Sx6bIk" /></figure><p>On AWS, the server side of this is supported directly. An Application Load Balancer in <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/configuring-mtls-with-elb.html">mTLS verify mode </a>checks client certificates against a trust store that holds your CA bundle, and API Gateway does the same for <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mutual-tls.html">Regional custom domain names </a>with a trust store file in S3. Your own server certificate can still be a normal ACM certificate that renews automatically. The difficult part is the client certificate the partner presents.</p><h3>5.2 What clientAuth is</h3><p>A certificate can contain an Extended Key Usage (EKU) extension that lists permitted uses. Two values matter here. serverAuth (TLS Web Server Authentication) identifies a server and is the EKU browsers expect for HTTPS. clientAuth (TLS Web Client Authentication) identifies a client; a server may enforce it when validating a client certificate.</p><p>For many years public CAs included both values by default. So many organizations used an ordinary public certificate, bought for a domain name, as the client certificate in mTLS. The partner already trusted the public roots, and nobody had to run a private PKI (Public Key Infrastructure: their own CA and certificate setup).</p><h3>5.3 Why it is being removed</h3><p>The Chrome Root Program now requires public TLS hierarchies in its root store to be used for server authentication only.</p><p>The public Web PKI exists to tell browsers whether a server is the real one for a domain. Client authentication is a different relationship, usually between two specific organizations, and it does not need public trust. Keeping both in one hierarchy also means every change made for the web, such as 47-day lifetimes, breaks the non-web uses, and the non-web uses make the web rules harder to change. Separating them lets each change on its own schedule. A certificate with fewer allowed uses is also less useful to an attacker who steals it.</p><p>The <a href="https://www.encryptionconsulting.com/clientauth-eku-removal-mtls-migration/">Chrome Root Program timeline </a>:</p><ul><li>2026–06–15: new subordinate CAs added to the Chrome root store must be serverAuth-only.</li><li>2027–03–15: all newly issued public TLS leaf certificates must be serverAuth-only.</li></ul><h3>5.4 Failures happen at renewal</h3><p>Nothing breaks on the day the rule takes effect. A certificate you already have keeps working until it expires. The trouble starts at the next renewal. The new certificate, from the same CA and for the same domain, has only serverAuth. It gets installed as the mTLS client certificate as before. If the server on the other side checks the EKU, it rejects the certificate during the handshake. Nothing warns you beforehand. The chain is valid and the dates are valid; only the EKU is wrong.</p><p>Whether the server checks depends on its TLS implementation and configuration. Some servers and API gateways do not check the EKU on client certificates, so a serverAuth-only certificate may keep working, and you can test whether yours does. It is not a safe basis for a design, though. It depends on software and configuration on the other side that you do not control and that can change with any upgrade.</p><h3>6. A different public CA does not solve partner mTLS</h3><p>Both changes apply to every publicly trusted CA. The main providers’ positions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8PgkLhjWBKy299f50FtJPQ.png" /></figure><p>The public providers are responding with renewal automation, not a long-lived public clientAuth product. A partner mTLS design therefore needs a private trust relationship rather than a different Web PKI provider.</p><h3>7. Options for mTLS client certificates on AWS</h3><h3>7.1 Why partner mTLS breaks</h3><p>A client certificate shared with an external partner usually works like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a1ph9z9oQV7rtcD0" /></figure><p>Each renewal needs both organizations. Someone exports the new certificate, sometimes with its private key, and sends it over. The partner schedules a change, installs it, and both sides test. With 47-day public certificates, renewal can be required up to eight times a year, depending on the renewal policy. A missed change can interrupt the integration. From March 2027, public CAs also will not issue clientAuth certificates.</p><h3>7.2 What every option has in common</h3><p>Each option creates a private trust relationship: the server operator adds the agreed root or intermediate certificate to its trust store. That certificate is public information, not a secret, and can remain trusted for years. Browser root programs and CA/Browser Forum rules for public Web PKI do not govern this relationship. Client certificates can include clientAuth, and no industry rule limits their lifetime. A certificate from your own CA can last as long as the CA itself, and X9 PKI certificates can last up to three years. You could issue a ten-year certificate, but if its key were stolen, it would stay usable for ten years. That is the risk short lifetimes exist to limit, so choose a lifetime your security policy accepts.</p><p>The partner should generate the private key and send only a Certificate Signing Request (CSR). The key then remains with the partner rather than being sent between organizations.</p><h3>7.3 The options</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M9Gwkxc6e5coqabNi3Iv_g.png" /></figure><p>AWS Private CA has a fixed monthly CA charge, while commercial and self-hosted options have different pricing and operating models. Compare the total cost against the number of certificates, required integrations, key-protection requirements, and the operating responsibility your team accepts. X9 uses a shared root, so a relying partner must validate the certificate identity as well as its chain.</p><p>AWS Private CA can issue a clientAuth certificate from the EndEntityClientAuthCertificate/V1 <a href="https://docs.aws.amazon.com/privateca/latest/userguide/template-definitions.html">template </a>against a partner CSR through the <a href="https://docs.aws.amazon.com/privateca/latest/userguide/PcaIssueCert.html">IssueCertificate API </a>. Treat expiry tracking and renewal as part of the integration: ACM does not <a href="https://docs.aws.amazon.com/acm/latest/userguide/renew-private-cert.html">renew certificates issued this way </a>.</p><h3>8. Plan the migration</h3><p>Use ACM for public server certificates on AWS services that support it. DNS-validated certificates attached to those services renew automatically. For certificates whose private keys must be exported, automate issuance, export, installation, and renewal with ACM, ACME, or the CA’s tools.</p><p>For partner mTLS, inventory the certificates whose renewal depends on a person in either organization. Test whether the receiving server enforces clientAuth, then agree on a private trust relationship, certificate lifetime, CSR exchange, renewal process, and identity checks before the next public-certificate renewal.</p><h3>References</h3><p>Industry rules</p><ul><li><a href="https://cabforum.org/2025/04/11/ballot-sc081v3-introduce-schedule-of-reducing-validity-and-data-reuse-periods/">CA/Browser Forum Ballot SC-081v3: schedule for reducing validity and data reuse periods</a></li><li><a href="https://googlechrome.github.io/chromerootprogram/">Chrome Root Program</a></li><li><a href="https://support.apple.com/en-au/HT211025">Apple: limits on trusted certificates (398 days)</a></li></ul><p>Public CAs on shorter lifetimes and clientAuth</p><ul><li>DigiCert: <a href="https://www.digicert.com/47-days-tls-ssl-certificates">47-day TLS certificates </a>, <a href="https://knowledge.digicert.com/alerts/sunsetting-client-authentication-eku-from-digicert-public-tls-certificates">removing the client authentication EKU </a>, <a href="https://www.digicert.com/blog/do-you-use-public-tls-certificates-for-mtls">X9 PKI for mTLS</a></li><li>Sectigo: <a href="https://www.sectigo.com/blog/47-day-certificate-era-automation-cant-wait">preparing for 47-day certificates </a>, <a href="https://www.sectigo.com/blog/tls-client-authentication-public-ca-end-2026">TLS client authentication changes in 2026</a></li><li>GlobalSign: <a href="https://www.globalsign.com/en/blog/47-day-tls-certificate-lifespan-what-it-means-for-security-teams">what 47-day certificates mean for security teams</a></li><li>Let’s Encrypt: <a href="https://letsencrypt.org/2025/12/02/from-90-to-45">decreasing certificate lifetimes to 45 days </a>, <a href="https://letsencrypt.org/upcoming-features/">ending TLS client authentication </a>, <a href="https://letsencrypt.org/2025/08/06/ocsp-service-has-reached-end-of-life.html">OCSP end of life</a></li></ul><p>AWS</p><ul><li><a href="https://docs.aws.amazon.com/acm/latest/userguide/dns-renewal-validation.html">ACM managed renewal for DNS-validated certificates</a></li><li><a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-exportable-certificates.html">ACM exportable public certificates</a></li><li><a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-acme.html">ACM ACME certificate automation</a></li><li><a href="https://aws.amazon.com/private-ca/pricing/">AWS Private CA pricing</a></li><li><a href="https://docs.aws.amazon.com/privateca/latest/userguide/template-definitions.html">AWS Private CA certificate templates</a></li><li><a href="https://aws.amazon.com/blogs/security/use-acm-private-ca-for-amazon-api-gateway-mutual-tls/">Use ACM Private CA for Amazon API Gateway mutual TLS</a></li><li><a href="https://aws.amazon.com/blogs/networking-and-content-delivery/introducing-mtls-for-application-load-balancer/">Introducing mTLS for Application Load Balancer</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ce510ef2e75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Made AWS Control Tower (CfCT) Deployments Fail Loud Instead of Silent]]></title>
            <link>https://medium.com/@frankhe.cn/how-we-made-aws-control-tower-cfct-deployments-fail-loud-instead-of-silent-4a9f9a1db0a5?source=rss-b83a1df9fe6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a9f9a1db0a5</guid>
            <category><![CDATA[aws-cfct]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-control-tower]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cloudformation]]></category>
            <dc:creator><![CDATA[Feng He]]></dc:creator>
            <pubDate>Sun, 24 May 2026 17:31:25 GMT</pubDate>
            <atom:updated>2026-05-24T17:42:51.859Z</atom:updated>
            <content:encoded><![CDATA[<p>Our CI/CD pipeline turned green. The CfCT deployment had “succeeded.” Two weeks later, during a security review, we found that several accounts in one OU had been missing a critical baseline configuration the whole time.</p><p>The pipeline wasn’t lying — it just wasn’t watching. When you’re using AWS Control Tower with <a href="https://github.com/aws-solutions/aws-control-tower-customizations">Customizations for AWS Control Tower (CfCT)</a> to deploy baselines across dozens or hundreds of accounts, your CI/CD pipeline’s job ends the moment it uploads a zip file to S3. What happens next — inside AWS CodePipeline, across CloudFormation StackSets, in each member account — is invisible to your pipeline. Green means “uploaded successfully.” It says nothing about whether your accounts actually got the configuration they needed.</p><p>In this post, we share how we closed that gap by wrapping CfCT with pre-deploy checks and post-deploy verification. We’ll walk through the specific failure modes we encountered, and the scripts we wrote to make deployments fail loud instead of failing silently.</p><h3>Background</h3><h3>AWS Control Tower</h3><p><a href="https://docs.aws.amazon.com/controltower/latest/userguide/what-is-control-tower.html">AWS Control Tower</a> is a managed service that helps organizations set up and govern a secure, multi-account AWS environment. Built on top of AWS Organizations, it provides a landing zone with Account Factory, preventive and detective controls (guardrails), centralized logging, and audit capabilities. For enterprises managing tens or hundreds of AWS accounts, Control Tower is the starting point for establishing a well-governed cloud foundation.</p><p>Control Tower provides a solid baseline, but every organization has its own security standards, compliance requirements, and operational configurations that need to be deployed across all accounts — things like standardized IAM roles, log forwarding, security service integrations, and network baselines. These customizations go beyond what the Control Tower console offers.</p><h3>Customizations for AWS Control Tower (CfCT)</h3><p><a href="https://github.com/aws-solutions/aws-control-tower-customizations">CfCT</a> addresses this gap. It’s an open-source solution (see also the <a href="https://docs.aws.amazon.com/controltower/latest/userguide/cfct-overview.html">AWS docs</a>) that lets you declaratively define CloudFormation templates and SCPs in a manifest file, then distribute them to target OUs and accounts via StackSets.</p><p>CfCT capabilities include:</p><ul><li>Declarative multi-account configuration management through manifest.yaml</li><li>CloudFormation StackSet deployments (by OU or by account)</li><li>SCP policy deployments</li><li>Responding to Control Tower lifecycle events (e.g., automatically deploying baselines when new accounts are created)</li><li>Built-in cfn-nag template validation</li></ul><h3>Learning curve and operational complexity</h3><p>The Control Tower + CfCT combination is powerful, but it comes with a steep learning curve:</p><ul><li>AWS Organizations, OU structure, and SCP inheritance</li><li>CloudFormation StackSets mechanics (service-managed vs self-managed, concurrency model, failure tolerance)</li><li>CfCT manifest syntax, deployment ordering, and lifecycle event triggers</li><li>CodePipeline execution model and CfCT’s internal Step Functions orchestration</li></ul><p>When everything works, it’s elegant. When something breaks, the troubleshooting complexity increases significantly. Let’s look at the specific challenges.</p><h3>CfCT core workflow</h3><p>The CfCT deployment flow is straightforward:</p><ol><li>Package configuration (manifest + templates) into a zip file</li><li>Upload to the designated S3 bucket</li><li>S3 event triggers CodePipeline</li><li>CodePipeline deploys to target OUs/accounts via CloudFormation StackSets</li></ol><h3>How teams actually use CfCT</h3><p>In practice, teams don’t manually upload zip files to S3. Configuration files live in version control (GitHub, GitLab, Bitbucket, etc.) and changes flow through a CI/CD pipeline (GitHub Actions, GitLab CI, Jenkins, CircleCI, etc.):</p><ol><li>Engineer modifies configuration on a branch (templates, manifest)</li><li>CI/CD pipeline runs validation (lint, static analysis)</li><li>Changes are merged after code review</li><li>CI/CD pipeline packages and uploads to S3, triggering CfCT’s CodePipeline</li></ol><p>Up to this point, everything is within your CI/CD’s control. But once the zip lands in S3, control passes to the AWS-side CodePipeline. Your CI/CD pipeline considers the job done (upload succeeded), while the actual deployment is just beginning. This is where the feedback gap originates.</p><p>This works fine at small scale. As the organization grows and account count increases, a set of operational challenges emerge.</p><h3>The challenges</h3><h3>1. The feedback gap — deployments fail silently</h3><p>This is the core issue. Your CI/CD pipeline only uploads a zip to S3. Upload succeeds, pipeline shows green. But the actual deployment happens in the CodePipeline → StackSets chain, which is completely disconnected from your CI/CD.</p><p>When a deployment fails, the investigation path looks like this:</p><pre>CI/CD pipeline (green ✅, no indication of problems)<br>  → Open AWS Console, find CodePipeline<br>    → Which stage failed?<br>      - cfn-nag validation?<br>      - SCP deployment?<br>      - StackSet operation?<br>        → CfCT internal StackSet or user-defined?<br>          → Which account/region instance failed?<br>            → Finally see the actual error message</pre><p>This investigation chain is long, unintuitive, and time-consuming. Because CI/CD shows success, deployment failures can go undetected for weeks — a template might be failing silently in certain accounts, or accounts might be missing critical baseline configurations, only surfacing during a security audit or incident investigation.</p><blockquote><em>The community has reported the same friction: </em><a href="https://github.com/aws-solutions/aws-control-tower-customizations/issues/7"><em>Issue #7: Log messages don’t detail which stack/account/region caused the error</em></a></blockquote><h3>2. Orphaned StackSet instances block deployments</h3><p>StackSet instances can enter abnormal states for several reasons:</p><ul><li><strong>Account suspended or closed</strong>: The stack instance becomes SKIPPED_SUSPENDED_ACCOUNT and is never automatically cleaned up</li><li><strong>Account moved to a different OU</strong>: If an account is moved directly in AWS Organizations, the old OU’s StackSet instance remains orphaned and is not automatically detected or cleaned up</li><li><strong>Previous StackSet operation failed or was cancelled</strong>: Instances may be stuck in CANCELLED or INOPERABLE state</li><li><strong>Operation timed out or partially completed</strong>: Instances may remain in PENDING state, blocking new operations</li></ul><p>These leftover instances cause subsequent StackSet operations to fail or hang. When an account is suspended, StackSets marks the instance as SKIPPED_SUSPENDED_ACCOUNT but never removes it — cleanup is the operator’s responsibility. This is a <a href="https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/1177">known behavior</a>. The CfCT repo has a related issue: <a href="https://github.com/aws-solutions/aws-control-tower-customizations/issues/48">#48: Build fails if it finds Suspended Accounts in Organizations</a>.</p><h3>3. StackSet operation conflicts</h3><p>CfCT deploys configurations via StackSets. Each StackSet allows only one in-progress operation at a time. If a new CodePipeline execution is triggered while the previous one is still running (e.g., the pipeline has moved to a later stage and a new execution starts from the beginning), the old and new executions compete for the same StackSets, causing failures or unpredictable results.</p><h3>4. Unregistered OUs fail silently</h3><p>When a new OU is created in the organization but not registered with Control Tower, CfCT silently skips deployment to that OU. No errors, no notifications. It can be a long time before anyone notices that accounts in that OU are missing critical security baselines.</p><h3>5. cfn-nag feedback is slow and inflexible</h3><p>CfCT includes cfn-nag as a built-in template validation step, but there are several issues:</p><ul><li><strong>Slow feedback</strong>: cfn-nag runs inside the CodePipeline Build stage, which contains many steps. It takes time to reach cfn-nag execution</li><li><strong>Logs are hard to find</strong>: cfn-nag failure messages are buried in the middle of CodeBuild logs (not at the end), requiring manual scrolling to locate the cause</li><li><strong>Pinned version</strong>: The cfn-nag version is controlled by AWS; users cannot upgrade independently</li><li><strong>No rule suppression support</strong>: Cannot suppress specific rules at the resource level via the manifest (<a href="https://github.com/aws-solutions/aws-control-tower-customizations/issues/119">Issue #119</a>, open since 2022)</li><li><strong>Uncontrollable scan scope</strong>: Scans all template files, including those not referenced in the manifest (<a href="https://github.com/aws-solutions/aws-control-tower-customizations/issues/46">Issue #46</a>)</li></ul><h3>Solution: Wrapping CfCT with a CI/CD pipeline</h3><p>Our approach is to add pre-deploy checks and post-deploy verification around CfCT’s native flow, creating a closed feedback loop. Here’s the overall architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QGhEXP9yRJVXE1ia64QX3A.png" /><figcaption>architecture</figcaption></figure><h3>Implementation</h3><h3>1. Shift cfn-nag left for fast feedback</h3><p>Run cfn-nag in the earliest stage of your CI/CD pipeline with a pinned version. Get template validation results in seconds instead of waiting for CodePipeline to reach its validation step.</p><pre># CI/CD pipeline stage - runs first<br>lint:<br>  image: ruby:3<br>  script:<br>    - gem install cfn-nag -v 0.7.2  # Pin to match your CfCT version<br>    - cfn_nag ./templates/*.yaml</pre><p>Benefits:</p><ul><li>Feedback time drops from minutes to seconds</li><li>You control the cfn-nag version, pinned to match CfCT for consistent results</li></ul><h3>2. Pre-deploy: Check OU registration</h3><p>Verify that all OUs are registered with Control Tower. If any are unregistered, fail immediately.</p><pre>import boto3<br><br>def get_all_ous(session, parent_id):<br>    &quot;&quot;&quot;Recursively retrieve all OUs under the given parent.&quot;&quot;&quot;<br>    client = session.client(&#39;organizations&#39;)<br>    ous = []<br>    paginator = client.get_paginator(&#39;list_organizational_units_for_parent&#39;)<br>    for page in paginator.paginate(ParentId=parent_id):<br>        for ou in page[&#39;OrganizationalUnits&#39;]:<br>            ous.append(ou)<br>            ous.extend(get_all_ous(session, ou[&#39;Id&#39;]))<br>    return ous<br><br>def check_ou_registered(session, ou_arn):<br>    &quot;&quot;&quot;Check if an OU is registered with Control Tower.&quot;&quot;&quot;<br>    ct_client = session.client(&#39;controltower&#39;)<br>    try:<br>        ct_client.list_enabled_controls(targetIdentifier=ou_arn)<br>        return True<br>    except ct_client.exceptions.ResourceNotFoundException:<br>        return False<br><br># Main<br># ROOT_OU_ID comes from organizations.list_roots() — typically &#39;r-xxxx&#39;.<br># We don&#39;t check the root itself (it&#39;s not a CfCT deployment target);<br># we walk down from it to collect every child OU.<br>session = boto3.Session()<br>ous = get_all_ous(session, ROOT_OU_ID)<br>unregistered = [ou for ou in ous if not check_ou_registered(session, ou[&#39;Arn&#39;])]<br><br>if unregistered:<br>    for ou in unregistered:<br>        print(f&quot;❌ OU not registered: {ou[&#39;Name&#39;]} ({ou[&#39;Id&#39;]})&quot;)<br>    raise SystemExit(&quot;Unregistered OUs found. Register them before deploying.&quot;)<br><br>print(&quot;✅ All OUs registered with Control Tower&quot;)</pre><h3>3. Pre-deploy: Check CodePipeline availability</h3><p>Prevent triggering a new deployment while a previous execution is still running, avoiding StackSet operation conflicts.</p><pre>import boto3<br><br>def check_pipeline_available(session):<br>    &quot;&quot;&quot;Confirm CodePipeline has no in-progress execution.&quot;&quot;&quot;<br>    client = session.client(&#39;codepipeline&#39;)<br>    response = client.list_pipeline_executions(<br>        pipelineName=&#39;Custom-Control-Tower-CodePipeline&#39;<br>    )<br>    summaries = response[&#39;pipelineExecutionSummaries&#39;]<br>    if not summaries:<br>        print(&quot;✅ No previous executions; pipeline is available&quot;)<br>        return<br><br>    latest = summaries[0]<br>    if latest[&#39;status&#39;] == &#39;InProgress&#39;:<br>        raise Exception(<br>            &quot;CodePipeline is currently executing. &quot;<br>            &quot;Wait for it to complete before triggering a new deployment.&quot;<br>        )<br>    print(&quot;✅ CodePipeline is available&quot;)</pre><h3>4. Pre-deploy: Clean up stale StackSet instances</h3><p>Automatically remove instances left behind by suspended accounts, preventing them from blocking subsequent operations.</p><pre>import boto3<br><br>def cleanup_stale_instances(session):<br>    &quot;&quot;&quot;Remove StackSet instances in abnormal states.&quot;&quot;&quot;<br>    cfn = session.client(&#39;cloudformation&#39;)<br><br>    # Find all CfCT-managed StackSets<br>    stack_sets = []<br>    paginator = cfn.get_paginator(&#39;list_stack_sets&#39;)<br>    for page in paginator.paginate(Status=&#39;ACTIVE&#39;):<br>        for ss in page[&#39;Summaries&#39;]:<br>            if &#39;CustomControlTower&#39; in ss[&#39;StackSetName&#39;]:<br>                stack_sets.append(ss[&#39;StackSetName&#39;])<br><br>    for stack_set in stack_sets:<br>        instances_to_delete = []<br>        inoperable = []<br><br>        paginator = cfn.get_paginator(&#39;list_stack_instances&#39;)<br>        for page in paginator.paginate(StackSetName=stack_set):<br>            for instance in page[&#39;Summaries&#39;]:<br>                status = instance[&#39;StackInstanceStatus&#39;][&#39;DetailedStatus&#39;]<br>                if status == &#39;SKIPPED_SUSPENDED_ACCOUNT&#39;:<br>                    instances_to_delete.append(instance)<br>                elif status == &#39;INOPERABLE&#39;:<br>                    inoperable.append(instance)<br><br>        # INOPERABLE requires manual intervention<br>        if inoperable:<br>            raise SystemExit(<br>                f&quot;❌ INOPERABLE instances found in {stack_set}. &quot;<br>                &quot;Manual intervention required.&quot;<br>            )<br><br>        # Automatically clean up suspended account remnants<br>        if instances_to_delete:<br>            accounts = list(set(i[&#39;Account&#39;] for i in instances_to_delete))<br>            regions = list(set(i[&#39;Region&#39;] for i in instances_to_delete))<br>            cfn.delete_stack_instances(<br>                StackSetName=stack_set,<br>                Accounts=accounts,<br>                Regions=regions,<br>                RetainStacks=True  # Only remove StackSet association<br>            )<br>            print(f&quot;🧹 Cleaned {len(instances_to_delete)} stale instances from {stack_set}&quot;)<br><br>    print(&quot;✅ StackSet cleanup complete&quot;)</pre><h3>5. Release: Trigger deployment and capture execution ID</h3><p>Upload the configuration to S3 to trigger CodePipeline, then capture the execution ID for tracking.</p><pre>#!/bin/bash<br><br># Package configuration<br>cd configuration &amp;&amp; zip -r ../custom-control-tower-configuration.zip * &amp;&amp; cd ..<br><br># Upload to S3 to trigger CodePipeline<br>aws s3 cp custom-control-tower-configuration.zip \<br>    s3://custom-control-tower-configuration-${AWS_ACCOUNT}-${AWS_REGION}/<br><br># Wait for CodePipeline to start<br>sleep 10<br><br># Capture execution ID<br>EXECUTION_ID=$(aws codepipeline list-pipeline-executions \<br>    --pipeline-name &quot;Custom-Control-Tower-CodePipeline&quot; \<br>    --query &#39;pipelineExecutionSummaries[?status==`InProgress`].pipelineExecutionId&#39; \<br>    --output text)<br><br>if [ &quot;$EXECUTION_ID&quot; == &quot;None&quot; ] || [ -z &quot;$EXECUTION_ID&quot; ]; then<br>    echo &quot;❌ Failed to capture pipeline execution ID&quot;<br>    exit 1<br>fi<br><br>echo &quot;✅ Pipeline triggered. Execution ID: $EXECUTION_ID&quot;<br># Pass execution ID to post-deploy stage<br>echo &quot;EXECUTION_ID=$EXECUTION_ID&quot; &gt;&gt; release.env</pre><h3>6. Post-deploy: Verify deployment results</h3><p>Start with a delay (giving CodePipeline time to complete), poll execution status, then check all StackSet instances for failures. If any instance has failed, fail the pipeline and notify the engineer who triggered the deployment.</p><pre>import boto3<br>import time<br>import os<br><br>def verify_deployment(session, execution_id):<br>    &quot;&quot;&quot;Wait for CodePipeline to complete, then verify all StackSet instances.&quot;&quot;&quot;<br><br>    # 1. Poll CodePipeline execution status<br>    cpl = session.client(&#39;codepipeline&#39;)<br>    while True:<br>        response = cpl.get_pipeline_execution(<br>            pipelineName=&#39;Custom-Control-Tower-CodePipeline&#39;,<br>            pipelineExecutionId=execution_id<br>        )<br>        status = response[&#39;pipelineExecution&#39;][&#39;status&#39;]<br><br>        if status == &#39;InProgress&#39;:<br>            print(&quot;⏳ Pipeline still in progress, waiting...&quot;)<br>            time.sleep(300)  # Check every 5 minutes<br>            continue<br>        elif status == &#39;Succeeded&#39;:<br>            print(&quot;✅ Pipeline execution succeeded&quot;)<br>            break<br>        else:<br>            raise Exception(f&quot;❌ Pipeline execution failed with status: {status}&quot;)<br><br>    # 2. Verify all StackSet instances<br>    cfn = session.client(&#39;cloudformation&#39;)<br>    stack_sets = []<br>    paginator = cfn.get_paginator(&#39;list_stack_sets&#39;)<br>    for page in paginator.paginate(Status=&#39;ACTIVE&#39;):<br>        for ss in page[&#39;Summaries&#39;]:<br>            if &#39;CustomControlTower&#39; in ss[&#39;StackSetName&#39;]:<br>                stack_sets.append(ss[&#39;StackSetName&#39;])<br><br>    for stack_set in stack_sets:<br>        paginator = cfn.get_paginator(&#39;list_stack_instances&#39;)<br>        for page in paginator.paginate(StackSetName=stack_set):<br>            for instance in page[&#39;Summaries&#39;]:<br>                status = instance[&#39;StackInstanceStatus&#39;][&#39;DetailedStatus&#39;]<br>                if status in [&#39;FAILED&#39;, &#39;FAILED_IMPORT&#39;]:<br>                    raise Exception(<br>                        f&quot;❌ Failed instance in {stack_set}: &quot;<br>                        f&quot;Account={instance[&#39;Account&#39;]}, &quot;<br>                        f&quot;Region={instance[&#39;Region&#39;]}, &quot;<br>                        f&quot;Reason={instance.get(&#39;StatusReason&#39;, &#39;unknown&#39;)}&quot;<br>                    )<br><br>    print(&quot;✅ All StackSet instances healthy&quot;)<br><br># Main<br>execution_id = os.environ[&#39;EXECUTION_ID&#39;]<br>session = boto3.Session()<br>verify_deployment(session, execution_id)</pre><h3>Results</h3><p><strong>CI/CD visibility</strong> — Before, deployments could succeed in CI/CD but silently fail downstream. Now, deployment failures surface directly in CI/CD pipeline status.</p><p><strong>Investigation time</strong> — Before, finding a failure meant drilling through multiple console layers. Now, failure details appear directly in pipeline logs.</p><p><strong>Orphaned instances</strong> — Before, leftover StackSet instances accumulated and unexpectedly blocked deployments. Now, they’re cleaned up automatically before every deployment.</p><p><strong>Unregistered OUs</strong> — Before, silently skipped. Now, caught immediately before deployment.</p><p><strong>cfn-nag feedback</strong> — Before, took minutes. Now, returns in seconds.</p><p><strong>Failure notifications</strong> — Before, deployment failures went unnoticed. Now, the pipeline fails and the engineer is notified automatically.</p><h3>Key design decisions</h3><h3>Why use a delayed start instead of a webhook?</h3><p>CfCT’s CodePipeline does not provide a completion webhook. We chose to start the post-deploy stage with a delay (~10 minutes), then poll the execution status. This is significantly simpler than setting up EventBridge + Lambda + callback, and is perfectly adequate for baseline deployments that are not time-critical.</p><h3>Why use RetainStacks=True when cleaning up?</h3><p>When removing StackSet instances for suspended accounts, RetainStacks=True is required. Suspended accounts are no longer accessible — without this flag, StackSets would attempt to enter the account and delete the stack, which will inevitably fail. RetainStacks=True only removes the StackSet management association without attempting to operate on resources inside the account.</p><h3>Why run cfn-nag in CI/CD instead of relying on CfCT’s built-in validation?</h3><ul><li>You control the version, pinned to match CfCT for consistent validation results</li><li>Fast feedback (seconds vs minutes)</li><li>CfCT’s built-in cfn-nag does not support manifest-level rule suppression (<a href="https://github.com/aws-solutions/aws-control-tower-customizations/issues/119">Issue #119</a>)</li><li>CfCT’s built-in cfn-nag scans all template files, including unreferenced ones (<a href="https://github.com/aws-solutions/aws-control-tower-customizations/issues/46">Issue #46</a>)</li></ul><h3>Conclusion</h3><p>CfCT does the heavy lifting of multi-account distribution well. What it doesn’t do is tell you whether the distribution actually succeeded. By adding pre-deploy checks and post-deploy verification in an external CI/CD pipeline, we achieved:</p><ol><li>Engineers no longer need to open the AWS Console to confirm results — deployment outcomes are visible directly in the CI/CD pipeline</li><li>Known failure conditions intercepted before deployment begins</li><li>Operational debt (stale instances) cleaned up automatically</li><li>Time to discover issues reduced from “unknown” to minutes</li></ol><p>These enhancements require no modifications to CfCT itself — they’re purely an external CI/CD wrapper, applicable to any CI/CD tool. If your team is operating CfCT at scale, we hope these practices help you reduce troubleshooting time and increase deployment confidence.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a9f9a1db0a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building My First Kiro Power: CDK Upgrader]]></title>
            <link>https://medium.com/@frankhe.cn/building-my-first-kiro-power-cdk-upgrader-22758b28252c?source=rss-b83a1df9fe6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/22758b28252c</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[cdk]]></category>
            <category><![CDATA[kiro-power]]></category>
            <category><![CDATA[aws-kiro]]></category>
            <dc:creator><![CDATA[Feng He]]></dc:creator>
            <pubDate>Tue, 06 Jan 2026 10:46:46 GMT</pubDate>
            <atom:updated>2026-01-06T12:31:07.416Z</atom:updated>
            <content:encoded><![CDATA[<p>About a month ago, Kiro launched <a href="https://kiro.dev/blog/introducing-powers/">Powers</a> — a way to package domain expertise into reusable workflows that guide the AI through complex tasks. I built my first one to solve a problem that’s been bugging me for years: AWS CDK upgrades.</p><p>If you’re running CDK projects in production, upgrades aren’t optional. The reasons vary:</p><ol><li><strong>Your Lambda runtime gets deprecated.</strong> You wrote a function using NODEJS_18_X, now AWS marks it deprecated. You need a newer CDK version to use NODEJS_20_X.</li><li><strong>CDK-generated Lambda runtimes get deprecated.</strong> Some CDK constructs create Lambda functions internally (like custom resources). When those runtimes get deprecated, upgrading CDK is your only option.</li><li><strong>You need a new construct.</strong> That L2/L3 construct you want? Only available in CDK 2.200.0+.</li></ol><p>So you upgrade. How hard can it be?</p><h3>The “Just Run ncu -u” Trap</h3><p>I’ve watched this pattern repeat for four years. An engineer needs to upgrade CDK, discovers <a href="https://www.npmjs.com/package/npm-check-updates">npm-check-updates</a>, runs ncu -u, and calls it done.</p><p>Sometimes it’s worse — engineers manually update only aws-cdk-lib and aws-cdk versions in package.json and leave everything else untouched.</p><p><strong>CDK upgrades look simple but are deceptively complex.</strong> What appears to be a straightforward version bump is actually a multi-step process where it’s easy to miss critical changes.</p><p><strong>What gets missed:</strong></p><p><strong>1. CDK CLI and CDK Lib must be compatible.</strong></p><p>Since AWS <a href="https://aws.amazon.com/blogs/opensource/aws-cdk-is-splitting-construct-library-and-cli/">split the CLI from the Construct Library</a>, they version independently. The CLI (2.1000.x+ series) and Library (2.175.x+ series) have a compatibility constraint: CLI release date must be ≥ Library release date. ncu -u doesn&#39;t know this — it grabs the latest of each, which may be incompatible.</p><p><strong>2. tsconfig.json has critical changes.</strong></p><p>CDK’s TypeScript config evolves. Recent versions changed compilerOptions.target from ES2020 to ES2022, and module from CommonJS to NodeNext. Skip these, and your TypeScript compiles to unexpected output — causing subtle bugs.</p><p><strong>3. cdk.json contains feature flags.</strong></p><p>Each CDK release adds new feature flags. These control behavior changes and new capabilities. Miss them, and you’re running with outdated defaults.</p><p><strong>4. Related dependencies need updates too.</strong></p><p>Beyond aws-cdk-lib and aws-cdk, packages like constructs, source-map-support, and testing utilities need version alignment.</p><p>Over four years, I’ve repeatedly seen team members miss these changes. Despite documentation, training, and code review checklists, it keeps happening. Too many steps, humans forget.</p><p>My own approach was running npx -y cdk@latest init app --language typescript --generate-only to create a temporary project, then manually comparing and merging files. Time-consuming — especially after the CLI/Lib version split added compatibility checks.</p><p>A manual upgrade took a couple hours and still risked missing something.</p><h3>Why a Kiro Power?</h3><p>This is exactly the kind of problem Kiro Powers solve well: a complex, multi-step workflow that requires domain expertise and strict sequencing.</p><p>A Power consists of:</p><ul><li><strong>POWER.md</strong>: Documentation that tells Kiro what the tool does and how to invoke it</li><li><strong>Steering files</strong>: Detailed workflow guides that ensure Kiro follows the exact sequence</li><li><strong>MCP servers</strong> (optional): External integrations via Model Context Protocol for additional capabilities</li></ul><p>The steering files are key. They’re not just documentation — they’re guardrails. For example, the version selection steering file explicitly states:</p><blockquote>“⚠️ WARNING: Skipping Step 4 will result in incompatible versions!”</blockquote><p>For infrastructure tooling, “close enough” isn’t good enough. The Power ensures every step runs in order, every time.</p><h3>How CDK Upgrader Works</h3><p>The core insight: <strong>don’t patch files, generate fresh templates and merge intelligently</strong>.</p><h3>Smart Version Selection</h3><p>Instead of grabbing the latest version, the upgrader uses a 5-step algorithm:</p><ol><li>Find the latest CLI version stable for 7+ days</li><li>Record its release date as a compatibility constraint</li><li>Find the latest Library version stable for 7+ days</li><li><strong>Verify compatibility</strong> (CLI release date ≥ Library release date)</li><li>If incompatible, search backwards for a compatible version</li></ol><p>You’re never upgrading to something released yesterday.</p><h3>Template Generation</h3><p>The upgrader runs:</p><pre>npx -y cdk@$TARGET_VERSION init app --language typescript --generate-only</pre><p>This generates a fresh CDK template — the authoritative source for what config files should contain. Exactly what I used to do manually, now automated.</p><h3>Intelligent File Merging</h3><p>Each file type gets specific treatment:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*xoonTYI8O-_oTeH_Ds69-g.png" /></figure><h3>Deprecated Construct Migration</h3><p>The upgrader scans TypeScript files for deprecated patterns:</p><pre>// Before<br>runtime: lambda.Runtime.NODEJS_16_X<br>encryption: s3.BucketEncryption.Kms<br>vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE }<br><br>// After  <br>runtime: lambda.Runtime.NODEJS_20_X<br>encryption: s3.BucketEncryption.KMS_MANAGED<br>vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }</pre><p>Also ensures Construct is imported from the &#39;constructs&#39; package.</p><h3>Validation &amp; Git Integration</h3><p>Every upgrade runs npm install and cdk synth to verify nothing broke. If validation passes, it creates a semantic commit: feat(cdk): upgrade CDK to version X.Y.Z.</p><h3>Try It</h3><p>If you’re managing TypeScript CDK projects:</p><p><strong>Install the Power:</strong></p><ol><li>Open Kiro and navigate to the Powers panel</li><li>Click “Add Custom Power” or use the command palette (Cmd+Shift+P / Ctrl+Shift+P)</li><li>Select “Import Power from GitHub”</li><li>Enter: <a href="https://github.com/frankhefeng/kiro-power-cdk-upgrader">https://github.com/frankhefeng/kiro-power-cdk-upgrader</a></li><li>Hit Enter</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WyzvPzJDpaspJL-tU7xnzQ.png" /></figure><p><strong>Use it:</strong></p><ol><li>Create a feature branch in your CDK project</li><li>Tell Kiro: “Use the CDK Upgrader Power to upgrade my projects”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IwobUL9E2tyFBDXRsGoTXQ.png" /></figure><p>What used to take a couple hours now completes in under 30 minutes, even for repos with multiple CDK projects.</p><h3>What’s Next?</h3><p>Current scope is TypeScript CDK v2 projects. On the roadmap:</p><ul><li>Python CDK support</li><li>Go CDK support</li></ul><p>Contributions welcome.</p><p><em>CDK Upgrader: </em><a href="https://github.com/frankhefeng/kiro-power-cdk-upgrader"><em>https://github.com/frankhefeng/kiro-power-cdk-upgrader</em></a></p><p><em>Built with </em><a href="https://kiro.dev/"><em>Kiro</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22758b28252c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ ECS Deployment Strategies: Visualizing Your Path to Simplified CI/CD]]></title>
            <link>https://medium.com/@frankhe.cn/ecs-deployment-strategies-visualizing-your-path-to-simplified-ci-cd-0f1dd599ef6f?source=rss-b83a1df9fe6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f1dd599ef6f</guid>
            <category><![CDATA[codedeploy]]></category>
            <category><![CDATA[blue-green-deployment]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[aws-ecs]]></category>
            <category><![CDATA[canary-deployments]]></category>
            <dc:creator><![CDATA[Feng He]]></dc:creator>
            <pubDate>Sun, 23 Nov 2025 13:28:23 GMT</pubDate>
            <atom:updated>2025-11-23T13:28:23.840Z</atom:updated>
            <content:encoded><![CDATA[<h3>💡 Why Your Deployment Strategy Matters More Than Ever</h3><p>Historically, Amazon ECS offered <strong>Rolling Updates</strong> natively, which is simple but lacks fine-grained traffic control and quick rollback capabilities for failures.</p><p>The good news is that AWS continues to enhance ECS’s native capabilities. Recently, AWS announced built-in support for advanced strategies: <strong>Blue/Green</strong>, <strong>Linear</strong>, and <strong>Canary</strong> deployments.</p><ul><li>✅ <a href="https://aws.amazon.com/about-aws/whats-new/2025/07/amazon-ecs-built-in-blue-green-deployments/"><strong>Amazon ECS Built-in Blue/Green Deployments</strong> </a>(July 2025)</li><li>✅ <a href="https://aws.amazon.com/about-aws/whats-new/2025/10/amazon-ecs-built-in-linear-canary-deployments/"><strong>Amazon ECS Built-in Linear and Canary Deployments</strong></a> (October 2025)</li></ul><h3>✂️ Streamlining CI/CD: Bidding Farewell to CodeDeploy’s Complexity</h3><p>Before native ECS support for advanced strategies, the <strong>classic approach for implementing Blue/Green, Linear, or Canary deployments involved integrating AWS CodeDeploy</strong>. This introduced significant friction, especially for users of non-AWS managed CI/CD pipelines (like GitLab or GitHub Actions), requiring <strong>dual configuration</strong> and complex <strong>API-based triggering</strong> scripts.</p><p><strong>Now, native ECS support means we can bypass CodeDeploy entirely, achieving true “configuration-as-deployment” and dramatically simplifying pipeline logic.</strong></p><h3>🔁 The Industry Challenge: Migration and Strategy Selection</h3><p>Many organizations running complex microservices previously relied on solutions like App Mesh for sophisticated traffic routing. With AWS actively recommending migration to the powerful <a href="https://aws.amazon.com/blogs/containers/migrating-from-aws-app-mesh-to-amazon-ecs-service-connect/">Amazon ECS Service Connect</a>, developers are facing a critical strategic decision: <strong>Which new native ECS deployment strategy is the best fit for their diverse microservices?</strong></p><h3>🤔 The Limitations of Static Diagrams and Text Descriptions</h3><p>When explaining the four deployment strategies — <strong>Rolling Update, Blue/Green, Linear, and Canary</strong> — their unique <strong>traffic shifting patterns</strong>, <strong>risk exposure levels</strong>, and <strong>rollback mechanisms</strong> are difficult to grasp from static flowcharts or textual descriptions alone. This lack of visual clarity often leads to misunderstandings.</p><h3>✨ The Solution: An Animated ECS Deployment Strategy Visualizer</h3><p>To help teams more intuitively and accurately understand and select the most suitable deployment strategy, I’ve created an open-source animation project. <strong>As a backend/DevOps developer, I used Kiro to significantly accelerate the creation of this front-end visualization.</strong></p><p>Project Name: AWS ECS Deployment Strategy Animation</p><p>GitHub Repository: <a href="https://github.com/frankhefeng/aws-ecs-deployment-strategy-animation">https://github.com/frankhefeng/aws-ecs-deployment-strategy-animation</a></p><p>This project clearly demonstrates the dynamic process of <strong>how traffic smoothly or progressively shifts from the old version (Old/Blue) to the new version (New/Green)</strong> across all four strategies:</p><h4>1. Rolling Update</h4><ul><li><strong>Mechanism:</strong> Tasks are replaced one by one.</li><li><strong>Risk:</strong> High risk.</li></ul><h4>2. Blue/Green Deployment</h4><ul><li><strong>Mechanism:</strong> Traffic is switched instantly after creating a new environment.</li><li><strong>Risk:</strong> Low risk.</li></ul><h4>3. Linear Deployment</h4><ul><li><strong>Mechanism:</strong> Traffic is shifted in <strong>fixed percentages</strong> at predetermined time intervals.</li><li><strong>Risk:</strong> Low risk.</li></ul><h4>4. Canary Deployment</h4><ul><li><strong>Mechanism:</strong> A very small initial percentage of traffic is directed to the new version for <strong>early validation</strong>.</li><li><strong>Risk:</strong> Lowest risk.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qz_Yf_a0OHFgv1EpSNM_w.png" /></figure><h3>Conclusion and Call to Action</h3><p>I hope this animation project helps teams quickly and accurately understand the nuances of all four native ECS deployment strategies. By <strong>embracing native ECS capabilities and simplifying your CI/CD pipelines</strong> during your infrastructure modernization, you will significantly enhance the release quality and reliability of your microservices.</p><p>I welcome everyone to clone, use my GitHub repository, and provide any suggestions or improvements!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f1dd599ef6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Code: How a Single AWS CDK Contribution Saved $15,000 and Delivered Fully Automated SSL]]></title>
            <link>https://medium.com/@frankhe.cn/beyond-code-how-a-single-aws-cdk-contribution-saved-15-000-and-delivered-fully-automated-ssl-60241f80158c?source=rss-b83a1df9fe6c------2</link>
            <guid isPermaLink="false">https://medium.com/p/60241f80158c</guid>
            <category><![CDATA[aws-eventbridge]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-acm]]></category>
            <dc:creator><![CDATA[Feng He]]></dc:creator>
            <pubDate>Sun, 28 Sep 2025 16:17:03 GMT</pubDate>
            <atom:updated>2025-10-02T07:42:52.668Z</atom:updated>
            <content:encoded><![CDATA[<h3>An Expensive, Risky Status Quo</h3><p>For years, our SSL certificate process was a mix of bureaucracy, cost, and risk. Certificates were purchased by the IT operation team, not managed by the Cloud team. Every renewal meant submitting requests, generating CSRs, and waiting for procurement.</p><p>Using OV certificates added another layer of friction. Identity validation required phone calls to the company’s Yellow Pages listing. The problem? We hadn’t had landlines for years.</p><p>Even after the Cloud team took ownership and automated CSR generation, the risks didn’t go away. One mistake with a certificate containing more than 10 SANs ended up costing us over <strong>$3,000</strong> in reissue fees. A single slip turned into an expensive lesson.</p><p>That was the moment I knew the process had to change. When <a href="https://aws.amazon.com/blogs/aws/aws-certificate-manager-introduces-exportable-public-ssl-tls-certificates-to-use-anywhere/">AWS ACM announced support for <strong>exportable certificates</strong></a> — at just <strong>$15 per domain</strong> — I saw a clear path forward: replace the old SSL cert vendor, cut costs, and automate the lifecycle entirely inside AWS.</p><h3>The Gap in AWS CDK</h3><p>There was only one problem: ACM exportable certificates were supported in CloudFormation, but not in AWS CDK.</p><p>After years of being an AWS CDK user, I initially saw this as a quick fix and a perfect opportunity to contribute. However, when I attempted to extend the CDK construct, I discovered that the underlying L1 construct was missing the new property entirely. This sent me down the rabbit hole of understanding how the CDK actually generates its code.</p><p>The first step was to set up my local CDK development environment. The official<a href="https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md"> CDK contributing guide</a> was my starting point, and I also found Pahud Hsieh’s excellent blog posts on <a href="https://builder.aws.com/content/2jhmIXdVWZJy3uJnUfEzEmp652j/contributing-to-aws-cdk">contributing to AWS CDK</a> extremely helpful.</p><p>The steps looked like this:</p><pre>git clone https://github.com/{your-account}/aws-cdk.git<br>cd aws-cdk<br>yarn install<br>npx lerna run build - skip-nx-cache</pre><p>When focusing on the <strong>aws-certificatemanager</strong> package:</p><pre>cd packages/aws-cdk-lib/aws-certificatemanager<br>yarn install<br>yarn test aws-certificatemanager</pre><p>This setup was only the beginning. After digging through the repo, I found that CDK doesn’t generate service specs directly — it consumes them from <strong>cdklabs/awscdk-service-spec</strong>, which is versioned and periodically updated by automation. At the time, the dependency hadn’t caught up yet.</p><p>The fix was simple in hindsight: update the dependency, rebuild, and suddenly the missing property appeared. From there, I added the necessary code and tests to support certificate export in CDK.</p><p>It was my first-ever contribution to AWS CDK. The codebase is massive but well-structured, with a CI/CD pipeline running comprehensive tests and coverage checks. What surprised me most was the review process: my PR sat for weeks until I asked our AWS TAM to help escalate. After several rounds of review, the PR was finally merged — more than a month later.</p><p>That experience made me appreciate the bar CDK maintains for quality, and also why tools like Terraform sometimes ship support earlier.</p><h3>Security Questions: OV vs. DV</h3><p>Replacing OV with DV certificates immediately raised concerns from the security team. Were we lowering our standards?</p><p>Several authoritative sources indicate that Domain Validation (DV) certificates are sufficient for most use cases, and that Organization Validation (OV) or Extended Validation (EV) are not technically necessary. <strong>Let’s Encrypt</strong>, the world’s largest certificate authority, issues only DV certificates, stating that OV/EV cannot be automated and are therefore unnecessary for their mission (<a href="https://letsencrypt.org/docs/faq/?utm_source=chatgpt.com">Let’s Encrypt FAQ</a>). Technically, all three types (DV, OV, EV) provide the same level of encryption (<a href="https://en.wikipedia.org/wiki/X.509?utm_source=chatgpt.com">Wikipedia: X.509</a>), and <strong>IETF’s TLS best practice document (RFC 9325)</strong> emphasizes protocol security rather than certificate validation level. In addition, browsers have largely removed special UI indicators for EV certificates, reducing their practical benefit (<a href="https://security.stackexchange.com/questions/35076/how-does-an-end-user-differentiate-between-ov-and-dv-certificates?utm_source=chatgpt.com">Security StackExchange</a>). Therefore, DV certificates are generally sufficient for ensuring secure encrypted communication; OV and EV are mostly useful for compliance or branding rather than technical security.</p><p>I also brought data to the discussion: many of our critical endpoints, like our member-facing website on CloudFront, already relied on ACM DV certificates. OV doesn’t add technical strength — only organizational validation, which in practice had caused us headaches with identity checks. Unless compliance explicitly required OV or EV — which wasn’t the case for us, since we don’t process credit card data — DV was an acceptable risk. Our AWS TAM even confirmed this with the ACM product team.</p><p>Security agreed, with one recommendation: add <strong>CAA records</strong> in DNS to restrict certificate issuance to AWS.</p><p>That’s when we hit a protocol-level roadblock. Per DNS standards, a CNAME can’t coexist with any other record. For example, if a CNAME record <strong><em>api.example1.com -&gt; api.example2.com</em></strong> exists, we cannot create any other DNS records on api.example1.com, including CAA and TXT records. Since our API domain used a CNAME record to point to the API Gateway service, adding a CAA record was technically impossible, as defined in <a href="https://www.rfc-editor.org/rfc/rfc1034.html#section-3.6.2">RFC 1034 section 3.6.2 Aliases and canonical names</a>:</p><blockquote><em>The domain system provides such a feature using the canonical name (CNAME) RR. A CNAME RR identifies its owner name as an alias, and specifies the corresponding canonical name in the RDATA section of the RR.</em><strong> If a CNAME RR is present at a node, no other data should be present;</strong><em> this ensures that the data for a canonical name and its aliases cannot be different. This rule also insures that a cached CNAME can be used without checking with an authoritative server for other RR types.</em></blockquote><p>We documented the limitation, explained the trade-off, and reached alignment with security. It was a pragmatic decision: better to accept the limitation than block progress.</p><h3>Building “Set and Forget” Automation</h3><p>Once the foundation was there, I designed the automation. Using Amazon Q, I drafted a proof of concept that the team later refined into production with api gateway (non-AWS) integration.</p><p>The flow was straightforward but powerful:</p><ul><li><strong>EventBridge</strong> triggers whenever ACM issues or renews a certificate.</li><li><strong>Lambda</strong> exports the certificate using the AWS SDK.</li><li>The Lambda then uploads it into api gateway (non-AWS) via its management API.</li></ul><p>This fully automated the lifecycle — covering both issuance and renewals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z-Fe78LEmxmj8WqtJ7UWxQ.png" /></figure><p>Now, whether it’s the first issuance or an automatic renewal, the pipeline keeps our certificates updated without anyone touching a thing.</p><h3>What We Gained</h3><p>The impact of this project went far beyond a single feature:</p><ul><li><strong>Cost savings:</strong> $15,000/year eliminated by dropping OV.</li><li><strong>Stability:</strong> No more risky manual renewals or costly mistakes like the $3,000 SAN reissue.</li><li><strong>Technical growth:</strong> My first merged contribution to AWS CDK, and a much deeper understanding of its internals.</li><li><strong>Cross-team alignment:</strong> Security, architecture, and cloud all worked together to balance risk and practicality.</li><li><strong>Personal milestone:</strong> Becoming an AWS CDK contributor — something I’m genuinely proud of.</li></ul><h3>Closing Thoughts</h3><p>What started as a cost optimization exercise became a journey across code, security, and architecture. It was a lesson in trade-offs: ideal security vs. DNS realities, fast fixes vs. deep repo knowledge, feature requests vs. open-source contribution.</p><p>And most importantly, it proved that the best solutions don’t just save money — they free people from repetitive work, reduce risk, and let us focus on building.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60241f80158c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>