ACM
AWS Certificate Manager — request / import / export / revoke certificates, tags, account configuration. JSON 1.1 protocol.
fakecloud implements AWS Certificate Manager's full JSON 1.1 control plane: 17 operations covering certificate lifecycle, import/export, tags, and account-wide expiry events. 100% Smithy conformance.
Status: 100% control-plane coverage.
Supported today
- Public certificate lifecycle —
RequestCertificateacceptsDomainName,SubjectAlternativeNames,ValidationMethod(DNS / EMAIL),IdempotencyToken,KeyAlgorithm,Options,CertificateAuthorityArn,ManagedBy,Tags. The certificate lands atPENDING_VALIDATIONwithType = AMAZON_ISSUED. DNS-validated certs are auto-promoted toISSUEDafter a configurable delay (default 5 seconds, override with the env varFAKECLOUD_ACM_AUTO_ISSUE_SECS), simulating ACM's async validation pipeline. EMAIL-validated certs stayPENDING_VALIDATIONuntil the admin/approveendpoint flips them — matching real ACM, which waits for the user to click the validation link. Tests can also flip status to any state synchronously via the/statusadmin endpoint below. Idempotency: a request re-issued with the sameIdempotencyToken+DomainName+ SANs returns the sameCertificateArn.DescribeCertificatereturns the fullCertificateDetailincluding domain validation, options, key usages, ARN, status, validity window,RenewalEligibility,RenewalSummary(once issued), andFailureReasonwhen present.GetCertificatereturns the real self-signed PEM + chain stored atRequestCertificatetime.ListCertificatessupportsMaxItems+NextToken+CertificateStatuses+Includes.keyTypes.SearchCertificateshonorsFilterStatement.Filter.KeyTypes(And/Or/Not composition is parsed but ignored).DeleteCertificaterejects withResourceInUseExceptionwhileInUseByis non-empty. - Imported certificates —
ImportCertificateaccepts the PEM cert + private key + optional chain (base64-encoded over the wire), stores them, and flipsStatustoISSUEDwithType = IMPORTED. Passing an existingCertificateArnre-imports in place (the cert must already beIMPORTED).ExportCertificatereturns the stored cert + chain + private key; whenPassphraseis supplied, the private key is wrapped in a PKCS#8 v2BEGIN ENCRYPTED PRIVATE KEYenvelope (PBES2 / PBKDF2-HMAC-SHA256, 2048 iterations, AES-256-CBC) so callers can round-trip viaopenssl pkcs8 -in key.pem -passin pass:...or any modern PKCS#8 decoder. OmittingPassphrasereturns the plain PEM. Imported certs are not eligible forRevokeCertificate(InvalidParameterException) orRenewCertificate. - Renewal + revocation —
RenewCertificate(AMAZON_ISSUED only) bumpsNotBefore/NotAfterby 13 months, marks every domain validationSUCCESS, flips status toISSUED, and refreshesRenewalSummarywithRenewalStatus = SUCCESSand a freshUpdatedAt.RevokeCertificaterequiresRevocationReason, setsStatus = REVOKEDand stampsRevokedAt. - Email validation —
ResendValidationEmailis only valid whenValidationMethod = EMAIL; DNS-validated certs returnInvalidParameterException. - Tags —
AddTagsToCertificateupserts tags by key,RemoveTagsFromCertificatedeletes by key (optionally also matching value),ListTagsForCertificatereturns the tag set sorted by key for deterministic test output. - Account configuration —
PutAccountConfigurationacceptsIdempotencyToken+ExpiryEvents.DaysBeforeExpiry;GetAccountConfigurationreturns it back. - Certificate options —
UpdateCertificateOptionsupdatesCertificateTransparencyLoggingPreferenceandExport. - Domain validation gating — DNS-validated certificates are auto-issued by the background tick once the configured delay elapses; EMAIL-validated certificates stay
PENDING_VALIDATIONuntil a test drives the synchronous/_fakecloud/acm/certificates/{arn-or-id}/approveadmin endpoint. The validationResourceRecordreturned byDescribeCertificateis deterministic per(DomainName, ValidationMethod)so tests can assert on its shape, andResendValidationEmailis rejected for DNS-validated certs to match real ACM. ImportCertificateKMS policy enforcement — when a CMK is in scope (account-default or explicitly referenced from the import flow), the KMS hook is exercised end-to-end: the calling identity's IAM grants and the CMK's key policy / grants are evaluated againstkms:Encrypt/kms:Decrypt/kms:GenerateDataKeybefore the cert bytes are persisted. Denied calls land in/_fakecloud/kms/usagewith the rejection reason, so tests can assert that an import truly failed at the policy boundary rather than silently storing the cert. See IAM policy enforcement for the full model.
Smoke test
fakecloud &
ARN=$(aws --endpoint-url http://localhost:4566 acm request-certificate \
--domain-name api.example.com \
--validation-method DNS \
--query CertificateArn --output text)
aws --endpoint-url http://localhost:4566 acm describe-certificate \
--certificate-arn "$ARN"
aws --endpoint-url http://localhost:4566 acm add-tags-to-certificate \
--certificate-arn "$ARN" \
--tags Key=env,Value=prod
aws --endpoint-url http://localhost:4566 acm list-tags-for-certificate \
--certificate-arn "$ARN"Admin endpoints
POST /_fakecloud/acm/certificates/{arn-or-id}/status— flip a stored certificate's status synchronously. Body{"status": "ISSUED"}promotes it toISSUED(and stampsIssuedAt);{"status": "FAILED", "reason": "validation declined"}records the failure surfaced asFailureReasononDescribeCertificate;{"status": "VALIDATION_TIMED_OUT"}is also accepted. The{arn-or-id}segment is the trailing UUID of the certificate ARN (everything aftercertificate/). Returns204 No Contenton success and404 Not Foundfor an unknown id. Available in every fakecloud SDK asacm.setCertificateStatus(arn_or_id, ...)(or the language-idiomatic equivalent).POST /_fakecloud/acm/certificates/{arn-or-id}/approve— synchronous equivalent of "the user clicked the validation link in the email". Flips aPENDING_VALIDATIONcert toISSUED, stampsIssuedAt, marks every domain validation entrySUCCESS, and populatesRenewalSummary. Idempotent — calling against an already-issued cert is a no-op success. Primarily used to drive the EMAIL validation flow in tests, since EMAIL certs do not auto-issue. Returns204on success and404for an unknown id. SDK alias:acm.approveCertificate(arn_or_id).GET /_fakecloud/acm/certificates/{arn-or-id}/chain-info— introspection endpoint that reports the PEM block count and byte length of the stored certificate and its chain, plus the certstatus,cert_type, and a constantexternal_ca_validated: falsemarker documenting that fakecloud does not run a real X.509 verifier. Useful forImportCertificatetests that need to confirm the chain they uploaded round-trips intact without re-fetching and parsing the cert. Returns200with the JSON document on success and404for an unknown id. SDK alias:acm.getCertificateChainInfo(arn_or_id).
Caveats
fakecloud does not run the real X.509 validation pipeline. The auto-issue tick flips DNS-validated certs from PENDING_VALIDATION to ISSUED after a fixed delay regardless of whether the synthesized validation ResourceRecord was actually published; the record is deterministic per domain but never observed by a real validator. EMAIL-validated certs never auto-flip — drive their issuance through the /approve admin endpoint. ImportCertificate does not parse the input X.509 cert — it stores the bytes verbatim and uses the cheap CN= substring scan to extract DomainName. ExportCertificate returns the imported cert as-is when one exists or a placeholder PEM otherwise. When a Passphrase is supplied, the stored private key must be a valid PKCS#8 PEM (BEGIN PRIVATE KEY); legacy PKCS#1 (BEGIN RSA PRIVATE KEY) imports cannot be encrypted. KeyUsages and ExtendedKeyUsages reported by DescribeCertificate are constants (DIGITAL_SIGNATURE + KEY_ENCIPHERMENT, TLS server + client auth) — fakecloud does not extract them from imported certs.