@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
171 lines (170 loc) • 6.78 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Use this data source to get the ARN of a certificate in AWS Certificate Manager (ACM).
* You can reference the certificate by domain or tags without having to hard code the ARNs as input.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* // Find a certificate that is issued
* const issued = aws.acm.getCertificate({
* domain: "tf.example.com",
* statuses: ["ISSUED"],
* });
* // Find a certificate issued by (not imported into) ACM
* const amazonIssued = aws.acm.getCertificate({
* domain: "tf.example.com",
* types: ["AMAZON_ISSUED"],
* mostRecent: true,
* });
* // Find a RSA 4096 bit certificate
* const rsa4096 = aws.acm.getCertificate({
* domain: "tf.example.com",
* keyTypes: ["RSA_4096"],
* });
* ```
*/
export declare function getCertificate(args?: GetCertificateArgs, opts?: pulumi.InvokeOptions): Promise<GetCertificateResult>;
/**
* A collection of arguments for invoking getCertificate.
*/
export interface GetCertificateArgs {
/**
* Domain of the certificate to look up. If set and no certificate is found with this name, an error will be returned.
*/
domain?: string;
/**
* List of key algorithms to filter certificates. By default, ACM does not return all certificate types when searching. See the [ACM API Reference](https://docs.aws.amazon.com/acm/latest/APIReference/API_CertificateDetail.html#ACM-Type-CertificateDetail-KeyAlgorithm) for supported key algorithms.
*/
keyTypes?: string[];
/**
* 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.
*/
mostRecent?: boolean;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: string;
/**
* 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.
*/
statuses?: string[];
/**
* A mapping of tags, each pair of which must exactly match a pair on the desired certificates.
*/
tags?: {
[key: string]: string;
};
/**
* List of types on which to filter the returned list. Valid values are `AMAZON_ISSUED`, `PRIVATE`, and `IMPORTED`.
*/
types?: string[];
}
/**
* A collection of values returned by getCertificate.
*/
export interface GetCertificateResult {
/**
* ARN of the found certificate, suitable for referencing in other resources that support ACM certificates.
*/
readonly arn: string;
/**
* ACM-issued certificate.
*/
readonly certificate: string;
/**
* 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.
*/
readonly certificateChain: string;
readonly domain: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly keyTypes?: string[];
readonly mostRecent?: boolean;
readonly region: string;
/**
* Status of the found certificate.
*/
readonly status: string;
readonly statuses?: string[];
/**
* Mapping of tags for the resource.
*/
readonly tags: {
[key: string]: string;
};
readonly types?: string[];
}
/**
* Use this data source to get the ARN of a certificate in AWS Certificate Manager (ACM).
* You can reference the certificate by domain or tags without having to hard code the ARNs as input.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* // Find a certificate that is issued
* const issued = aws.acm.getCertificate({
* domain: "tf.example.com",
* statuses: ["ISSUED"],
* });
* // Find a certificate issued by (not imported into) ACM
* const amazonIssued = aws.acm.getCertificate({
* domain: "tf.example.com",
* types: ["AMAZON_ISSUED"],
* mostRecent: true,
* });
* // Find a RSA 4096 bit certificate
* const rsa4096 = aws.acm.getCertificate({
* domain: "tf.example.com",
* keyTypes: ["RSA_4096"],
* });
* ```
*/
export declare function getCertificateOutput(args?: GetCertificateOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetCertificateResult>;
/**
* A collection of arguments for invoking getCertificate.
*/
export interface GetCertificateOutputArgs {
/**
* Domain of the certificate to look up. If set and no certificate is found with this name, an error will be returned.
*/
domain?: pulumi.Input<string>;
/**
* List of key algorithms to filter certificates. By default, ACM does not return all certificate types when searching. See the [ACM API Reference](https://docs.aws.amazon.com/acm/latest/APIReference/API_CertificateDetail.html#ACM-Type-CertificateDetail-KeyAlgorithm) for supported key algorithms.
*/
keyTypes?: pulumi.Input<pulumi.Input<string>[]>;
/**
* 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.
*/
mostRecent?: pulumi.Input<boolean>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* 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.
*/
statuses?: pulumi.Input<pulumi.Input<string>[]>;
/**
* A mapping of tags, each pair of which must exactly match a pair on the desired certificates.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* List of types on which to filter the returned list. Valid values are `AMAZON_ISSUED`, `PRIVATE`, and `IMPORTED`.
*/
types?: pulumi.Input<pulumi.Input<string>[]>;
}