certificate-renewal-automator
Designs and implements ACM certificate renewal automation pipelines. Detects expiring certificates via CloudWatch alarms on DaysToExpiry, wires EventBridge scheduled rules for daily cert scans, deploys Lambda functions that request new certificates, validate DNS via Route 53 CNAME records, update ALB/NLB listeners, rotate API Gateway custom domain certificates, and update CloudFront distributions. Covers private CA (ACM PCA) lifecycle, cross-account cert sharing via IAM, SNI verification, wildcard vs SAN renewal, exported-private-key manual renewal, and CloudTrail audit. Emits AUTOMATION_DEPLOYED with a full IaC template or REVIEW_REQUIRED with the specific gap.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-24
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- certificate-renewal-automator
- license
- Apache-2.0
- metadata
- { "tags": "aws-acm, certificate-renewal, tls, security, cloudwatch, eventbridge, lambda, automate", "phase": "4", "author": "Jacky Chan — AWS Community Builder", "domain": "aws-cloudops", "family": "Security", "version": "0.1.0", "keywords": "ACM, certificate renewal, DaysToExpiry, CloudWatch alarm, EventBridge scheduled rule, Lambda renewal, DNS validation, Route 53 CNAME, ACM PCA, ALB listener certificate, CloudFront distribution, API Gateway custom domain, SNI verification, wildcard certificate, SAN certificate, CloudTrail audit", "task_type": "automate", "complexity": "high", "skill_class": "capability", "when_to_use": "Building ACM certificate renewal automation, wiring CloudWatch alarms for cert expiry, deploying EventBridge + Lambda renewal pipelines, managing PCA certificate lifecycles, rotating certs on ALB/NLB/CloudFront/API Gateway, or auditing cert API calls.", "requires_llm": "true", "verdict_shape": "AUTOMATION_DEPLOYED | REVIEW_REQUIRED", "lifecycle_status": "active", "invocation_schema": "Input: either (a) a list of ACM certificate ARNs with associated services and renewal status, OR (b) a cert renewal automation requirement. Output: deterministic RENEWAL block per certificate — DETECTION/RENEWAL_FLOW/VALIDATION/NOTIFICATION/AUDIT/VERDICT — where VERDICT is AUTOMATION_DEPLOYED or REVIEW_REQUIRED.", "supports_pipeline": "true", "activation_triggers": "automate certificate renewal, ACM expiry alarm, DaysToExpiry CloudWatch, certificate rotation Lambda, DNS validation Route 53, ACM PCA lifecycle, ALB listener certificate update, CloudFront certificate renewal, API Gateway custom domain cert, SNI verification, cross-account certificate sharing" }
- description
- Designs and implements ACM certificate renewal automation pipelines. Detects expiring certificates via CloudWatch alarms on DaysToExpiry, wires EventBridge scheduled rules for daily cert scans, deploys Lambda functions that request new certificates, validate DNS via Route 53 CNAME records, update ALB/NLB listeners, rotate API Gateway custom domain certificates, and update CloudFront distributions. Covers private CA (ACM PCA) lifecycle, cross-account cert sharing via IAM, SNI verification, wildcard vs SAN renewal, exported-private-key manual renewal, and CloudTrail audit. Emits AUTOMATION_DEPLOYED with a full IaC template or REVIEW_REQUIRED with the specific gap.
- compatibility
- Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline workflow design. Live deployment uses aws acm describe-certificates, request-certificate, get-certificate, aws acm-pca issue-certificate, aws elbv2 modify-listener, aws apigateway update-domain-name, aws cloudfront update-distribution, aws route53 change-resource-record-sets, aws events put-rule/put-targets, aws lambda create-function — AWS CLI v2.
02 资源文件 21
- 参考文档eval/test-cases.yaml6.0 KB
- 参考文档evals/baselines/acm-dns-alb-auto-renewal.md758 B
- 参考文档evals/baselines/cloudfront-cert-rotation.md570 B
- 参考文档evals/baselines/orphaned-imported-cert.md565 B
- 参考文档evals/baselines/pca-private-ca-pipeline.md648 B
- 参考文档evals/baselines/san-validation-gap.md586 B
- 参考文档evals/eval_config.yaml1.7 KB
- 参考文档evals/evals.json4.2 KB
- 参考文档evals/prompts/acm-dns-alb-auto-renewal.md784 B
- 参考文档evals/prompts/cloudfront-cert-rotation.md685 B
- 参考文档evals/prompts/orphaned-imported-cert.md665 B
- 参考文档evals/prompts/pca-private-ca-pipeline.md748 B
- 参考文档evals/prompts/san-validation-gap.md767 B
- 参考文档examples/end-to-end.md6.7 KB
- 参考文档references/acm-renewal-paths.md8.4 KB
- 参考文档references/advanced-patterns.md7.1 KB
- 参考文档references/diagnostic-commands.md1.7 KB
- 参考文档references/error-handling.md564 B
- 参考文档references/imported-cert-manual-renewal.md5.3 KB
- 参考文档references/worked-examples.md1.4 KB
- 参考文档skill.usf.yaml4.4 KB
03 SKILL.md 正文
Certificate Renewal Automator
Mindset
One-line takeaway: every certificate renewal pipeline is a five-stage chain — detect (CloudWatch DaysToExpiry alarm) → trigger (EventBridge scheduled scan) → renew (ACM managed renewal or Lambda custom flow) → validate (DNS CNAME in Route 53) → verify (SNI check + listener/distribution update confirmation). A gap in ANY stage produces a silent expiry.
- ACM managed renewal is NOT universal. It covers only DNS/email-validated certs attached to supported services (ALB, NLB, CloudFront, API Gateway). Exported private keys, orphaned certs, and PCA-exported certs require manual or custom renewal.
- PCA-managed certs have a separate lifecycle. The CA cert itself has its own renewal path — two renewal pipelines, not one.
- DNS validation is the only path to zero-touch renewal. Email validation requires human interaction on every renewal.
Quick navigation
| You want to... | Go to |
|---|---|
| Detect expiring certs | Step 2 (CloudWatch alarm) |
| Wire daily cert scan | Step 3 (EventBridge) |
| Build Lambda renewal | Step 4 (renewal flow) |
| Automate DNS validation | Step 5 (Route 53 CNAME) |
| Rotate ALB/NLB certs | Step 6 (listener rotation) |
| Rotate CloudFront certs | Step 7 (distribution update) |
| Handle API Gateway domains | Step 8 (API GW rotation) |
| Manage PCA private certs | Step 9 (PCA lifecycle) |
| Share certs cross-account | Step 10 (cross-account IAM) |
| Verify renewal via SNI | Step 11 (SNI check) |
| Audit cert API calls | Step 12 (CloudTrail) |
Critical rules at a glance
- ACM managed renewal fires at 60 days pre-expiry for DNS-validated certs attached to a supported service. If not attached (orphaned), ACM does NOT renew. Always verify cert-to-resource association.
- Exported private-key certs cannot auto-renew. ACM has no stored private key. Renewal requires re-import. REVIEW_REQUIRED by default.
- PCA CA cert renewal is separate from end-cert renewal. An expiring CA breaks ALL certs it issues, regardless of their own expiry.
- CloudFront certs must be in us-east-1. Any other region silently fails the distribution update.
- DNS validation CNAME records must persist for the cert's lifetime. Deleting them after issuance breaks managed renewal silently.
Pre-flight: data requirements
| Input | Source | Why |
|---|---|---|
| Cert ARN + domain | acm describe-certificates |
Renewal target |
| Status + validation method | DomainValidationOptions |
Drives renewal path |
| Associated service | InUseBy[] |
Managed vs manual |
| DaysToExpiry metric | CloudWatch AWS/CertificateManager |
Detection |
| Route 53 hosted zone | route53 list-hosted-zones |
DNS validation |
| PCA CA ARN | acm-pca list-certificate-authorities |
Private CA lifecycle |
Process — Renewal pipeline design
Step 0: Expert knowledge — non-obvious ACM + PCA behaviors
All Step 0 behaviors moved verbatim to references/advanced-patterns.md. Load on demand when classifying non-obvious ACM/PCA behaviors (60-day window, InUseBy, wildcards/SAN, SNI, idempotency).
Step 1: Classify the certificate
| Cert class | Validation | Attached | Renewal path |
|---|---|---|---|
| Public ACM | DNS | ALB/NLB/CF/API GW | Managed (automatic) |
| Public ACM | DNS | Orphaned | Custom pipeline (re-associate or manual) |
| Public ACM | Supported service | Semi-manual (email approval) | |
| Imported | N/A | Any | Manual (re-import) |
| PCA-issued via ACM | DNS | ALB/NLB/API GW | Custom pipeline |
| PCA-exported | N/A | On-prem/IoT | Full manual pipeline |
Imported certs (private key) are REVIEW_REQUIRED by construction.
Step 2: CloudWatch alarm on DaysToExpiry
aws cloudwatch put-metric-alarm \
--alarm-name acm-cert-expiring-30-days \
--namespace AWS/CertificateManager \
--metric-name DaysToExpiry \
--dimensions Name=CertificateArn,Value=arn:aws:acm:us-east-1:111111111111:certificate/abc-123 \
--statistic Minimum --period 86400 --threshold 30 \
--comparison-operator LessThanThreshold --evaluation-periods 1 \
--alarm-actions arn:aws:sns:us-east-1:111111111111:cert-expiry-alerts
Fleet-wide alarm variant moved verbatim to references/advanced-patterns.md. Load on demand when wiring detection across the whole cert fleet.
Threshold matrix:
| Threshold | Purpose | Action |
|---|---|---|
| 45 days | Early warning | Notify Slack; verify managed renewal will fire |
| 30 days | Action required | If managed renewal hasn't fired, investigate |
| 14 days | Urgent | Manual renewal path; engage on-call |
| 7 days | Critical | Page on-call; exec escalation |
The metric updates once daily. PENDING_VALIDATION and EXPIRED certs do NOT emit this metric. A fleet-wide alarm identifies that SOME cert is expiring but not WHICH — pair with the scan Lambda.
Step 3: EventBridge daily cert scan
aws events put-rule \
--name acm-daily-cert-scan \
--schedule-expression "rate(1 day)" --state ENABLED
aws events put-targets \
--rule acm-daily-cert-scan \
--targets '[{"Id":"cert-scan-lambda","Arn":"arn:aws:lambda:us-east-1:111111111111:function:acm-cert-scan","DeadLetterConfig":{"Arn":"arn:aws:sqs:us-east-1:111111111111:cert-scan-dlq"}}]'
Cert-scan Lambda implementation moved verbatim to references/diagnostic-commands.md. Load on demand when deploying the EventBridge scan target (the risk table below stays).
| Risk | Criteria | Action |
|---|---|---|
| CRITICAL | < 7 days | Page on-call |
| HIGH | < 30 days AND INELIGIBLE | Manual renewal |
| MEDIUM | < 45 days AND orphaned | Re-associate or delete |
| LOW | < 60 days, managed renewal should fire | Verify status |
| OK | >= 60 days AND ELIGIBLE | No action |
Step 4: Lambda renewal function (custom renewal flow)
For certs requiring custom renewal (orphaned, imported, PCA-issued):
Full renew_certificate implementation moved verbatim to references/acm-renewal-paths.md (Path 2: custom renewal pipeline).
Load on demand when emitting the custom renewal function (the decision tree below stays).
Renewal flow decision tree:
DNS-validated + attached to supported service?
├─ Yes → ACM managed renewal. Verify RenewalEligibility = ELIGIBLE.
└─ No → Custom pipeline: request → validate → attach → verify.
If imported → MANUAL re-import flow.
If PCA-issued → issue from PCA + validate + attach.
Step 5: DNS validation via Route 53
aws acm describe-certificate \
--certificate-arn arn:aws:acm:us-east-1:111111111111:certificate/abc-123 \
--query 'Certificate.DomainValidationOptions[].ResourceRecord'
aws route53 change-resource-record-sets \
--hosted-zone-id Z1ABCDEF23456 \
--change-batch '{"Changes":[{"Action":"UPSERT","ResourceRecordSet":{
"Name":"_abc123.example.com.","Type":"CNAME","TTL":300,
"ResourceRecords":[{"Value":"_xyz789.acm-validations.aws."}]
}}]}'
Wildcard and SAN: A wildcard cert (*.example.com) needs ONE CNAME.
A SAN cert needs ONE CNAME PER domain. A SAN combining example.com +
*.example.com needs TWO CNAMEs.
Common DNS validation failures:
Table moved verbatim to references/error-handling.md. Load on demand when DNS validation stalls or renewal fails later.
Step 6: ALB/NLB listener certificate rotation
For managed renewal, the listener automatically uses the renewed cert (ARN unchanged). For custom rotation (new ARN):
# Single cert
aws elbv2 modify-listener \
--listener-arn arn:aws:elasticloadbalancing:us-east-1:111111111111:listener/app/my-alb/abc/def \
--certificates CertificateArn=arn:aws:acm:us-east-1:111111111111:certificate/new-abc
# SNI (multiple certs — FIRST is default)
aws elbv2 modify-listener \
--listener-arn arn:aws:elasticloadbalancing:us-east-1:111111111111:listener/app/my-alb/abc/def \
--certificates \
CertificateArn=arn:aws:acm:us-east-1:111111111111:certificate/default-abc \
CertificateArn=arn:aws:acm:us-east-1:111111111111:certificate/sni-www-def \
CertificateArn=arn:aws:acm:us-east-1:111111111111:certificate/sni-api-ghi
NEVER replace the entire cert list without preserving SNI order.
Use add-listener-certificates to add the new cert, verify, then
remove-listener-certificates to remove the old one.
Step 7: CloudFront distribution certificate update
aws cloudfront update-distribution \
--id E1ABCDEF23456 --if-match ETVWXYZ \
--distribution-config '{"CallerReference":"rotation-001",...,
"ViewerCertificate":{
"CloudFrontDefaultCertificate":false,
"ACMCertificateArn":"arn:aws:acm:us-east-1:111111111111:certificate/new-cert",
"SSLSupportMethod":"sni-only",
"MinimumProtocolVersion":"TLSv1.2_2021"}}'
Rules: Fetch current ETag via get-distribution first. CallerReference
must be unique per update. Propagation takes 5-60 min — check for
Status: Deployed. Cert MUST be in us-east-1.
Step 8: API Gateway custom domain rotation
# REST API (v1)
aws apigateway update-domain-name \
--domain-name api.example.com \
--patch-operations op=replace,path=/certificateArn,value=arn:aws:acm:us-east-1:111111111111:certificate/new
# HTTP API (v2)
aws apigatewayv2 update-domain-name \
--domain-name api.example.com --domain-name-id abc123 \
--domain-name-configurations CertificateArn=arn:aws:acm:us-east-1:111111111111:certificate/new
Edge-optimized APIs require us-east-1 certs. Regional APIs require same-region certs. API mappings are independent of cert rotation.
Step 9: ACM PCA private certificate lifecycle
# Check CA validity
aws acm-pca describe-certificate-authority \
--certificate-authority-arn arn:aws:acm-pca:us-east-1:111111111111:certificate-authority/abc \
--query 'CertificateAuthority.{Status:Status,NotAfter:NotAfter}'
# Issue new end-certificate
aws acm-pca issue-certificate \
--certificate-authority-arn arn:aws:acm-pca:us-east-1:111111111111:certificate-authority/abc \
--csr file://csr.pem --signing-algorithm SHA256WITHRSA \
--validity Value=365,Type=DAYS --idempotency-token pca-renewal-001
PCA gotchas: PCA-issued certs via ACM CAN be managed-renewed IF attached to a supported service and the CA is active. PCA-exported certs have no managed renewal. The CA itself has a validity period (1-10 years subordinate, up to 25 root) and must be renewed manually.
Step 10: Cross-account certificate sharing
CloudFront auto-shares us-east-1 certs across the org. ALB/NLB/API Gateway do NOT support cross-account certs — request separately in each account.
Consumer IAM role needs:
{"Effect":"Allow","Action":["acm:GetCertificate","acm:DescribeCertificate"],
"Resource":"arn:aws:acm:us-east-1:111111111111:certificate/*"}
Step 11: SNI verification
openssl s_client -connect my-alb-123.us-east-1.elb.amazonaws.com:443 \
-servername www.example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -dates
The notAfter must reflect the NEW cert. If it shows the old cert's
expiry, propagation is incomplete — wait and retry.
Step 12: CloudTrail audit
CloudTrail lookup + anomaly-metric-filter commands moved verbatim to references/diagnostic-commands.md. Load on demand when auditing cert API calls (Step 12).
STRICT output contract
Every renewal design MUST emit a single block using these literal labels, in
this order. Do NOT substitute markdown headings or camelCase variants —
assertion-based evals and downstream automation parse the literal labels
CERTIFICATE:, VERDICT:, CHECKLIST:, GAP:, TEMPLATE:.
CERTIFICATE: <certificate-arn>
VERDICT: AUTOMATION_DEPLOYED | REVIEW_REQUIRED
CHECKLIST:
[x] DaysToExpiry: <countdown> (NotBefore <YYYY-MM-DD>, NotAfter <YYYY-MM-DD>)
[x] Renewal method: ACM_AUTO | MANUAL_REIMPORT | PCA_ISSUE | EMAIL_APPROVAL | CUSTOM_PIPELINE
[x] RenewalEligibility: ELIGIBLE | INELIGIBLE
[x] DNS validation: VALIDATED | PENDING | FAILED | N/A (CNAME <record> -> <target>)
[x] InUseBy: ALB <arn> | CloudFront <dist-id> | API Gateway <domain> | ORPHANED
[x] RenewalStatus: PENDING_AUTO_RENEWAL | IN_PROGRESS | SUCCESS | FAILED
[x] Detection: CloudWatch DaysToExpiry < <threshold> + EventBridge scan rate(1 day)
GAP: <if REVIEW_REQUIRED, the specific gap and remediation>
TEMPLATE: <CLI snippet or YAML; "(held in draft)" if blocked>
FORBIDDEN output patterns — NEVER
-
NEVER emit
VERDICT: AUTOMATION_DEPLOYEDwhile any CHECKLIST item is[ ](unchecked). Any unmet requirement forcesREVIEW_REQUIRED. -
NEVER claim
Renewal method: ACM_AUTOfor an imported (private-key) cert. ACM holds no stored private key — those areMANUAL_REIMPORTby construction, regardless ofRenewalEligibility. -
NEVER report a renewal as complete without a fresh SNI check (
openssl s_client -servername <domain> -connect <endpoint>:443) showing the newnotAfter. CloudFront propagation is 5-60 min; ALB is immediate but verify anyway. -
NEVER report
DNS validation: VALIDATEDunless the CNAME (_abc.www.example.com -> _xyz.acm-validations.aws.) is still resolvable viadig. A deleted CNAME silently breaks the next managed renewal even when the cert is currentlyISSUED. -
NEVER emit a CloudFront renewal where the cert is outside
us-east-1. CloudFront silently ignores certs in any other region — the distribution continues serving the old cert with no error. -
NEVER omit the
InUseByclassification. An orphaned cert (InUseBy: []) disables ACM managed renewal even whenRenewalEligibility: ELIGIBLE. Always classify explicitly. -
NEVER emit
DaysToExpiryas a bare number — always pair it with the detection wiring (CloudWatch alarm threshold + EventBridge scan). A countdown with no alarm is noise, not automation.
Worked example — AUTOMATION_DEPLOYED (cert at 14 days, auto-renewal in progress)
CERTIFICATE: arn:aws:acm:us-east-1:111111111111:certificate/abc-123-def-456
VERDICT: AUTOMATION_DEPLOYED
CHECKLIST:
[x] DaysToExpiry: 14 (NotBefore 2025-08-11, NotAfter 2026-08-26; managed-renewal window opened at 60d on 2026-06-27)
[x] Renewal method: ACM_AUTO (DNS-validated cert attached to ALB — managed renewal path)
[x] RenewalEligibility: ELIGIBLE
[x] DNS validation: VALIDATED (CNAME _abc123.www.example.com -> _xyz789.acm-validations.aws., TTL 300, dig confirmed)
[x] InUseBy: arn:aws:elasticloadbalancing:us-east-1:111111111111:listener/app/prod-alb/abc/def (ALB HTTPS :443, SNI default cert)
[x] RenewalStatus: PENDING_AUTO_RENEWAL (ACM has fired daily renewal attempts since 60d window; CNAME propagation delayed; EventBridge scan + CloudWatch alarm < 30d both active)
[x] Detection: CloudWatch alarm acm-www-expiring-14d (DaysToExpiry < 30, SNS arn:aws:sns:us-east-1:111111111111:cert-expiry-alerts) + EventBridge acm-daily-cert-scan rate(1 day)
GAP: None
TEMPLATE:
# CloudWatch alarm — urgent tier (< 30 days) on the specific cert ARN
aws cloudwatch put-metric-alarm \
--alarm-name acm-www-expiring-14d --namespace AWS/CertificateManager \
--metric-name DaysToExpiry \
--dimensions Name=CertificateArn,Value=arn:aws:acm:us-east-1:111111111111:certificate/abc-123-def-456 \
--statistic Minimum --period 86400 --threshold 30 --comparison-operator LessThanThreshold \
--evaluation-periods 1 --alarm-actions arn:aws:sns:us-east-1:111111111111:cert-expiry-alerts
# EventBridge daily scan (catches gaps managed renewal cannot — orphaned, imported, PCA CA expiry)
aws events put-rule --name acm-daily-cert-scan --schedule-expression "rate(1 day)" --state ENABLED
# No re-import needed; managed renewal rotates the cert in place (ARN unchanged).
# Confirm renewal completion via SNI after RenewalStatus flips to SUCCESS:
openssl s_client -connect prod-alb-123.us-east-1.elb.amazonaws.com:443 -servername www.example.com \
</dev/null 2>/dev/null | openssl x509 -noout -subject -dates
Worked example — REVIEW_REQUIRED (imported orphaned cert)
Full block moved verbatim to references/worked-examples.md. Load on demand when the verdict is REVIEW_REQUIRED (imported/orphaned cert).
Decision tree — renewal path classification
Start: cert with DaysToExpiry ≤ 60
├─ Imported cert (Status: ISSUED, RenewalEligibility: INELIGIBLE)?
│ └─ Yes → MANUAL_REIMPORT → VERDICT: REVIEW_REQUIRED
│ (external CA + aws acm import-certificate + re-attach)
├─ RenewalEligibility = ELIGIBLE AND InUseBy ≠ []?
│ ├─ Yes → Validation method?
│ │ ├─ DNS + CNAME resolvable → ACM_AUTO → VERDICT: AUTOMATION_DEPLOYED
│ │ │ (verify SNI post-rotation)
│ │ └─ DNS CNAME missing OR EMAIL → REVIEW_REQUIRED
│ │ (fix CNAME or migrate EMAIL→DNS)
│ └─ No (orphaned or INELIGIBLE) → go to next branch
├─ PCA-issued via ACM (Status: ISSUED, CertificateAuthorityArn present)?
│ ├─ CA Status = ACTIVE AND cert attached → ACM_AUTO with CA-health check
│ └─ CA expired OR cert orphaned → REVIEW_REQUIRED (renew CA first)
└─ PCA-exported (used outside AWS)?
└─ Full manual pipeline → REVIEW_REQUIRED (issue from PCA + export + ship)
Anti-Patterns — NEVER do these
-
NEVER assume ACM managed renewal covers all certificates. It covers ONLY DNS/email-validated certs attached to supported services. Always check
RenewalEligibility. -
NEVER delete DNS validation CNAMEs after issuance. They must persist for the cert's lifetime for ACM to re-validate during renewal.
-
NEVER request a new certificate without checking for existing ones.
request-certificatecreates duplicates. Uselist-certificatesfirst. -
NEVER put a CloudFront cert outside us-east-1. It silently fails.
-
NEVER update an ALB listener cert list without preserving SNI order.
modify-listener --certificatesREPLACES the entire list. -
NEVER use email validation for new certificates. It requires human action on every renewal. Use DNS validation.
-
NEVER forget PCA CA expiry. An expired CA breaks all certs it issued even if end-certs haven't reached their own expiry. Check CA
NotAfter90+ days in advance. -
NEVER update a CloudFront distribution with a stale ETag. It fails silently. Always
get-distributionfor the current ETag first. -
NEVER omit the DLQ on the EventBridge cert-scan target. Without a DLQ, failed scans are silently dropped.
-
NEVER skip SNI verification after rotation. The config may show the new cert but the TLS handshake may still serve the old cert during propagation.
-
NEVER share certs cross-account for ALB/NLB. They require same-account certs. Request separately in each account.
-
NEVER rotate all certs simultaneously. Rotate one, verify, then proceed. A batch failure leaves the fleet inconsistent.
-
NEVER omit CloudTrail auditing. A compromised credential can
delete-certificateto disrupt renewal.
Pre-flight safety checks
-
CONFIRMATION GATE before any state-changing operation:
CONFIRM: About to <action> for certificate <domain> in account <account>. Proceed? (yes/no) -
Back up configs: Save listener/distribution config before modifying.
-
Before production rotation: verify new cert status is
issued:aws acm describe-certificate --certificate-arn <new> --query 'Certificate.Status' -
Before deleting old cert: verify
InUseByis[]. -
For PCA rotation: verify CA is
ACTIVE.
Appendix A — Renewal eligibility matrix
Matrix moved verbatim to references/acm-renewal-paths.md. Load on demand for the full renewal-path classification.
Appendix B — Decision tree
Tree moved verbatim to references/advanced-patterns.md. Load on demand for the condensed renewal-path decision logic (the main decision tree under STRICT output contract stays).
Appendix C — CloudFormation skeleton
Full CloudFormation skeleton moved verbatim to references/advanced-patterns.md. Load on demand when emitting IaC for the renewal pipeline.
Recent AWS features (2024-2026)
Moved verbatim to references/advanced-patterns.md. Load on demand for 2024-2026 ACM/PCA/CloudFront feature coverage.
Expert heuristic: renewal coverage gap
Heuristic + verification protocol moved verbatim to references/advanced-patterns.md. Load on demand when deciding detection depth for a cert fleet.
References (load on demand)
- references/acm-renewal-paths.md — renewal-path CLI references; custom-pipeline Lambda implementation; renewal eligibility matrix.
- references/imported-cert-manual-renewal.md — manual re-import flow for imported private-key certs.
- references/advanced-patterns.md — Step 0 expert knowledge, appendices (decision tree, CloudFormation skeleton), 2024-2026 features, coverage-gap heuristic.
- references/diagnostic-commands.md — cert-scan Lambda and CloudTrail audit commands.
- references/worked-examples.md — REVIEW_REQUIRED worked example (secondary).
- references/error-handling.md — DNS validation failure table.
Domain
AWS CloudOps / Security Automation — TLS certificate lifecycle.
AWS documentation
- ACM Managed Renewal — https://docs.aws.amazon.com/acm/latest/userguide/managed-renewal.html
- ACM DNS Validation — https://docs.aws.amazon.com/acm/latest/userguide/dns-validation.html
- AWS Private CA — https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaWelcome.html
- CloudFront Viewer Certificates — https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-alternate-domain-names.html
- ALB SNI — https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listeners.html
04 同仓库更多 Skills
xray-tracing-deployer
Deploys AWS X-Ray distributed tracing with production-grade configuration: X-Ray daemon deployment (EC2 systemd, ECS sidecar, EKS DaemonSet, Lambda built-in), SDK instrumentation (Java, Python, Node.js, Go, .NET) with annotations and metadata, sampling rules (default reservoir + rate vs custom rules with URL / method / service-name predicates), service map generation, trace query and retrieval, groups and insights, CloudWatch ServiceLens integration, IAM permissions (PutTraceSegments, GetSamplingRules), and latest features (Lambda Powertools tracing, OpenTelemetry / ADOT Collector support, W3C trace context). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when enabling X-Ray on a new application, adding tracing to ECS / EKS / Lambda, validating a sampling configuration, or generating daemon deployment CLI and IaC templates. Triggers: X-Ray, distributed tracing, X-Ray daemon, sampling rules, service map, X-Ray SDK, OpenTelemetry, ADOT, Lambda Powertools, CloudWatch ServiceLens.
wellarchitected-workload-auditor
Audits AWS Well-Architected Tool workloads for review staleness, per-pillar high-risk issue counts, milestone tracking gaps, and remediation plan completeness. Emits a deterministic verdict (STALE_REVIEW | HIGH_RISK | CONFIG_GAP | OK) per workload with per-pillar risk breakdown, milestone trend analysis, and specific remediation. Use when reviewing Well-Architected workloads, checking WA review freshness, auditing high-risk issues per pillar, validating milestone coverage, or tracking remediation plans.
wellarchitected-review-operator
Operates AWS Well-Architected Tool reviews end-to-end — creates workloads, runs pillar reviews (operational excellence, security, reliability, performance, cost optimization, sustainability, Prosperity), answers questions with risk-tier rationale, generates reports and improvement plans, creates milestones, and integrates with Trusted Advisor and Well-Architected Labs. Runs deterministic pre-checks (workload existence, lens availability, pillar coverage), emits the exact update-answer / get-consolidated-report CLI behind a CONFIRM gate, and verifies risk-tier transitions. Emits READY | BLOCKED | COMPLETED. Use when creating a workload, answering pillar questions, generating an improvement plan, creating a milestone, or integrating with Trusted Advisor. Triggers: well-architected tool, well architected review, workload review, pillar, operational excellence, security, reliability, performance, cost optimization, sustainability, prosperity, improvement plan, milestone, trusted advisor.
wafv2-web-acl-deployer
Provisions AWS WAFv2 Web ACLs with correct production defaults: scope selection (CLOUDFRONT vs REGIONAL), managed rule groups (AWSManagedRulesCommonRuleSet, SQLiRuleSet, LinuxRuleSet, WindowsRuleSet, IPReputationList, BotControlRuleSet, AmazonIpReputationList, ATP), custom rules (byte match, IP set, regex pattern, geo match, size constraint, rate-based), rule priority ordering, logging destinations (Kinesis Firehose, CloudWatch Logs, S3), resource association (ALB, API Gateway, CloudFront), rate-based rules with aggregate keys (IP, forwarded IP), Challenge and CAPTCHA actions, and account takeover prevention. Emits a READY_TO_DEPLOY checklist. Use when creating a Web ACL, attaching managed rules, configuring rate limiting, enabling WAF logging, associating a Web ACL with an ALB/API Gateway/CloudFront, or configuring CAPTCHA/Challenge actions. Triggers: create WAF Web ACL, WAFv2, managed rule groups, WAF rate limiting, WAF logging, WAF CAPTCHA, WAF Challenge action, bot control, ATP managed rules.
wafv2-web-acl-auditor
Audits AWS WAFv2 Web ACL configurations to determine whether the ACL provides effective protection: default-action posture (Allow vs Block), managed-rule-group coverage gaps, rule effectiveness (BLOCK vs COUNT, shadow/bypass rules, stale exclusions), rate-based rule correctness, logging and visibility configuration, and text-transformation bypass vectors. Emits a deterministic verdict per Web ACL. Use when reviewing a WAFv2 Web ACL for security posture, checking managed-rule coverage, validating rate-limit configuration, auditing WAF logging, or hardening a WAF before production deployment. Triggers: WAF, WAFv2, Web ACL, managed rule group, AWSManagedRules, rate-based rule, CAPTCHA, Challenge, OverrideAction, Count mode, forwarded IP, Bot Control, ATP, text transformation, WAF logging, WAF visibility, OWASP, SQLi, XSS, RFI.
waf-rule-deployer
Provisions AWS WAFv2 rule sets with production defaults: Web ACL creation (CloudFront scope in us-east-1 vs Regional scope), rule groups (managed vs custom) with capacity planning in WCU (Web ACL Capacity Units, 1500 default per ACL), managed rule groups (AWSManagedRulesCommonRuleSet, AWSManagedRulesSQLiRuleSet, AWSManagedRulesAmazonIpReputationList, AWSManagedRulesLinuxRuleSet, AWSManagedRulesWindowsRuleSet, AWSManagedRulesUnixRuleSet), custom rules (byte-match, regex pattern set, geo-match, rate-based), IP set and regex pattern set resources, rule priority ordering (lowest number evaluated first), action types (allow, block, count, CAPTCHA, Challenge), bot control managed rule group, account takeover. Triggers: create WAF rule, WAF managed rule group, WAF custom rule, WAF byte match, WAF geo match, WAF rate based rule, WAF IP set, WAF regex pattern set, WAF WCU budget, WAF CloudFront ACL, WAF logging Kinesis Firehose, WAF bot control, WAF ATP, WAF label matching, WAF Challenge action, WAF CAPTCHA.