tls_certificate (Data Source)

Get information about the TLS certificates securing a host.

Use this data source to get information, such as SHA1 fingerprint or serial number, about the TLS certificates that protects a URL.

Example Usage

URL Usage

// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
import { Construct } from "constructs";
import { Fn, Token, TerraformStack } from "cdktf";
/*
 * Provider bindings are generated by running `cdktf get`.
 * See https://cdk.tf/provider-generation for more details.
 */
import { EksCluster } from "./.gen/providers/aws/eks-cluster";
import { IamOpenidConnectProvider } from "./.gen/providers/aws/iam-openid-connect-provider";
import { DataTlsCertificate } from "./.gen/providers/tls/data-tls-certificate";
interface MyConfig {
  roleArn: any;
  vpcConfig: any;
}
class MyConvertedCode extends TerraformStack {
  constructor(scope: Construct, name: string, config: MyConfig) {
    super(scope, name);
    const example = new EksCluster(this, "example", {
      name: "example",
      roleArn: config.roleArn,
      vpcConfig: config.vpcConfig,
    });
    const dataTlsCertificateExample = new DataTlsCertificate(
      this,
      "example_1",
      {
        url: Token.asString(
          Fn.lookupNested(example.identity, ["0", "oidc", "0", "issuer"])
        ),
      }
    );
    /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
    dataTlsCertificateExample.overrideLogicalId("example");
    const awsIamOpenidConnectProviderExample = new IamOpenidConnectProvider(
      this,
      "example_2",
      {
        clientIdList: ["sts.amazonaws.com"],
        thumbprintList: [
          Token.asString(
            Fn.lookupNested(dataTlsCertificateExample.certificates, [
              "0",
              "sha1_fingerprint",
            ])
          ),
        ],
        url: Token.asString(
          Fn.lookupNested(example.identity, ["0", "oidc", "0", "issuer"])
        ),
      }
    );
    /*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
    awsIamOpenidConnectProviderExample.overrideLogicalId("example");
  }
}

Content Usage

// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
import { Construct } from "constructs";
import { Fn, Token, TerraformStack } from "cdktf";
/*
 * Provider bindings are generated by running `cdktf get`.
 * See https://cdk.tf/provider-generation for more details.
 */
import { DataTlsCertificate } from "./.gen/providers/tls/data-tls-certificate";
class MyConvertedCode extends TerraformStack {
  constructor(scope: Construct, name: string) {
    super(scope, name);
    new DataTlsCertificate(this, "example_content", {
      content: Token.asString(Fn.file("example.pem")),
    });
  }
}

Schema

Optional

Read-Only

Nested Schema for certificates

Read-Only: