Skip to main content

Internal Service: _background_acm_upgrade

Upgrades from Let’s Encrypt certificate to ACM-native certificate for automatic renewal.

Purpose

Let’s Encrypt certificates expire after 90 days and require manual renewal. ACM certificates auto-renew indefinitely. This background task upgrades to ACM after the proxy is deployed.

Function Signature

async def _background_acm_upgrade(
    domain: str,
    distribution_id: str,
    old_certificate_arn: str,
    entity_id: str,
    org_id: str
)

Parameters

ParameterTypeDescription
domainstrThe custom domain (e.g., β€œwww.example.com”)
distribution_idstrCloudFront distribution ID
old_certificate_arnstrCurrent Let’s Encrypt certificate ARN
entity_idstrDatabase entity ID
org_idstrClerk organization ID

Execution Flow

Timing

  • Delay: 60 seconds after Step 2 completes
  • Duration: 2-10 minutes (ACM validation time)
  • Non-blocking: User doesn’t wait for this

Dependencies

  • src/app/apis/domain/shared/acm_upgrade.py - upgrade_to_acm_native()

Code Location

src/app/apis/domain/mark_step_complete/routes.py