Listener

class Listener : KotlinCustomResource

Resource for managing an AWS VPC Lattice Listener.

Example Usage

Forward action

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.vpclattice.Service;
import com.pulumi.aws.vpclattice.TargetGroup;
import com.pulumi.aws.vpclattice.TargetGroupArgs;
import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigArgs;
import com.pulumi.aws.vpclattice.Listener;
import com.pulumi.aws.vpclattice.ListenerArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerDefaultActionArgs;
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 test = new Service("test");
var exampleTargetGroup = new TargetGroup("exampleTargetGroup", TargetGroupArgs.builder()
.type("INSTANCE")
.config(TargetGroupConfigArgs.builder()
.port(80)
.protocol("HTTP")
.vpcIdentifier(aws_vpc.test().id())
.build())
.build());
var exampleListener = new Listener("exampleListener", ListenerArgs.builder()
.protocol("HTTP")
.serviceIdentifier(aws_vpclattice_service.example().id())
.defaultAction(ListenerDefaultActionArgs.builder()
.forwards(ListenerDefaultActionForwardArgs.builder()
.targetGroups(ListenerDefaultActionForwardTargetGroupArgs.builder()
.targetGroupIdentifier(exampleTargetGroup.id())
.build())
.build())
.build())
.build());
}
}

Forward action with weighted target groups

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.vpclattice.Service;
import com.pulumi.aws.vpclattice.TargetGroup;
import com.pulumi.aws.vpclattice.TargetGroupArgs;
import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigArgs;
import com.pulumi.aws.vpclattice.Listener;
import com.pulumi.aws.vpclattice.ListenerArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerDefaultActionArgs;
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 test = new Service("test");
var example1 = new TargetGroup("example1", TargetGroupArgs.builder()
.type("INSTANCE")
.config(TargetGroupConfigArgs.builder()
.port(80)
.protocol("HTTP")
.vpcIdentifier(aws_vpc.test().id())
.build())
.build());
var example2 = new TargetGroup("example2", TargetGroupArgs.builder()
.type("INSTANCE")
.config(TargetGroupConfigArgs.builder()
.port(8080)
.protocol("HTTP")
.vpcIdentifier(aws_vpc.test().id())
.build())
.build());
var example = new Listener("example", ListenerArgs.builder()
.protocol("HTTP")
.serviceIdentifier(aws_vpclattice_service.example().id())
.defaultAction(ListenerDefaultActionArgs.builder()
.forwards(ListenerDefaultActionForwardArgs.builder()
.targetGroups(
ListenerDefaultActionForwardTargetGroupArgs.builder()
.targetGroupIdentifier(example1.id())
.weight(80)
.build(),
ListenerDefaultActionForwardTargetGroupArgs.builder()
.targetGroupIdentifier(example2.id())
.weight(20)
.build())
.build())
.build())
.build());
}
}

Import

VPC Lattice Listener can be imported by using the listener_id of the listener and the id of the VPC Lattice service combined with a / character, e.g.

$ pulumi import aws:vpclattice/listener:Listener example svc-1a2b3c4d/listener-987654321

Properties

Link copied to clipboard
val arn: Output<String>

ARN of the listener.

Link copied to clipboard
val createdAt: Output<String>

Date and time that the listener was created, specified in ISO-8601 format.

Link copied to clipboard

Default action block for the default listener rule. Default action blocks are defined below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val lastUpdatedAt: Output<String>
Link copied to clipboard
val listenerId: Output<String>

Standalone ID of the listener, e.g. listener-0a1b2c3d4e5f6g.

Link copied to clipboard
val name: Output<String>

Name of the listener. A listener name must be unique within a service. Valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.

Link copied to clipboard
val port: Output<Int>

Listener port. You can specify a value from 1 to 65535. If port is not specified and protocol is HTTP, the value will default to 80. If port is not specified and protocol is HTTPS, the value will default to 443.

Link copied to clipboard
val protocol: Output<String>

Protocol for the listener. Supported values are HTTP or HTTPS

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val serviceArn: Output<String>

Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the service_arn or service_identifier arguments.

Link copied to clipboard

ID of the VPC Lattice service. You must include either the service_arn or service_identifier arguments.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>
Link copied to clipboard
val urn: Output<String>