GetCertificate
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
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Aws.Acm.GetCertificate.InvokeAsync(new Aws.Acm.GetCertificateArgs
{
Domain = "tf.example.com",
KeyTypes =
{
"RSA_4096",
},
}));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/acm"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := acm.LookupCertificate(ctx, &acm.LookupCertificateArgs{
Domain: "tf.example.com",
KeyTypes: []string{
"RSA_4096",
},
}, nil)
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example = aws.acm.get_certificate(domain="tf.example.com",
key_types=["RSA_4096"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// Find a RSA 4096 bit certificate
const example = pulumi.output(aws.acm.getCertificate({
domain: "tf.example.com",
keyTypes: ["RSA_4096"],
}, { async: true }));Using GetCertificate
function getCertificate(args: GetCertificateArgs, opts?: InvokeOptions): Promise<GetCertificateResult>function get_certificate(domain=None, key_types=None, most_recent=None, statuses=None, tags=None, types=None, opts=None)func LookupCertificate(ctx *Context, args *LookupCertificateArgs, opts ...InvokeOption) (*LookupCertificateResult, error)Note: This function is named
LookupCertificatein the Go SDK.
public static class GetCertificate {
public static Task<GetCertificateResult> InvokeAsync(GetCertificateArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Domain string
The domain of the certificate to look up. If no certificate is found with this name, an error will be returned.
- Key
Types List<string> A list of key algorithms to filter certificates. By default, ACM does not return all certificate types when searching. Valid values are
RSA_1024,RSA_2048,RSA_4096,EC_prime256v1,EC_secp384r1, andEC_secp521r1.- Most
Recent bool 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.
- Statuses List<string>
A list of statuses on which to filter the returned list. Valid values are
PENDING_VALIDATION,ISSUED,INACTIVE,EXPIRED,VALIDATION_TIMED_OUT,REVOKEDandFAILED. If no value is specified, only certificates in theISSUEDstate are returned.- Dictionary<string, string>
A mapping of tags for the resource.
- Types List<string>
A list of types on which to filter the returned list. Valid values are
AMAZON_ISSUEDandIMPORTED.
- Domain string
The domain of the certificate to look up. If no certificate is found with this name, an error will be returned.
- Key
Types []string A list of key algorithms to filter certificates. By default, ACM does not return all certificate types when searching. Valid values are
RSA_1024,RSA_2048,RSA_4096,EC_prime256v1,EC_secp384r1, andEC_secp521r1.- Most
Recent bool 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.
- Statuses []string
A list of statuses on which to filter the returned list. Valid values are
PENDING_VALIDATION,ISSUED,INACTIVE,EXPIRED,VALIDATION_TIMED_OUT,REVOKEDandFAILED. If no value is specified, only certificates in theISSUEDstate are returned.- map[string]string
A mapping of tags for the resource.
- Types []string
A list of types on which to filter the returned list. Valid values are
AMAZON_ISSUEDandIMPORTED.
- domain string
The domain of the certificate to look up. If no certificate is found with this name, an error will be returned.
- key
Types string[] A list of key algorithms to filter certificates. By default, ACM does not return all certificate types when searching. Valid values are
RSA_1024,RSA_2048,RSA_4096,EC_prime256v1,EC_secp384r1, andEC_secp521r1.- most
Recent boolean 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.
- statuses string[]
A list of statuses on which to filter the returned list. Valid values are
PENDING_VALIDATION,ISSUED,INACTIVE,EXPIRED,VALIDATION_TIMED_OUT,REVOKEDandFAILED. If no value is specified, only certificates in theISSUEDstate are returned.- {[key: string]: string}
A mapping of tags for the resource.
- types string[]
A list of types on which to filter the returned list. Valid values are
AMAZON_ISSUEDandIMPORTED.
- domain str
The domain of the certificate to look up. If no certificate is found with this name, an error will be returned.
- key_
types List[str] A list of key algorithms to filter certificates. By default, ACM does not return all certificate types when searching. Valid values are
RSA_1024,RSA_2048,RSA_4096,EC_prime256v1,EC_secp384r1, andEC_secp521r1.- most_
recent bool 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.
- statuses List[str]
A list of statuses on which to filter the returned list. Valid values are
PENDING_VALIDATION,ISSUED,INACTIVE,EXPIRED,VALIDATION_TIMED_OUT,REVOKEDandFAILED. If no value is specified, only certificates in theISSUEDstate are returned.- Dict[str, str]
A mapping of tags for the resource.
- types List[str]
A list of types on which to filter the returned list. Valid values are
AMAZON_ISSUEDandIMPORTED.
GetCertificate Result
The following output properties are available:
- Arn string
Set to the ARN of the found certificate, suitable for referencing in other resources that support ACM certificates.
- Domain string
- Id string
The provider-assigned unique ID for this managed resource.
- Dictionary<string, string>
A mapping of tags for the resource.
- Key
Types List<string> - Most
Recent bool - Statuses List<string>
- Types List<string>
- Arn string
Set to the ARN of the found certificate, suitable for referencing in other resources that support ACM certificates.
- Domain string
- Id string
The provider-assigned unique ID for this managed resource.
- map[string]string
A mapping of tags for the resource.
- Key
Types []string - Most
Recent bool - Statuses []string
- Types []string
- arn string
Set to the ARN of the found certificate, suitable for referencing in other resources that support ACM certificates.
- domain string
- id string
The provider-assigned unique ID for this managed resource.
- {[key: string]: string}
A mapping of tags for the resource.
- key
Types string[] - most
Recent boolean - statuses string[]
- types string[]
- arn str
Set to the ARN of the found certificate, suitable for referencing in other resources that support ACM certificates.
- domain str
- id str
The provider-assigned unique ID for this managed resource.
- Dict[str, str]
A mapping of tags for the resource.
- key_
types List[str] - most_
recent bool - statuses List[str]
- types List[str]
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.