Expired TLS certificate

Renew service TLS certificates before they expire.

Description

Replace the TLS certificate used by API Gateway before expiry. Check the expiry date in IAM or ACM and the certificate actually served by the domain.

Potential impact

Browsers and API clients can reject an expired certificate, interrupting connections and integrations.

Remediation

Set a renewal alert and associate a valid certificate that covers the hostname and chains to a trusted CA. Reconnect to the service hostname with verification enabled and check the new expiry date.

Examples

The excerpts change only the certificate_body file for the edge-optimized api.example.com domain. Registration by certificate body also needs a certificate name, the matching private key and the required chain. Check the dates in the PEM itself.

Before

hcl
resource "aws_api_gateway_domain_name" "example" {
  certificate_body = file("expiredCertificate.pem")
  domain_name      = "api.example.com"
}

After

hcl
resource "aws_api_gateway_domain_name" "example" {
  certificate_body = file("validCertificate.pem")
  domain_name      = "api.example.com"
}

References