getServerCertificate

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

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var my_domain = Output.Create(Aws.Iam.GetServerCertificate.InvokeAsync(new Aws.Iam.GetServerCertificateArgs
        {
            NamePrefix = "my-domain.org",
            Latest = true,
        }));
        var elb = new Aws.Elb.LoadBalancer("elb", new Aws.Elb.LoadBalancerArgs
        {
            Listeners = 
            {
                new Aws.Elb.Inputs.LoadBalancerListenerArgs
                {
                    InstancePort = 8000,
                    InstanceProtocol = "https",
                    LbPort = 443,
                    LbProtocol = "https",
                    SslCertificateId = my_domain.Apply(my_domain => my_domain.Arn),
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/elb"
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "my-domain.org"
		opt1 := true
		my_domain, err := iam.LookupServerCertificate(ctx, &iam.LookupServerCertificateArgs{
			NamePrefix: &opt0,
			Latest:     &opt1,
		}, nil)
		if err != nil {
			return err
		}
		_, err = elb.NewLoadBalancer(ctx, "elb", &elb.LoadBalancerArgs{
			Listeners: elb.LoadBalancerListenerArray{
				&elb.LoadBalancerListenerArgs{
					InstancePort:     pulumi.Int(8000),
					InstanceProtocol: pulumi.String("https"),
					LbPort:           pulumi.Int(443),
					LbProtocol:       pulumi.String("https"),
					SslCertificateId: pulumi.String(my_domain.Arn),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

my_domain = aws.iam.get_server_certificate(name_prefix="my-domain.org",
    latest=True)
elb = aws.elb.LoadBalancer("elb", listeners=[aws.elb.LoadBalancerListenerArgs(
    instance_port=8000,
    instance_protocol="https",
    lb_port=443,
    lb_protocol="https",
    ssl_certificate_id=my_domain.arn,
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const my-domain = aws.iam.getServerCertificate({
    namePrefix: "my-domain.org",
    latest: true,
});
const elb = new aws.elb.LoadBalancer("elb", {listeners: [{
    instancePort: 8000,
    instanceProtocol: "https",
    lbPort: 443,
    lbProtocol: "https",
    sslCertificateId: my_domain.then(my_domain => my_domain.arn),
}]});

Using getServerCertificate

function getServerCertificate(args: GetServerCertificateArgs, opts?: InvokeOptions): Promise<GetServerCertificateResult>
def get_server_certificate(latest: Optional[bool] = None,
                           name: Optional[str] = None,
                           name_prefix: Optional[str] = None,
                           path_prefix: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetServerCertificateResult
func LookupServerCertificate(ctx *Context, args *LookupServerCertificateArgs, opts ...InvokeOption) (*LookupServerCertificateResult, error)

Note: This function is named LookupServerCertificate in the Go SDK.

public static class GetServerCertificate {
    public static Task<GetServerCertificateResult> InvokeAsync(GetServerCertificateArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Latest bool
sort results by expiration date. returns the certificate with expiration date in furthest in the future.
Name string
exact name of the cert to lookup
NamePrefix string
prefix of cert to filter by
PathPrefix string
prefix of path to filter by
Latest bool
sort results by expiration date. returns the certificate with expiration date in furthest in the future.
Name string
exact name of the cert to lookup
NamePrefix string
prefix of cert to filter by
PathPrefix string
prefix of path to filter by
latest boolean
sort results by expiration date. returns the certificate with expiration date in furthest in the future.
name string
exact name of the cert to lookup
namePrefix string
prefix of cert to filter by
pathPrefix string
prefix of path to filter by
latest bool
sort results by expiration date. returns the certificate with expiration date in furthest in the future.
name str
exact name of the cert to lookup
name_prefix str
prefix of cert to filter by
path_prefix str
prefix of path to filter by

getServerCertificate Result

The following output properties are available:

Arn string
CertificateBody string
CertificateChain string
ExpirationDate string
Id string
The provider-assigned unique ID for this managed resource.
Name string
Path string
UploadDate string
Latest bool
NamePrefix string
PathPrefix string
Arn string
CertificateBody string
CertificateChain string
ExpirationDate string
Id string
The provider-assigned unique ID for this managed resource.
Name string
Path string
UploadDate string
Latest bool
NamePrefix string
PathPrefix string
arn string
certificateBody string
certificateChain string
expirationDate string
id string
The provider-assigned unique ID for this managed resource.
name string
path string
uploadDate string
latest boolean
namePrefix string
pathPrefix string
arn str
certificate_body str
certificate_chain str
expiration_date str
id str
The provider-assigned unique ID for this managed resource.
name str
path str
upload_date str
latest bool
name_prefix str
path_prefix str

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.