Saturday, October 25, 2025

AWS Certificate Manager (ACM) & Importing Public Certificates | Overview.

AWS Certificate Manager (ACM) & Importing Public Certificates - Overview.

Focus:

  • Intro,
  • Key Requirements for Importing,
  • Important Limitations,
  • Step-by-Step Import Process,
  • Importation process for a Public Certificate (deep dive),
  • Table of Certificate terminology, Use Cases & Sample,
  • Key Difference of Certificate types,
  • Architecture Components Description,
  • Import Flow diagram,
  • Required Files for Import,
  • Required Files for Import (Certificate Body, Certificate Chain, & Private key),
  • Sample Certifiacte,
  • Importing Public certificate via AWS CLI,
  • Sample CloudFormation Stack to deploy a Public Certificate,
  • Cross-Region and Cross-Account Usage,
  • Security, Key Management & Description,
  • Integration with AWS Services & Details,
  • Automation & Lifecycle Management,
  • Best Practices,
  • Sample Architecture for Automated Import Rotation.

Intro:

    • AWS Certificate Manager (ACM) allows twtech to use SSL/TLS certificates from a third-party certificate authority (CA) by importing them
    • This is useful for utilizing existing certificates or meeting specific requirements not covered by ACM-issued certificates.
Key Requirements for Importing
To successfully import a certificate, it must meet these strict criteria:
    • Format: The certificate, private key, and certificate chain must be PEM-encoded.
    • Private Key: Must be unencrypted (no password or passphrase), no larger than 5 KB, and match the public key in the certificate.
    • Validity: The certificate must be valid at the time of import (between the NotBefore and NotAfter dates).
    • Algorithms: ACM supports RSA (1024 to 4096-bit) and ECDSA (256, 384, and 521-bit)
      • Ensure the integrated service (e.g., CloudFront) also supports the specific algorithm.
    • Chain: While optional, a PEM-encoded certificate chain is highly recommended to establish trust.
Important Limitations
    • No Managed Renewal: ACM does not automatically renew imported certificates.
      • twtech is responsible for monitoring expiration and manually reimporting a new certificate before the old one expires.
    • Region-Specific: Certificates are regional resources. 
      • To use a certificate in multiple regions, twtech must import it into each one individually.
    • CloudFront Requirement: If twtch intends to use the certificate with Amazon CloudFront
      • it must be imported into the US East (N. Virginia) region.
    • No Exporting: Unlike some ACM-issued public certificates, twtech cannot export the private key of an imported certificate once it is in ACM.
Step-by-Step Import Process
  • twtech can import certificates via the:
    •  AWS Management Console
    • AWS CLI, 
    •  SDK (Software Development Kit).
  • Prepare Files: twtech Ensures it has:
    • The certificate body, 
    • The unencrypted private key, 
    • The certificate chain in PEM format.
  • Open ACM: Navigate to the ACM Console and select Import a certificate.
    • Paste Content:Paste the Certificate body (starts with -----BEGIN CERTIFICATE-----).
    • Paste the Certificate private key (starts with -----BEGIN PRIVATE KEY-----).
    • Paste the Certificate chain (intermediate and root certificates).
  • Review and Import: twtch Adds optional tags and click Import to complete the process.
Renewal (Reimporting)
    • To "renew" an imported certificate, twtech must obtain a new certificate from its CA and use the Reimport action in the ACM console
    • This process preserves the original Amazon Resource Name (ARN) and automatically updates any associated AWS resources, such as load balancers.

1. Importation process for a Public Certificate (deep dive).

    • ACM can automatically issue and renew public certificates through Amazon Trust Services.
    • However, twtech might need to import an existing certificate into AWS.
Table of Certificate terminology, Use Cases & Sample

Use Case

Sample

External CA

Certificate issued by DigiCert, Let’s Encrypt, Entrust, etc.

Custom trust chain

Enterprise PKI or hybrid cloud environment

Key export control

twtech generated private keys and want full control

Pre-existing certs

Migrating workloads already using external certs

 Key Difference of Certificate types:

    • When importing a certificate, twtech manages renewal and re-import .
    • AWS Certificate Manager (ACM) does not automatically renew imported certificates.

 2. Architecture: How Imported Certificates Work

  • Here’s a breakdown of the imported certificate architecture inside ACM:

Architecture Components & Description

Component

Description

AWS Certificate Manager (ACM)

Stores and deploys the imported certificate.

External Certificate Authority (CA)

Issues the certificate and provides the cert chain.

Private Key Owner

twtech (the user) generates and hold the private key.

Target Services

ALB, CloudFront, API Gateway, etc. consuming the cert.

Import Flow diagram

 3. Required Files for Import (Certificate Body, Certificate Chain, & Private key)

NB:

  • When twtech import a certificate into ACM, it needs three components:

File

Description

Certificate Body

The public cert file (.crt) issued by the CA.

Certificate Chain

Intermediate CA(s) up to the root CA.

Private Key

The private key (.key) corresponding to the cert.

NB:

  • All fiels (Certificate Body, Certificate Chain, Private key) must be PEM-encoded and unencrypted.

Sample Certifiacte:

-----BEGIN CERTIFICATE-----

<twtech certificate body>

-----END CERTIFICATE-----

-----BEGIN CERTIFICATE-----

<intermediate certificate>

-----END CERTIFICATE-----

 4. Importing Public certificate via AWS CLI

# bash

aws acm import-certificate \

  --certificate fileb://twtechcertificate.pem \

  --private-key fileb://twtechprivate-key.pem \

  --certificate-chain fileb://twtechcertificate-chain.pem \

  --tags Key=Environment,Value=twtechProd

NB:
    • ACM returns a Certificate ARN, which twtech can then attach to ALBs, CloudFront distributions, etc.
    • The private key cannot be encrypted with a password.
    • twtech needs to remove passphrases before import.

 5. Sample CloudFormation Stack to deploy a Public Certificate

CloudFormation.yaml

Resources:

  ImportedCertificate:

    Type: AWS::CertificateManager::Certificate

    Properties:

      CertificateBody: |

        -----BEGIN CERTIFICATE-----

        MIIF...

        -----END CERTIFICATE-----

      PrivateKey: |

        -----BEGIN RSA PRIVATE KEY-----

        MIIE...

        -----END RSA PRIVATE KEY-----

      CertificateChain: |

        -----BEGIN CERTIFICATE-----

        MIIE...

        -----END CERTIFICATE-----

NB:

    •  CloudFormation doesn’t directly support automatic renewal or referencing S3 secrets.
    •  twtech must manually update the stack to rotate certificates.

 6. Cross-Region and Cross-Account Usage

  • ACM certificates are regional, even when imported.

To use across Regions:

    • Import the same certificate in each target Region.
    • twtech can automate this via AWS Lambda or CI/CD pipelines to replicate certs to multiple Regions.

To use across Accounts:

    • Use Resource Sharing via AWS RAM for ALB/NLB certificates.
    • Or deploy a copy in each account using CloudFormation StackSets.

 7. Security, Key Management & Description

Area

Description

Private Key Storage

Encrypted at rest by ACM using AWS KMS (twtech can’t access it after import).

Access Control

IAM policies control who can import, view, or delete certs.

Audit Trail

All actions logged via CloudTrail (e.g., ImportCertificate, DeleteCertificate).

No Export

Imported private keys cannot be exported once uploaded.

Rotation Policy

twtech must manually re-import when the cert is renewed externally.

 8. Integration with AWS Services & Details

AWS Service

Integration Details

ALB / NLB

Use the certificate ARN in the HTTPS listener.

CloudFront

Must import the cert in us-east-1 (N. Virginia).

API Gateway

Attach via custom domain configuration.

Elastic Beanstalk

Specify certificate ARN in environment config.

 9. Automation & Lifecycle Management

A. Pipeline-based Automation (Sample Workflow)

B. Renewal Workflow

    1. Detect expiring cert (e.g., via EventBridge or cron).
    2. Request a new one from twtech CA.
    3. Import into ACM.
    4. Update dependent resources.

10. Best Practices

Category

Best Practice

Key Generation

Generate keys using strong algorithms (RSA 2048+, ECC).

Automation

Automate imports and rotations using Lambda or CI/CD.

Security

Never store unencrypted private keys in source control.

Region

Always import to us-east-1 for CloudFront distributions.

Monitoring

Use EventBridge + CloudWatch to detect expiring certs.

Tagging

Tag imported certs with environment and ownership metadata.

 11. Sample Architecture for Automated Import & Rotation





No comments:

Post a Comment

Amazon EventBridge | Overview.

Amazon EventBridge - Overview. Scope: Intro, Core Concepts, Key Benefits, Link to official documentation, What EventBridge  Really  Is (Deep...