GetServerCertificate
Use this data source to lookup information about IAM Server Certificates.
Import
The 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.
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
{
Latest = true,
NamePrefix = "my-domain.org",
}));
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/v2/go/aws/elb"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
opt0 := true
opt1 := "my-domain.org"
my_domain, err := iam.LookupServerCertificate(ctx, &iam.LookupServerCertificateArgs{
Latest: &opt0,
NamePrefix: &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(latest=True,
name_prefix="my-domain.org")
elb = aws.elb.LoadBalancer("elb", listeners=[{
"instance_port": 8000,
"instanceProtocol": "https",
"lb_port": 443,
"lbProtocol": "https",
"sslCertificateId": my_domain.arn,
}])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const my_domain = pulumi.output(aws.iam.getServerCertificate({
latest: true,
namePrefix: "my-domain.org",
}, { async: true }));
const elb = new aws.elb.LoadBalancer("elb", {
listeners: [{
instancePort: 8000,
instanceProtocol: "https",
lbPort: 443,
lbProtocol: "https",
sslCertificateId: my_domain.arn,
}],
});Using GetServerCertificate
function getServerCertificate(args: GetServerCertificateArgs, opts?: InvokeOptions): Promise<GetServerCertificateResult>function get_server_certificate(latest=None, name=None, name_prefix=None, path_prefix=None, opts=None)func LookupServerCertificate(ctx *Context, args *LookupServerCertificateArgs, opts ...InvokeOption) (*LookupServerCertificateResult, error)Note: This function is named
LookupServerCertificatein 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
- Name
Prefix string prefix of cert to filter by
- Path
Prefix 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
- Name
Prefix string prefix of cert to filter by
- Path
Prefix 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
- name
Prefix string prefix of cert to filter by
- path
Prefix 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
- Certificate
Body string - Certificate
Chain string - Expiration
Date string - Id string
The provider-assigned unique ID for this managed resource.
- Name string
- Path string
- Upload
Date string - Latest bool
- Name
Prefix string - Path
Prefix string
- Arn string
- Certificate
Body string - Certificate
Chain string - Expiration
Date string - Id string
The provider-assigned unique ID for this managed resource.
- Name string
- Path string
- Upload
Date string - Latest bool
- Name
Prefix string - Path
Prefix string
- arn string
- certificate
Body string - certificate
Chain string - expiration
Date string - id string
The provider-assigned unique ID for this managed resource.
- name string
- path string
- upload
Date string - latest boolean
- name
Prefix string - path
Prefix 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
awsTerraform Provider.