1. Packages
  2. AWS Classic
  3. API Docs
  4. lb
  5. ListenerCertificate

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi

aws.lb.ListenerCertificate

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi

    Provides a Load Balancer Listener Certificate resource.

    This resource is for additional certificates and does not replace the default certificate on the listener.

    Note: aws.alb.ListenerCertificate is known as aws.lb.ListenerCertificate. The functionality is identical.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.acm.Certificate("example", {});
    const frontEnd = new aws.lb.LoadBalancer("front_end", {});
    const frontEndListener = new aws.lb.Listener("front_end", {});
    const exampleListenerCertificate = new aws.lb.ListenerCertificate("example", {
        listenerArn: frontEndListener.arn,
        certificateArn: example.arn,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.acm.Certificate("example")
    front_end = aws.lb.LoadBalancer("front_end")
    front_end_listener = aws.lb.Listener("front_end")
    example_listener_certificate = aws.lb.ListenerCertificate("example",
        listener_arn=front_end_listener.arn,
        certificate_arn=example.arn)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/acm"
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := acm.NewCertificate(ctx, "example", nil)
    		if err != nil {
    			return err
    		}
    		_, err = lb.NewLoadBalancer(ctx, "front_end", nil)
    		if err != nil {
    			return err
    		}
    		frontEndListener, err := lb.NewListener(ctx, "front_end", nil)
    		if err != nil {
    			return err
    		}
    		_, err = lb.NewListenerCertificate(ctx, "example", &lb.ListenerCertificateArgs{
    			ListenerArn:    frontEndListener.Arn,
    			CertificateArn: example.Arn,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Acm.Certificate("example");
    
        var frontEnd = new Aws.LB.LoadBalancer("front_end");
    
        var frontEndListener = new Aws.LB.Listener("front_end");
    
        var exampleListenerCertificate = new Aws.LB.ListenerCertificate("example", new()
        {
            ListenerArn = frontEndListener.Arn,
            CertificateArn = example.Arn,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.acm.Certificate;
    import com.pulumi.aws.lb.LoadBalancer;
    import com.pulumi.aws.lb.Listener;
    import com.pulumi.aws.lb.ListenerCertificate;
    import com.pulumi.aws.lb.ListenerCertificateArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new Certificate("example");
    
            var frontEnd = new LoadBalancer("frontEnd");
    
            var frontEndListener = new Listener("frontEndListener");
    
            var exampleListenerCertificate = new ListenerCertificate("exampleListenerCertificate", ListenerCertificateArgs.builder()        
                .listenerArn(frontEndListener.arn())
                .certificateArn(example.arn())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:acm:Certificate
      frontEnd:
        type: aws:lb:LoadBalancer
        name: front_end
      frontEndListener:
        type: aws:lb:Listener
        name: front_end
      exampleListenerCertificate:
        type: aws:lb:ListenerCertificate
        name: example
        properties:
          listenerArn: ${frontEndListener.arn}
          certificateArn: ${example.arn}
    

    Create ListenerCertificate Resource

    new ListenerCertificate(name: string, args: ListenerCertificateArgs, opts?: CustomResourceOptions);
    @overload
    def ListenerCertificate(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            certificate_arn: Optional[str] = None,
                            listener_arn: Optional[str] = None)
    @overload
    def ListenerCertificate(resource_name: str,
                            args: ListenerCertificateArgs,
                            opts: Optional[ResourceOptions] = None)
    func NewListenerCertificate(ctx *Context, name string, args ListenerCertificateArgs, opts ...ResourceOption) (*ListenerCertificate, error)
    public ListenerCertificate(string name, ListenerCertificateArgs args, CustomResourceOptions? opts = null)
    public ListenerCertificate(String name, ListenerCertificateArgs args)
    public ListenerCertificate(String name, ListenerCertificateArgs args, CustomResourceOptions options)
    
    type: aws:lb:ListenerCertificate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ListenerCertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ListenerCertificateArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ListenerCertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ListenerCertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ListenerCertificateArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ListenerCertificate Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ListenerCertificate resource accepts the following input properties:

    CertificateArn string
    The ARN of the certificate to attach to the listener.
    ListenerArn string
    The ARN of the listener to which to attach the certificate.
    CertificateArn string
    The ARN of the certificate to attach to the listener.
    ListenerArn string
    The ARN of the listener to which to attach the certificate.
    certificateArn String
    The ARN of the certificate to attach to the listener.
    listenerArn String
    The ARN of the listener to which to attach the certificate.
    certificateArn string
    The ARN of the certificate to attach to the listener.
    listenerArn string
    The ARN of the listener to which to attach the certificate.
    certificate_arn str
    The ARN of the certificate to attach to the listener.
    listener_arn str
    The ARN of the listener to which to attach the certificate.
    certificateArn String
    The ARN of the certificate to attach to the listener.
    listenerArn String
    The ARN of the listener to which to attach the certificate.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ListenerCertificate resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ListenerCertificate Resource

    Get an existing ListenerCertificate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ListenerCertificateState, opts?: CustomResourceOptions): ListenerCertificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            certificate_arn: Optional[str] = None,
            listener_arn: Optional[str] = None) -> ListenerCertificate
    func GetListenerCertificate(ctx *Context, name string, id IDInput, state *ListenerCertificateState, opts ...ResourceOption) (*ListenerCertificate, error)
    public static ListenerCertificate Get(string name, Input<string> id, ListenerCertificateState? state, CustomResourceOptions? opts = null)
    public static ListenerCertificate get(String name, Output<String> id, ListenerCertificateState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CertificateArn string
    The ARN of the certificate to attach to the listener.
    ListenerArn string
    The ARN of the listener to which to attach the certificate.
    CertificateArn string
    The ARN of the certificate to attach to the listener.
    ListenerArn string
    The ARN of the listener to which to attach the certificate.
    certificateArn String
    The ARN of the certificate to attach to the listener.
    listenerArn String
    The ARN of the listener to which to attach the certificate.
    certificateArn string
    The ARN of the certificate to attach to the listener.
    listenerArn string
    The ARN of the listener to which to attach the certificate.
    certificate_arn str
    The ARN of the certificate to attach to the listener.
    listener_arn str
    The ARN of the listener to which to attach the certificate.
    certificateArn String
    The ARN of the certificate to attach to the listener.
    listenerArn String
    The ARN of the listener to which to attach the certificate.

    Import

    Using pulumi import, import Listener Certificates using the listener arn and certificate arn, separated by an underscore (_). For example:

    $ pulumi import aws:lb/listenerCertificate:ListenerCertificate example arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/test/8e4497da625e2d8a/9ab28ade35828f96/67b3d2d36dd7c26b_arn:aws:iam::123456789012:server-certificate/tf-acc-test-6453083910015726063
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi