Data Source: aws_acm_certificate

Use this data source to get the ARN of a certificate in AWS Certificate Manager (ACM). The process of requesting and verifying a certificate in ACM requires some manual steps, which means that Terraform cannot automate the creation of ACM certificates. But using this data source, you can reference them by domain without having to hard code the ARNs as input.

Example Usage

data "aws_acm_certificate" "example" {
  domain   = "tf.example.com"
  statuses = ["ISSUED"]
}

data "aws_acm_certificate" "example" {
  domain   = "tf.example.com"
  types = ["AMAZON_ISSUED"]
  most_recent = true
}

Argument Reference

  • domain - (Required) The domain of the certificate to look up. If no certificate is found with this name, an error will be returned.
  • statuses - (Optional) A 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) A list of types on which to filter the returned list. Valid values are AMAZON_ISSUED and IMPORTED.
  • most_recent - (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 - Set to the ARN of the found certificate, suitable for referencing in other resources that support ACM certificates.

© 2018 HashiCorp
Licensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/aws/d/acm_certificate.html