Skip to content

Data Source: awsIamServerCertificate

Use this data source to lookup information about IAM Server Certificates.

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";
const dataAwsIamServerCertificateMyDomain =
  new aws.dataAwsIamServerCertificate.DataAwsIamServerCertificate(
    this,
    "my-domain",
    {
      latest: true,
      namePrefix: "my-domain.org",
    }
  );
new aws.elb.Elb(this, "elb", {
  listener: [
    {
      instancePort: 8000,
      instanceProtocol: "https",
      lbPort: 443,
      lbProtocol: "https",
      sslCertificateId: dataAwsIamServerCertificateMyDomain.arn,
    },
  ],
  name: "my-domain-elb",
});

Argument Reference

  • namePrefix - prefix of cert to filter by
  • pathPrefix - prefix of path to filter by
  • name - exact name of the cert to lookup
  • latest - sort results by expiration date. returns the certificate with expiration date in furthest in the future.

Attributes Reference

  • id is set to the unique id of the IAM Server Certificate
  • arn is set to the ARN of the IAM Server Certificate
  • path is set to the path of the IAM Server Certificate
  • expirationDate is set to the expiration date of the IAM Server Certificate
  • uploadDate is the date when the server certificate was uploaded
  • certificateBody is the public key certificate (PEM-encoded). This is useful when configuring back-end instance authentication policy for load balancer
  • certificateChain is the public key certificate chain (PEM-encoded) if exists, empty otherwise

Import

The terraform import function will read in certificate body, certificate chain (if it exists), id, name, path, and arn. It will not retrieve the private key which is not available through the AWS API.