Module alb

This page documents the language specification for the aws package. If you're looking for help working with the inputs, outputs, or functions of aws resources in a Pulumi program, please see the resource documentation for examples and API reference.

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-aws repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-aws repo.

Resources

Functions

Others

Resources

Resource Listener

class Listener extends CustomResource

Provides a Load Balancer Listener resource.

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

Example Usage

Forward Action
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndTargetGroup = new aws.lb.TargetGroup("front_end", {});
const frontEndListener = new aws.lb.Listener("front_end", {
    certificateArn: "arn:aws:iam::187416307283:server-certificate/test_cert_rab3wuqwgja25ct3n4jdj2tzu4",
    defaultActions: [{
        targetGroupArn: frontEndTargetGroup.arn,
        type: "forward",
    }],
    loadBalancerArn: frontEndLoadBalancer.arn,
    port: 443,
    protocol: "HTTPS",
    sslPolicy: "ELBSecurityPolicy-2016-08",
});
Redirect Action
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndListener = new aws.lb.Listener("front_end", {
    defaultActions: [{
        redirect: {
            port: "443",
            protocol: "HTTPS",
            statusCode: "HTTP_301",
        },
        type: "redirect",
    }],
    loadBalancerArn: frontEndLoadBalancer.arn,
    port: 80,
    protocol: "HTTP",
});
Fixed-response Action
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndListener = new aws.lb.Listener("front_end", {
    defaultActions: [{
        fixedResponse: {
            contentType: "text/plain",
            messageBody: "Fixed response content",
            statusCode: "200",
        },
        type: "fixed-response",
    }],
    loadBalancerArn: frontEndLoadBalancer.arn,
    port: 80,
    protocol: "HTTP",
});
Authenticate-cognito Action
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndTargetGroup = new aws.lb.TargetGroup("front_end", {});
const pool = new aws.cognito.UserPool("pool", {});
const client = new aws.cognito.UserPoolClient("client", {});
const domain = new aws.cognito.UserPoolDomain("domain", {});
const frontEndListener = new aws.lb.Listener("front_end", {
    defaultActions: [
        {
            authenticateCognito: {
                userPoolArn: pool.arn,
                userPoolClientId: client.id,
                userPoolDomain: domain.domain,
            },
            type: "authenticate-cognito",
        },
        {
            targetGroupArn: frontEndTargetGroup.arn,
            type: "forward",
        },
    ],
    loadBalancerArn: frontEndLoadBalancer.arn,
    port: 80,
    protocol: "HTTP",
});
Authenticate-oidc Action
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndTargetGroup = new aws.lb.TargetGroup("front_end", {});
const frontEndListener = new aws.lb.Listener("front_end", {
    defaultActions: [
        {
            authenticateOidc: {
                authorizationEndpoint: "https://example.com/authorization_endpoint",
                clientId: "client_id",
                clientSecret: "client_secret",
                issuer: "https://example.com",
                tokenEndpoint: "https://example.com/token_endpoint",
                userInfoEndpoint: "https://example.com/user_info_endpoint",
            },
            type: "authenticate-oidc",
        },
        {
            targetGroupArn: frontEndTargetGroup.arn,
            type: "forward",
        },
    ],
    loadBalancerArn: frontEndLoadBalancer.arn,
    port: 80,
    protocol: "HTTP",
});

constructor

new Listener(name: string, args: ListenerArgs, opts?: pulumi.CustomResourceOptions)

Create a Listener resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ListenerState, opts?: pulumi.CustomResourceOptions): Listener

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is Listener

Returns true if the given object is an instance of Listener. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The Amazon Resource Name (ARN) of the target group.

property certificateArn

public certificateArn: pulumi.Output<string | undefined>;

The ARN of the default SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. For adding additional SSL certificates, see the aws.lb.ListenerCertificate resource.

property defaultActions

public defaultActions: pulumi.Output<ListenerDefaultAction[]>;

An Action block. Action blocks are documented below.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property loadBalancerArn

public loadBalancerArn: pulumi.Output<string>;

The ARN of the load balancer.

property port

public port: pulumi.Output<number>;

The port on which the load balancer is listening.

property protocol

public protocol: pulumi.Output<string | undefined>;

The protocol for connections from clients to the load balancer. Valid values are TCP, TLS, UDP, TCP_UDP, HTTP and HTTPS. Defaults to HTTP.

property sslPolicy

public sslPolicy: pulumi.Output<string>;

The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Resource ListenerCertificate

class ListenerCertificate extends CustomResource

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 exampleCertificate = new aws.acm.Certificate("example", {});
const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndListener = new aws.lb.Listener("front_end", {});
const exampleListenerCertificate = new aws.lb.ListenerCertificate("example", {
    certificateArn: exampleCertificate.arn,
    listenerArn: frontEndListener.arn,
});

constructor

new ListenerCertificate(name: string, args: ListenerCertificateArgs, opts?: pulumi.CustomResourceOptions)

Create a ListenerCertificate resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ListenerCertificateState, opts?: pulumi.CustomResourceOptions): ListenerCertificate

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is ListenerCertificate

Returns true if the given object is an instance of ListenerCertificate. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property certificateArn

public certificateArn: pulumi.Output<string>;

The ARN of the certificate to attach to the listener.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property listenerArn

public listenerArn: pulumi.Output<string>;

The ARN of the listener to which to attach the certificate.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Resource ListenerRule

class ListenerRule extends CustomResource

Provides a Load Balancer Listener Rule resource.

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const frontEndLoadBalancer = new aws.lb.LoadBalancer("front_end", {});
const frontEndListener = new aws.lb.Listener("front_end", {});
const static = new aws.lb.ListenerRule("static", {
    actions: [{
        targetGroupArn: aws_lb_target_group_static.arn,
        type: "forward",
    }],
    conditions: [
        {
            pathPattern: {
                values: ["/static/*"],
            },
        },
        {
            hostHeader: {
                values: ["example.com"],
            },
        },
    ],
    listenerArn: frontEndListener.arn,
    priority: 100,
});
const hostBasedRouting = new aws.lb.ListenerRule("host_based_routing", {
    actions: [{
        forward: {
            stickiness: {
                duration: 600,
                enabled: true,
            },
            targetGroups: [
                {
                    arn: aws_lb_target_group_main.arn,
                    weight: 80,
                },
                {
                    arn: aws_lb_target_group_canary.arn,
                    weight: 20,
                },
            ],
        },
        type: "forward",
    }],
    conditions: [{
        hostHeader: {
            values: ["my-service.*.mycompany.io"],
        },
    }],
    listenerArn: frontEndListener.arn,
    priority: 99,
});
const hostBasedWeightedRouting = new aws.lb.ListenerRule("host_based_weighted_routing", {
    actions: [{
        targetGroupArn: aws_lb_target_group_static.arn,
        type: "forward",
    }],
    conditions: [{
        hostHeader: {
            values: ["my-service.*.mydomain.io"],
        },
    }],
    listenerArn: frontEndListener.arn,
    priority: 99,
});
const redirectHttpToHttps = new aws.lb.ListenerRule("redirect_http_to_https", {
    actions: [{
        redirect: {
            port: "443",
            protocol: "HTTPS",
            statusCode: "HTTP_301",
        },
        type: "redirect",
    }],
    conditions: [{
        httpHeader: {
            httpHeaderName: "X-Forwarded-For",
            values: ["192.168.1.*"],
        },
    }],
    listenerArn: frontEndListener.arn,
});
const healthCheck = new aws.lb.ListenerRule("health_check", {
    actions: [{
        fixedResponse: {
            contentType: "text/plain",
            messageBody: "HEALTHY",
            statusCode: "200",
        },
        type: "fixed-response",
    }],
    conditions: [{
        queryStrings: [
            {
                key: "health",
                value: "check",
            },
            {
                value: "bar",
            },
        ],
    }],
    listenerArn: frontEndListener.arn,
});
const pool = new aws.cognito.UserPool("pool", {});
const client = new aws.cognito.UserPoolClient("client", {});
const domain = new aws.cognito.UserPoolDomain("domain", {});
const admin = new aws.lb.ListenerRule("admin", {
    actions: [
        {
            authenticateOidc: {
                authorizationEndpoint: "https://example.com/authorization_endpoint",
                clientId: "client_id",
                clientSecret: "client_secret",
                issuer: "https://example.com",
                tokenEndpoint: "https://example.com/token_endpoint",
                userInfoEndpoint: "https://example.com/user_info_endpoint",
            },
            type: "authenticate-oidc",
        },
        {
            targetGroupArn: aws_lb_target_group_static.arn,
            type: "forward",
        },
    ],
    listenerArn: frontEndListener.arn,
});

constructor

new ListenerRule(name: string, args: ListenerRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a ListenerRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ListenerRuleState, opts?: pulumi.CustomResourceOptions): ListenerRule

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is ListenerRule

Returns true if the given object is an instance of ListenerRule. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property actions

public actions: pulumi.Output<ListenerRuleAction[]>;

An Action block. Action blocks are documented below.

property arn

public arn: pulumi.Output<string>;

The Amazon Resource Name (ARN) of the target group.

property conditions

public conditions: pulumi.Output<ListenerRuleCondition[]>;

A Condition block. Multiple condition blocks of different types can be set and all must be satisfied for the rule to match. Condition blocks are documented below.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property listenerArn

public listenerArn: pulumi.Output<string>;

The ARN of the listener to which to attach the rule.

property priority

public priority: pulumi.Output<number>;

The priority for the rule between 1 and 50000. Leaving it unset will automatically set the rule with next available priority after currently existing highest rule. A listener can’t have multiple rules with the same priority.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Resource LoadBalancer

class LoadBalancer extends CustomResource

Provides a Load Balancer resource.

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

Example Usage

Application Load Balancer
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.lb.LoadBalancer("test", {
    accessLogs: {
        bucket: aws_s3_bucket_lb_logs.bucket,
        enabled: true,
        prefix: "test-lb",
    },
    enableDeletionProtection: true,
    internal: false,
    loadBalancerType: "application",
    securityGroups: [aws_security_group_lb_sg.id],
    subnets: [aws_subnet_public.map(v => v.id)],
    tags: {
        Environment: "production",
    },
});
Network Load Balancer
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.lb.LoadBalancer("test", {
    enableDeletionProtection: true,
    internal: false,
    loadBalancerType: "network",
    subnets: [aws_subnet_public.map(v => v.id)],
    tags: {
        Environment: "production",
    },
});
Specifying Elastic IPs
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lb.LoadBalancer("example", {
    loadBalancerType: "network",
    subnetMappings: [
        {
            allocationId: aws_eip_example1.id,
            subnetId: aws_subnet_example1.id,
        },
        {
            allocationId: aws_eip_example2.id,
            subnetId: aws_subnet_example2.id,
        },
    ],
});

constructor

new LoadBalancer(name: string, args?: LoadBalancerArgs, opts?: pulumi.CustomResourceOptions)

Create a LoadBalancer resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LoadBalancerState, opts?: pulumi.CustomResourceOptions): LoadBalancer

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is LoadBalancer

Returns true if the given object is an instance of LoadBalancer. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property accessLogs

public accessLogs: pulumi.Output<LoadBalancerAccessLogs | undefined>;

An Access Logs block. Access Logs documented below.

property arn

public arn: pulumi.Output<string>;

The ARN of the load balancer (matches id).

property arnSuffix

public arnSuffix: pulumi.Output<string>;

The ARN suffix for use with CloudWatch Metrics.

property dnsName

public dnsName: pulumi.Output<string>;

The DNS name of the load balancer.

property dropInvalidHeaderFields

public dropInvalidHeaderFields: pulumi.Output<boolean | undefined>;

Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type application.

property enableCrossZoneLoadBalancing

public enableCrossZoneLoadBalancing: pulumi.Output<boolean | undefined>;

If true, cross-zone load balancing of the load balancer will be enabled. This is a network load balancer feature. Defaults to false.

property enableDeletionProtection

public enableDeletionProtection: pulumi.Output<boolean | undefined>;

If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to false.

property enableHttp2

public enableHttp2: pulumi.Output<boolean | undefined>;

Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property idleTimeout

public idleTimeout: pulumi.Output<number | undefined>;

The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type application. Default: 60.

property internal

public internal: pulumi.Output<boolean>;

If true, the LB will be internal.

property ipAddressType

public ipAddressType: pulumi.Output<IpAddressType>;

The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack

property loadBalancerType

public loadBalancerType: pulumi.Output<LoadBalancerType | undefined>;

The type of load balancer to create. Possible values are application or network. The default value is application.

property name

public name: pulumi.Output<string>;

The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with tf-lb.

property namePrefix

public namePrefix: pulumi.Output<string | undefined>;

Creates a unique name beginning with the specified prefix. Conflicts with name.

property securityGroups

public securityGroups: pulumi.Output<string[]>;

A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.

property subnetMappings

public subnetMappings: pulumi.Output<LoadBalancerSubnetMapping[]>;

A subnet mapping block as documented below.

property subnets

public subnets: pulumi.Output<string[]>;

A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type network. Changing this value for load balancers of type network will force a recreation of the resource.

property tags

public tags: pulumi.Output<{[key: string]: any} | undefined>;

A map of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property vpcId

public vpcId: pulumi.Output<string>;

property zoneId

public zoneId: pulumi.Output<string>;

The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).

Resource TargetGroup

class TargetGroup extends CustomResource

Provides a Target Group resource for use with Load Balancer resources.

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

Example Usage

Instance Target Group
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const main = new aws.ec2.Vpc("main", {
    cidrBlock: "10.0.0.0/16",
});
const test = new aws.lb.TargetGroup("test", {
    port: 80,
    protocol: "HTTP",
    vpcId: main.id,
});
IP Target Group
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const main = new aws.ec2.Vpc("main", {
    cidrBlock: "10.0.0.0/16",
});
const ip_example = new aws.lb.TargetGroup("ip-example", {
    port: 80,
    protocol: "HTTP",
    targetType: "ip",
    vpcId: main.id,
});
Lambda Target Group
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const lambda_example = new aws.lb.TargetGroup("lambda-example", {
    targetType: "lambda",
});

constructor

new TargetGroup(name: string, args?: TargetGroupArgs, opts?: pulumi.CustomResourceOptions)

Create a TargetGroup resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TargetGroupState, opts?: pulumi.CustomResourceOptions): TargetGroup

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is TargetGroup

Returns true if the given object is an instance of TargetGroup. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The ARN of the Target Group (matches id)

property arnSuffix

public arnSuffix: pulumi.Output<string>;

The ARN suffix for use with CloudWatch Metrics.

property deregistrationDelay

public deregistrationDelay: pulumi.Output<number | undefined>;

The amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.

property healthCheck

public healthCheck: pulumi.Output<TargetGroupHealthCheck>;

A Health Check block. Health Check blocks are documented below.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property lambdaMultiValueHeadersEnabled

public lambdaMultiValueHeadersEnabled: pulumi.Output<boolean | undefined>;

Boolean whether the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings. Only applies when targetType is lambda.

property loadBalancingAlgorithmType

public loadBalancingAlgorithmType: pulumi.Output<string>;

Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is roundRobin or leastOutstandingRequests. The default is roundRobin.

property name

public name: pulumi.Output<string>;

The name of the target group. If omitted, this provider will assign a random, unique name.

property namePrefix

public namePrefix: pulumi.Output<string | undefined>;

Creates a unique name beginning with the specified prefix. Conflicts with name. Cannot be longer than 6 characters.

property port

public port: pulumi.Output<number | undefined>;

The port on which targets receive traffic, unless overridden when registering a specific target. Required when targetType is instance or ip. Does not apply when targetType is lambda.

property protocol

public protocol: pulumi.Output<string | undefined>;

The protocol to use for routing traffic to the targets. Should be one of “TCP”, “TLS”, “UDP”, “TCP_UDP”, “HTTP” or “HTTPS”. Required when targetType is instance or ip. Does not apply when targetType is lambda.

property proxyProtocolV2

public proxyProtocolV2: pulumi.Output<boolean | undefined>;

Boolean to enable / disable support for proxy protocol v2 on Network Load Balancers. See doc for more information.

property slowStart

public slowStart: pulumi.Output<number | undefined>;

The amount time for targets to warm up before the load balancer sends them a full share of requests. The range is 30-900 seconds or 0 to disable. The default value is 0 seconds.

property stickiness

public stickiness: pulumi.Output<TargetGroupStickiness>;

A Stickiness block. Stickiness blocks are documented below. stickiness is only valid if used with Load Balancers of type Application

property tags

public tags: pulumi.Output<{[key: string]: any} | undefined>;

A map of tags to assign to the resource.

property targetType

public targetType: pulumi.Output<string | undefined>;

The type of target that you must specify when registering targets with this target group. The possible values are instance (targets are specified by instance ID) or ip (targets are specified by IP address) or lambda (targets are specified by lambda arn). The default is instance. Note that you can’t specify targets for a target group using both instance IDs and IP addresses. If the target type is ip, specify IP addresses from the subnets of the virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can’t specify publicly routable IP addresses.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property vpcId

public vpcId: pulumi.Output<string | undefined>;

The identifier of the VPC in which to create the target group. Required when targetType is instance or ip. Does not apply when targetType is lambda.

Resource TargetGroupAttachment

class TargetGroupAttachment extends CustomResource

Provides the ability to register instances and containers with an Application Load Balancer (ALB) or Network Load Balancer (NLB) target group. For attaching resources with Elastic Load Balancer (ELB), see the aws.elb.Attachment resource.

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testTargetGroup = new aws.lb.TargetGroup("test", {});
const testInstance = new aws.ec2.Instance("test", {});
const testTargetGroupAttachment = new aws.lb.TargetGroupAttachment("test", {
    port: 80,
    targetGroupArn: testTargetGroup.arn,
    targetId: testInstance.id,
});

Usage with lambda

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testTargetGroup = new aws.lb.TargetGroup("test", {
    targetType: "lambda",
});
const testFunction = new aws.lambda.Function("test", {});
const withLb = new aws.lambda.Permission("with_lb", {
    action: "lambda:InvokeFunction",
    function: testFunction.arn,
    principal: "elasticloadbalancing.amazonaws.com",
    sourceArn: testTargetGroup.arn,
});
const testTargetGroupAttachment = new aws.lb.TargetGroupAttachment("test", {
    targetGroupArn: testTargetGroup.arn,
    targetId: testFunction.arn,
}, { dependsOn: [withLb] });

constructor

new TargetGroupAttachment(name: string, args: TargetGroupAttachmentArgs, opts?: pulumi.CustomResourceOptions)

Create a TargetGroupAttachment resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TargetGroupAttachmentState, opts?: pulumi.CustomResourceOptions): TargetGroupAttachment

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is TargetGroupAttachment

Returns true if the given object is an instance of TargetGroupAttachment. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property availabilityZone

public availabilityZone: pulumi.Output<string | undefined>;

The Availability Zone where the IP address of the target is to be registered.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property port

public port: pulumi.Output<number | undefined>;

The port on which targets receive traffic.

property targetGroupArn

public targetGroupArn: pulumi.Output<string>;

The ARN of the target group with which to register targets

property targetId

public targetId: pulumi.Output<string>;

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the arn of lambda.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Functions

Function getListener

getListener(args?: GetListenerArgs, opts?: pulumi.InvokeOptions): Promise<GetListenerResult>

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

Provides information about a Load Balancer Listener.

This data source can prove useful when a module accepts an LB Listener as an input variable and needs to know the LB it is attached to, or other information specific to the listener in question.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const config = new pulumi.Config();
const listenerArn = config.require("listenerArn");

const listener = pulumi.output(aws.lb.getListener({
    arn: listenerArn,
}, { async: true }));
const selected = pulumi.output(aws.lb.getLoadBalancer({
    name: "default-public",
}, { async: true }));
const selected443 = selected.apply(selected => aws.lb.getListener({
    loadBalancerArn: selected.arn!,
    port: 443,
}, { async: true }));

Function getLoadBalancer

getLoadBalancer(args?: GetLoadBalancerArgs, opts?: pulumi.InvokeOptions): Promise<GetLoadBalancerResult>

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

Provides information about a Load Balancer.

This data source can prove useful when a module accepts an LB as an input variable and needs to, for example, determine the security groups associated with it, etc.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const config = new pulumi.Config();
const lbArn = config.get("lbArn") || "";
const lbName = config.get("lbName") || "";

const test = pulumi.output(aws.lb.getLoadBalancer({
    arn: lbArn,
    name: lbName,
}, { async: true }));

Function getTargetGroup

getTargetGroup(args?: GetTargetGroupArgs, opts?: pulumi.InvokeOptions): Promise<GetTargetGroupResult>

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

Provides information about a Load Balancer Target Group.

This data source can prove useful when a module accepts an LB Target Group as an input variable and needs to know its attributes. It can also be used to get the ARN of an LB Target Group for use in other resources, given LB Target Group name.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const config = new pulumi.Config();
const lbTgArn = config.get("lbTgArn") || "";
const lbTgName = config.get("lbTgName") || "";

const test = pulumi.output(aws.lb.getTargetGroup({
    arn: lbTgArn,
    name: lbTgName,
}, { async: true }));

Others

const ApplicationLoadBalancer

const ApplicationLoadBalancer: LoadBalancerType = "application";

const Dualstack

const Dualstack: IpAddressType = "dualstack";

interface GetListenerArgs

interface GetListenerArgs

A collection of arguments for invoking getListener.

property arn

arn?: undefined | string;

The arn of the listener. Required if loadBalancerArn and port is not set.

property loadBalancerArn

loadBalancerArn?: undefined | string;

The arn of the load balancer. Required if arn is not set.

property port

port?: undefined | number;

The port of the listener. Required if arn is not set.

interface GetListenerResult

interface GetListenerResult

A collection of values returned by getListener.

property arn

arn: string;

property certificateArn

certificateArn: string;

property defaultActions

defaultActions: GetListenerDefaultAction[];

property id

id: string;

The provider-assigned unique ID for this managed resource.

property loadBalancerArn

loadBalancerArn: string;

property port

port: number;

property protocol

protocol: string;

property sslPolicy

sslPolicy: string;

interface GetLoadBalancerArgs

interface GetLoadBalancerArgs

A collection of arguments for invoking getLoadBalancer.

property arn

arn?: undefined | string;

The full ARN of the load balancer.

property name

name?: undefined | string;

The unique name of the load balancer.

property tags

tags?: undefined | {[key: string]: any};

interface GetLoadBalancerResult

interface GetLoadBalancerResult

A collection of values returned by getLoadBalancer.

property accessLogs

accessLogs: GetLoadBalancerAccessLogs;

property arn

arn: string;

property arnSuffix

arnSuffix: string;

property dnsName

dnsName: string;

property dropInvalidHeaderFields

dropInvalidHeaderFields: boolean;

property enableDeletionProtection

enableDeletionProtection: boolean;

property id

id: string;

The provider-assigned unique ID for this managed resource.

property idleTimeout

idleTimeout: number;

property internal

internal: boolean;

property ipAddressType

ipAddressType: string;

property loadBalancerType

loadBalancerType: string;

property name

name: string;

property securityGroups

securityGroups: string[];

property subnetMappings

subnetMappings: GetLoadBalancerSubnetMapping[];

property subnets

subnets: string[];

property tags

tags: {[key: string]: any};

property vpcId

vpcId: string;

property zoneId

zoneId: string;

interface GetTargetGroupArgs

interface GetTargetGroupArgs

A collection of arguments for invoking getTargetGroup.

property arn

arn?: undefined | string;

The full ARN of the target group.

property name

name?: undefined | string;

The unique name of the target group.

property tags

tags?: undefined | {[key: string]: any};

interface GetTargetGroupResult

interface GetTargetGroupResult

A collection of values returned by getTargetGroup.

property arn

arn: string;

property arnSuffix

arnSuffix: string;

property deregistrationDelay

deregistrationDelay: number;

property healthCheck

healthCheck: GetTargetGroupHealthCheck;

property id

id: string;

The provider-assigned unique ID for this managed resource.

property lambdaMultiValueHeadersEnabled

lambdaMultiValueHeadersEnabled: boolean;

property loadBalancingAlgorithmType

loadBalancingAlgorithmType: string;

property name

name: string;

property port

port: number;

property protocol

protocol: string;

property proxyProtocolV2

proxyProtocolV2: boolean;

property slowStart

slowStart: number;

property stickiness

stickiness: GetTargetGroupStickiness;

property tags

tags: {[key: string]: any};

property targetType

targetType: string;

property vpcId

vpcId: string;

type IpAddressType

type IpAddressType = "ipv4" | "dualstack";

const Ipv4

const Ipv4: IpAddressType = "ipv4";

interface ListenerArgs

interface ListenerArgs

The set of arguments for constructing a Listener resource.

property certificateArn

certificateArn?: pulumi.Input<string>;

The ARN of the default SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. For adding additional SSL certificates, see the aws.lb.ListenerCertificate resource.

property defaultActions

defaultActions: pulumi.Input<pulumi.Input<ListenerDefaultAction>[]>;

An Action block. Action blocks are documented below.

property loadBalancerArn

loadBalancerArn: pulumi.Input<string>;

The ARN of the load balancer.

property port

port: pulumi.Input<number>;

The port on which the load balancer is listening.

property protocol

protocol?: pulumi.Input<string>;

The protocol for connections from clients to the load balancer. Valid values are TCP, TLS, UDP, TCP_UDP, HTTP and HTTPS. Defaults to HTTP.

property sslPolicy

sslPolicy?: pulumi.Input<string>;

The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS.

interface ListenerCertificateArgs

interface ListenerCertificateArgs

The set of arguments for constructing a ListenerCertificate resource.

property certificateArn

certificateArn: pulumi.Input<string>;

The ARN of the certificate to attach to the listener.

property listenerArn

listenerArn: pulumi.Input<string>;

The ARN of the listener to which to attach the certificate.

interface ListenerCertificateState

interface ListenerCertificateState

Input properties used for looking up and filtering ListenerCertificate resources.

property certificateArn

certificateArn?: pulumi.Input<string>;

The ARN of the certificate to attach to the listener.

property listenerArn

listenerArn?: pulumi.Input<string>;

The ARN of the listener to which to attach the certificate.

interface ListenerRuleArgs

interface ListenerRuleArgs

The set of arguments for constructing a ListenerRule resource.

property actions

actions: pulumi.Input<pulumi.Input<ListenerRuleAction>[]>;

An Action block. Action blocks are documented below.

property conditions

conditions: pulumi.Input<pulumi.Input<ListenerRuleCondition>[]>;

A Condition block. Multiple condition blocks of different types can be set and all must be satisfied for the rule to match. Condition blocks are documented below.

property listenerArn

listenerArn: pulumi.Input<string>;

The ARN of the listener to which to attach the rule.

property priority

priority?: pulumi.Input<number>;

The priority for the rule between 1 and 50000. Leaving it unset will automatically set the rule with next available priority after currently existing highest rule. A listener can’t have multiple rules with the same priority.

interface ListenerRuleState

interface ListenerRuleState

Input properties used for looking up and filtering ListenerRule resources.

property actions

actions?: pulumi.Input<pulumi.Input<ListenerRuleAction>[]>;

An Action block. Action blocks are documented below.

property arn

arn?: pulumi.Input<string>;

The Amazon Resource Name (ARN) of the target group.

property conditions

conditions?: pulumi.Input<pulumi.Input<ListenerRuleCondition>[]>;

A Condition block. Multiple condition blocks of different types can be set and all must be satisfied for the rule to match. Condition blocks are documented below.

property listenerArn

listenerArn?: pulumi.Input<string>;

The ARN of the listener to which to attach the rule.

property priority

priority?: pulumi.Input<number>;

The priority for the rule between 1 and 50000. Leaving it unset will automatically set the rule with next available priority after currently existing highest rule. A listener can’t have multiple rules with the same priority.

interface ListenerState

interface ListenerState

Input properties used for looking up and filtering Listener resources.

property arn

arn?: pulumi.Input<string>;

The Amazon Resource Name (ARN) of the target group.

property certificateArn

certificateArn?: pulumi.Input<string>;

The ARN of the default SSL server certificate. Exactly one certificate is required if the protocol is HTTPS. For adding additional SSL certificates, see the aws.lb.ListenerCertificate resource.

property defaultActions

defaultActions?: pulumi.Input<pulumi.Input<ListenerDefaultAction>[]>;

An Action block. Action blocks are documented below.

property loadBalancerArn

loadBalancerArn?: pulumi.Input<string>;

The ARN of the load balancer.

property port

port?: pulumi.Input<number>;

The port on which the load balancer is listening.

property protocol

protocol?: pulumi.Input<string>;

The protocol for connections from clients to the load balancer. Valid values are TCP, TLS, UDP, TCP_UDP, HTTP and HTTPS. Defaults to HTTP.

property sslPolicy

sslPolicy?: pulumi.Input<string>;

The name of the SSL Policy for the listener. Required if protocol is HTTPS or TLS.

interface LoadBalancerArgs

interface LoadBalancerArgs

The set of arguments for constructing a LoadBalancer resource.

property accessLogs

accessLogs?: pulumi.Input<LoadBalancerAccessLogs>;

An Access Logs block. Access Logs documented below.

property dropInvalidHeaderFields

dropInvalidHeaderFields?: pulumi.Input<boolean>;

Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type application.

property enableCrossZoneLoadBalancing

enableCrossZoneLoadBalancing?: pulumi.Input<boolean>;

If true, cross-zone load balancing of the load balancer will be enabled. This is a network load balancer feature. Defaults to false.

property enableDeletionProtection

enableDeletionProtection?: pulumi.Input<boolean>;

If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to false.

property enableHttp2

enableHttp2?: pulumi.Input<boolean>;

Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.

property idleTimeout

idleTimeout?: pulumi.Input<number>;

The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type application. Default: 60.

property internal

internal?: pulumi.Input<boolean>;

If true, the LB will be internal.

property ipAddressType

ipAddressType?: pulumi.Input<IpAddressType>;

The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack

property loadBalancerType

loadBalancerType?: pulumi.Input<LoadBalancerType>;

The type of load balancer to create. Possible values are application or network. The default value is application.

property name

name?: pulumi.Input<string>;

The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with tf-lb.

property namePrefix

namePrefix?: pulumi.Input<string>;

Creates a unique name beginning with the specified prefix. Conflicts with name.

property securityGroups

securityGroups?: pulumi.Input<pulumi.Input<string>[]>;

A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.

property subnetMappings

subnetMappings?: pulumi.Input<pulumi.Input<LoadBalancerSubnetMapping>[]>;

A subnet mapping block as documented below.

property subnets

subnets?: pulumi.Input<pulumi.Input<string>[]>;

A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type network. Changing this value for load balancers of type network will force a recreation of the resource.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A map of tags to assign to the resource.

interface LoadBalancerState

interface LoadBalancerState

Input properties used for looking up and filtering LoadBalancer resources.

property accessLogs

accessLogs?: pulumi.Input<LoadBalancerAccessLogs>;

An Access Logs block. Access Logs documented below.

property arn

arn?: pulumi.Input<string>;

The ARN of the load balancer (matches id).

property arnSuffix

arnSuffix?: pulumi.Input<string>;

The ARN suffix for use with CloudWatch Metrics.

property dnsName

dnsName?: pulumi.Input<string>;

The DNS name of the load balancer.

property dropInvalidHeaderFields

dropInvalidHeaderFields?: pulumi.Input<boolean>;

Indicates whether HTTP headers with header fields that are not valid are removed by the load balancer (true) or routed to targets (false). The default is false. Elastic Load Balancing requires that message header names contain only alphanumeric characters and hyphens. Only valid for Load Balancers of type application.

property enableCrossZoneLoadBalancing

enableCrossZoneLoadBalancing?: pulumi.Input<boolean>;

If true, cross-zone load balancing of the load balancer will be enabled. This is a network load balancer feature. Defaults to false.

property enableDeletionProtection

enableDeletionProtection?: pulumi.Input<boolean>;

If true, deletion of the load balancer will be disabled via the AWS API. This will prevent this provider from deleting the load balancer. Defaults to false.

property enableHttp2

enableHttp2?: pulumi.Input<boolean>;

Indicates whether HTTP/2 is enabled in application load balancers. Defaults to true.

property idleTimeout

idleTimeout?: pulumi.Input<number>;

The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type application. Default: 60.

property internal

internal?: pulumi.Input<boolean>;

If true, the LB will be internal.

property ipAddressType

ipAddressType?: pulumi.Input<IpAddressType>;

The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack

property loadBalancerType

loadBalancerType?: pulumi.Input<LoadBalancerType>;

The type of load balancer to create. Possible values are application or network. The default value is application.

property name

name?: pulumi.Input<string>;

The name of the LB. This name must be unique within your AWS account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. If not specified, this provider will autogenerate a name beginning with tf-lb.

property namePrefix

namePrefix?: pulumi.Input<string>;

Creates a unique name beginning with the specified prefix. Conflicts with name.

property securityGroups

securityGroups?: pulumi.Input<pulumi.Input<string>[]>;

A list of security group IDs to assign to the LB. Only valid for Load Balancers of type application.

property subnetMappings

subnetMappings?: pulumi.Input<pulumi.Input<LoadBalancerSubnetMapping>[]>;

A subnet mapping block as documented below.

property subnets

subnets?: pulumi.Input<pulumi.Input<string>[]>;

A list of subnet IDs to attach to the LB. Subnets cannot be updated for Load Balancers of type network. Changing this value for load balancers of type network will force a recreation of the resource.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A map of tags to assign to the resource.

property vpcId

vpcId?: pulumi.Input<string>;

property zoneId

zoneId?: pulumi.Input<string>;

The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record).

type LoadBalancerType

type LoadBalancerType = "application" | "network";

const NetworkLoadBalancer

const NetworkLoadBalancer: LoadBalancerType = "network";

interface TargetGroupArgs

interface TargetGroupArgs

The set of arguments for constructing a TargetGroup resource.

property deregistrationDelay

deregistrationDelay?: pulumi.Input<number>;

The amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.

property healthCheck

healthCheck?: pulumi.Input<TargetGroupHealthCheck>;

A Health Check block. Health Check blocks are documented below.

property lambdaMultiValueHeadersEnabled

lambdaMultiValueHeadersEnabled?: pulumi.Input<boolean>;

Boolean whether the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings. Only applies when targetType is lambda.

property loadBalancingAlgorithmType

loadBalancingAlgorithmType?: pulumi.Input<string>;

Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is roundRobin or leastOutstandingRequests. The default is roundRobin.

property name

name?: pulumi.Input<string>;

The name of the target group. If omitted, this provider will assign a random, unique name.

property namePrefix

namePrefix?: pulumi.Input<string>;

Creates a unique name beginning with the specified prefix. Conflicts with name. Cannot be longer than 6 characters.

property port

port?: pulumi.Input<number>;

The port on which targets receive traffic, unless overridden when registering a specific target. Required when targetType is instance or ip. Does not apply when targetType is lambda.

property protocol

protocol?: pulumi.Input<string>;

The protocol to use for routing traffic to the targets. Should be one of “TCP”, “TLS”, “UDP”, “TCP_UDP”, “HTTP” or “HTTPS”. Required when targetType is instance or ip. Does not apply when targetType is lambda.

property proxyProtocolV2

proxyProtocolV2?: pulumi.Input<boolean>;

Boolean to enable / disable support for proxy protocol v2 on Network Load Balancers. See doc for more information.

property slowStart

slowStart?: pulumi.Input<number>;

The amount time for targets to warm up before the load balancer sends them a full share of requests. The range is 30-900 seconds or 0 to disable. The default value is 0 seconds.

property stickiness

stickiness?: pulumi.Input<TargetGroupStickiness>;

A Stickiness block. Stickiness blocks are documented below. stickiness is only valid if used with Load Balancers of type Application

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A map of tags to assign to the resource.

property targetType

targetType?: pulumi.Input<string>;

The type of target that you must specify when registering targets with this target group. The possible values are instance (targets are specified by instance ID) or ip (targets are specified by IP address) or lambda (targets are specified by lambda arn). The default is instance. Note that you can’t specify targets for a target group using both instance IDs and IP addresses. If the target type is ip, specify IP addresses from the subnets of the virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can’t specify publicly routable IP addresses.

property vpcId

vpcId?: pulumi.Input<string>;

The identifier of the VPC in which to create the target group. Required when targetType is instance or ip. Does not apply when targetType is lambda.

interface TargetGroupAttachmentArgs

interface TargetGroupAttachmentArgs

The set of arguments for constructing a TargetGroupAttachment resource.

property availabilityZone

availabilityZone?: pulumi.Input<string>;

The Availability Zone where the IP address of the target is to be registered.

property port

port?: pulumi.Input<number>;

The port on which targets receive traffic.

property targetGroupArn

targetGroupArn: pulumi.Input<string>;

The ARN of the target group with which to register targets

property targetId

targetId: pulumi.Input<string>;

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the arn of lambda.

interface TargetGroupAttachmentState

interface TargetGroupAttachmentState

Input properties used for looking up and filtering TargetGroupAttachment resources.

property availabilityZone

availabilityZone?: pulumi.Input<string>;

The Availability Zone where the IP address of the target is to be registered.

property port

port?: pulumi.Input<number>;

The port on which targets receive traffic.

property targetGroupArn

targetGroupArn?: pulumi.Input<string>;

The ARN of the target group with which to register targets

property targetId

targetId?: pulumi.Input<string>;

The ID of the target. This is the Instance ID for an instance, or the container ID for an ECS container. If the target type is ip, specify an IP address. If the target type is lambda, specify the arn of lambda.

interface TargetGroupState

interface TargetGroupState

Input properties used for looking up and filtering TargetGroup resources.

property arn

arn?: pulumi.Input<string>;

The ARN of the Target Group (matches id)

property arnSuffix

arnSuffix?: pulumi.Input<string>;

The ARN suffix for use with CloudWatch Metrics.

property deregistrationDelay

deregistrationDelay?: pulumi.Input<number>;

The amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.

property healthCheck

healthCheck?: pulumi.Input<TargetGroupHealthCheck>;

A Health Check block. Health Check blocks are documented below.

property lambdaMultiValueHeadersEnabled

lambdaMultiValueHeadersEnabled?: pulumi.Input<boolean>;

Boolean whether the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings. Only applies when targetType is lambda.

property loadBalancingAlgorithmType

loadBalancingAlgorithmType?: pulumi.Input<string>;

Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is roundRobin or leastOutstandingRequests. The default is roundRobin.

property name

name?: pulumi.Input<string>;

The name of the target group. If omitted, this provider will assign a random, unique name.

property namePrefix

namePrefix?: pulumi.Input<string>;

Creates a unique name beginning with the specified prefix. Conflicts with name. Cannot be longer than 6 characters.

property port

port?: pulumi.Input<number>;

The port on which targets receive traffic, unless overridden when registering a specific target. Required when targetType is instance or ip. Does not apply when targetType is lambda.

property protocol

protocol?: pulumi.Input<string>;

The protocol to use for routing traffic to the targets. Should be one of “TCP”, “TLS”, “UDP”, “TCP_UDP”, “HTTP” or “HTTPS”. Required when targetType is instance or ip. Does not apply when targetType is lambda.

property proxyProtocolV2

proxyProtocolV2?: pulumi.Input<boolean>;

Boolean to enable / disable support for proxy protocol v2 on Network Load Balancers. See doc for more information.

property slowStart

slowStart?: pulumi.Input<number>;

The amount time for targets to warm up before the load balancer sends them a full share of requests. The range is 30-900 seconds or 0 to disable. The default value is 0 seconds.

property stickiness

stickiness?: pulumi.Input<TargetGroupStickiness>;

A Stickiness block. Stickiness blocks are documented below. stickiness is only valid if used with Load Balancers of type Application

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A map of tags to assign to the resource.

property targetType

targetType?: pulumi.Input<string>;

The type of target that you must specify when registering targets with this target group. The possible values are instance (targets are specified by instance ID) or ip (targets are specified by IP address) or lambda (targets are specified by lambda arn). The default is instance. Note that you can’t specify targets for a target group using both instance IDs and IP addresses. If the target type is ip, specify IP addresses from the subnets of the virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can’t specify publicly routable IP addresses.

property vpcId

vpcId?: pulumi.Input<string>;

The identifier of the VPC in which to create the target group. Required when targetType is instance or ip. Does not apply when targetType is lambda.