Skip to content

Data Source: awsAcmCertificate

Use this data source to get the ARN of a certificate in AWS Certificate Manager (ACM), you can reference it by domain without having to hard code the ARNs as input.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.dataAwsAcmCertificate.DataAwsAcmCertificate(this, "amazon_issued", {
  domain: "tf.example.com",
  mostRecent: true,
  types: ["AMAZON_ISSUED"],
});
new aws.dataAwsAcmCertificate.DataAwsAcmCertificate(this, "issued", {
  domain: "tf.example.com",
  statuses: ["ISSUED"],
});
new aws.dataAwsAcmCertificate.DataAwsAcmCertificate(this, "rsa_4096", {
  domain: "tf.example.com",
  keyTypes: ["RSA_4096"],
});

Argument Reference

  • domain - (Required) Domain of the certificate to look up. If no certificate is found with this name, an error will be returned.
  • keyTypes - (Optional) List of key algorithms to filter certificates. By default, ACM does not return all certificate types when searching. See the ACM API Reference for supported key algorithms.
  • statuses - (Optional) List of statuses on which to filter the returned list. Valid values are PENDING_VALIDATION, issued, inactive, expired, VALIDATION_TIMED_OUT, revoked and failed. If no value is specified, only certificates in the issued state are returned.
  • types - (Optional) List of types on which to filter the returned list. Valid values are AMAZON_ISSUED, private, and imported.
  • mostRecent - (Optional) If set to true, it sorts the certificates matched by previous criteria by the NotBefore field, returning only the most recent one. If set to false, it returns an error if more than one certificate is found. Defaults to false.

Attributes Reference

  • arn - ARN of the found certificate, suitable for referencing in other resources that support ACM certificates.
  • id - ARN of the found certificate, suitable for referencing in other resources that support ACM certificates.
  • status - Status of the found certificate.
  • certificate - ACM-issued certificate.
  • certificateChain - Certificates forming the requested ACM-issued certificate's chain of trust. The chain consists of the certificate of the issuing CA and the intermediate certificates of any other subordinate CAs.
  • tags - Mapping of tags for the resource.