aws.vpclattice.Listener
Explore with Pulumi AI
Resource for managing an AWS VPC Lattice Listener.
Example Usage
Fixed response action
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.vpclattice.Service("example", {name: "example"});
const exampleListener = new aws.vpclattice.Listener("example", {
name: "example",
protocol: "HTTPS",
serviceIdentifier: example.id,
defaultAction: {
fixedResponse: {
statusCode: 404,
},
},
});
import pulumi
import pulumi_aws as aws
example = aws.vpclattice.Service("example", name="example")
example_listener = aws.vpclattice.Listener("example",
name="example",
protocol="HTTPS",
service_identifier=example.id,
default_action={
"fixed_response": {
"status_code": 404,
},
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := vpclattice.NewService(ctx, "example", &vpclattice.ServiceArgs{
Name: pulumi.String("example"),
})
if err != nil {
return err
}
_, err = vpclattice.NewListener(ctx, "example", &vpclattice.ListenerArgs{
Name: pulumi.String("example"),
Protocol: pulumi.String("HTTPS"),
ServiceIdentifier: example.ID(),
DefaultAction: &vpclattice.ListenerDefaultActionArgs{
FixedResponse: &vpclattice.ListenerDefaultActionFixedResponseArgs{
StatusCode: pulumi.Int(404),
},
},
})
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.VpcLattice.Service("example", new()
{
Name = "example",
});
var exampleListener = new Aws.VpcLattice.Listener("example", new()
{
Name = "example",
Protocol = "HTTPS",
ServiceIdentifier = example.Id,
DefaultAction = new Aws.VpcLattice.Inputs.ListenerDefaultActionArgs
{
FixedResponse = new Aws.VpcLattice.Inputs.ListenerDefaultActionFixedResponseArgs
{
StatusCode = 404,
},
},
});
});
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.ServiceArgs;
import com.pulumi.aws.vpclattice.Listener;
import com.pulumi.aws.vpclattice.ListenerArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerDefaultActionArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerDefaultActionFixedResponseArgs;
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 Service("example", ServiceArgs.builder()
.name("example")
.build());
var exampleListener = new Listener("exampleListener", ListenerArgs.builder()
.name("example")
.protocol("HTTPS")
.serviceIdentifier(example.id())
.defaultAction(ListenerDefaultActionArgs.builder()
.fixedResponse(ListenerDefaultActionFixedResponseArgs.builder()
.statusCode(404)
.build())
.build())
.build());
}
}
resources:
example:
type: aws:vpclattice:Service
properties:
name: example
exampleListener:
type: aws:vpclattice:Listener
name: example
properties:
name: example
protocol: HTTPS
serviceIdentifier: ${example.id}
defaultAction:
fixedResponse:
statusCode: 404
Forward action
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.vpclattice.Service("example", {name: "example"});
const exampleTargetGroup = new aws.vpclattice.TargetGroup("example", {
name: "example-target-group-1",
type: "INSTANCE",
config: {
port: 80,
protocol: "HTTP",
vpcIdentifier: exampleAwsVpc.id,
},
});
const exampleListener = new aws.vpclattice.Listener("example", {
name: "example",
protocol: "HTTP",
serviceIdentifier: example.id,
defaultAction: {
forwards: [{
targetGroups: [{
targetGroupIdentifier: exampleTargetGroup.id,
}],
}],
},
});
import pulumi
import pulumi_aws as aws
example = aws.vpclattice.Service("example", name="example")
example_target_group = aws.vpclattice.TargetGroup("example",
name="example-target-group-1",
type="INSTANCE",
config={
"port": 80,
"protocol": "HTTP",
"vpc_identifier": example_aws_vpc["id"],
})
example_listener = aws.vpclattice.Listener("example",
name="example",
protocol="HTTP",
service_identifier=example.id,
default_action={
"forwards": [{
"target_groups": [{
"target_group_identifier": example_target_group.id,
}],
}],
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := vpclattice.NewService(ctx, "example", &vpclattice.ServiceArgs{
Name: pulumi.String("example"),
})
if err != nil {
return err
}
exampleTargetGroup, err := vpclattice.NewTargetGroup(ctx, "example", &vpclattice.TargetGroupArgs{
Name: pulumi.String("example-target-group-1"),
Type: pulumi.String("INSTANCE"),
Config: &vpclattice.TargetGroupConfigArgs{
Port: pulumi.Int(80),
Protocol: pulumi.String("HTTP"),
VpcIdentifier: pulumi.Any(exampleAwsVpc.Id),
},
})
if err != nil {
return err
}
_, err = vpclattice.NewListener(ctx, "example", &vpclattice.ListenerArgs{
Name: pulumi.String("example"),
Protocol: pulumi.String("HTTP"),
ServiceIdentifier: example.ID(),
DefaultAction: &vpclattice.ListenerDefaultActionArgs{
Forwards: vpclattice.ListenerDefaultActionForwardArray{
&vpclattice.ListenerDefaultActionForwardArgs{
TargetGroups: vpclattice.ListenerDefaultActionForwardTargetGroupArray{
&vpclattice.ListenerDefaultActionForwardTargetGroupArgs{
TargetGroupIdentifier: exampleTargetGroup.ID(),
},
},
},
},
},
})
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.VpcLattice.Service("example", new()
{
Name = "example",
});
var exampleTargetGroup = new Aws.VpcLattice.TargetGroup("example", new()
{
Name = "example-target-group-1",
Type = "INSTANCE",
Config = new Aws.VpcLattice.Inputs.TargetGroupConfigArgs
{
Port = 80,
Protocol = "HTTP",
VpcIdentifier = exampleAwsVpc.Id,
},
});
var exampleListener = new Aws.VpcLattice.Listener("example", new()
{
Name = "example",
Protocol = "HTTP",
ServiceIdentifier = example.Id,
DefaultAction = new Aws.VpcLattice.Inputs.ListenerDefaultActionArgs
{
Forwards = new[]
{
new Aws.VpcLattice.Inputs.ListenerDefaultActionForwardArgs
{
TargetGroups = new[]
{
new Aws.VpcLattice.Inputs.ListenerDefaultActionForwardTargetGroupArgs
{
TargetGroupIdentifier = exampleTargetGroup.Id,
},
},
},
},
},
});
});
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.ServiceArgs;
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 example = new Service("example", ServiceArgs.builder()
.name("example")
.build());
var exampleTargetGroup = new TargetGroup("exampleTargetGroup", TargetGroupArgs.builder()
.name("example-target-group-1")
.type("INSTANCE")
.config(TargetGroupConfigArgs.builder()
.port(80)
.protocol("HTTP")
.vpcIdentifier(exampleAwsVpc.id())
.build())
.build());
var exampleListener = new Listener("exampleListener", ListenerArgs.builder()
.name("example")
.protocol("HTTP")
.serviceIdentifier(example.id())
.defaultAction(ListenerDefaultActionArgs.builder()
.forwards(ListenerDefaultActionForwardArgs.builder()
.targetGroups(ListenerDefaultActionForwardTargetGroupArgs.builder()
.targetGroupIdentifier(exampleTargetGroup.id())
.build())
.build())
.build())
.build());
}
}
resources:
example:
type: aws:vpclattice:Service
properties:
name: example
exampleTargetGroup:
type: aws:vpclattice:TargetGroup
name: example
properties:
name: example-target-group-1
type: INSTANCE
config:
port: 80
protocol: HTTP
vpcIdentifier: ${exampleAwsVpc.id}
exampleListener:
type: aws:vpclattice:Listener
name: example
properties:
name: example
protocol: HTTP
serviceIdentifier: ${example.id}
defaultAction:
forwards:
- targetGroups:
- targetGroupIdentifier: ${exampleTargetGroup.id}
Forward action with weighted target groups
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.vpclattice.Service("example", {name: "example"});
const example1 = new aws.vpclattice.TargetGroup("example1", {
name: "example-target-group-1",
type: "INSTANCE",
config: {
port: 80,
protocol: "HTTP",
vpcIdentifier: exampleAwsVpc.id,
},
});
const example2 = new aws.vpclattice.TargetGroup("example2", {
name: "example-target-group-2",
type: "INSTANCE",
config: {
port: 8080,
protocol: "HTTP",
vpcIdentifier: exampleAwsVpc.id,
},
});
const exampleListener = new aws.vpclattice.Listener("example", {
name: "example",
protocol: "HTTP",
serviceIdentifier: example.id,
defaultAction: {
forwards: [{
targetGroups: [
{
targetGroupIdentifier: example1.id,
weight: 80,
},
{
targetGroupIdentifier: example2.id,
weight: 20,
},
],
}],
},
});
import pulumi
import pulumi_aws as aws
example = aws.vpclattice.Service("example", name="example")
example1 = aws.vpclattice.TargetGroup("example1",
name="example-target-group-1",
type="INSTANCE",
config={
"port": 80,
"protocol": "HTTP",
"vpc_identifier": example_aws_vpc["id"],
})
example2 = aws.vpclattice.TargetGroup("example2",
name="example-target-group-2",
type="INSTANCE",
config={
"port": 8080,
"protocol": "HTTP",
"vpc_identifier": example_aws_vpc["id"],
})
example_listener = aws.vpclattice.Listener("example",
name="example",
protocol="HTTP",
service_identifier=example.id,
default_action={
"forwards": [{
"target_groups": [
{
"target_group_identifier": example1.id,
"weight": 80,
},
{
"target_group_identifier": example2.id,
"weight": 20,
},
],
}],
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := vpclattice.NewService(ctx, "example", &vpclattice.ServiceArgs{
Name: pulumi.String("example"),
})
if err != nil {
return err
}
example1, err := vpclattice.NewTargetGroup(ctx, "example1", &vpclattice.TargetGroupArgs{
Name: pulumi.String("example-target-group-1"),
Type: pulumi.String("INSTANCE"),
Config: &vpclattice.TargetGroupConfigArgs{
Port: pulumi.Int(80),
Protocol: pulumi.String("HTTP"),
VpcIdentifier: pulumi.Any(exampleAwsVpc.Id),
},
})
if err != nil {
return err
}
example2, err := vpclattice.NewTargetGroup(ctx, "example2", &vpclattice.TargetGroupArgs{
Name: pulumi.String("example-target-group-2"),
Type: pulumi.String("INSTANCE"),
Config: &vpclattice.TargetGroupConfigArgs{
Port: pulumi.Int(8080),
Protocol: pulumi.String("HTTP"),
VpcIdentifier: pulumi.Any(exampleAwsVpc.Id),
},
})
if err != nil {
return err
}
_, err = vpclattice.NewListener(ctx, "example", &vpclattice.ListenerArgs{
Name: pulumi.String("example"),
Protocol: pulumi.String("HTTP"),
ServiceIdentifier: example.ID(),
DefaultAction: &vpclattice.ListenerDefaultActionArgs{
Forwards: vpclattice.ListenerDefaultActionForwardArray{
&vpclattice.ListenerDefaultActionForwardArgs{
TargetGroups: vpclattice.ListenerDefaultActionForwardTargetGroupArray{
&vpclattice.ListenerDefaultActionForwardTargetGroupArgs{
TargetGroupIdentifier: example1.ID(),
Weight: pulumi.Int(80),
},
&vpclattice.ListenerDefaultActionForwardTargetGroupArgs{
TargetGroupIdentifier: example2.ID(),
Weight: pulumi.Int(20),
},
},
},
},
},
})
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.VpcLattice.Service("example", new()
{
Name = "example",
});
var example1 = new Aws.VpcLattice.TargetGroup("example1", new()
{
Name = "example-target-group-1",
Type = "INSTANCE",
Config = new Aws.VpcLattice.Inputs.TargetGroupConfigArgs
{
Port = 80,
Protocol = "HTTP",
VpcIdentifier = exampleAwsVpc.Id,
},
});
var example2 = new Aws.VpcLattice.TargetGroup("example2", new()
{
Name = "example-target-group-2",
Type = "INSTANCE",
Config = new Aws.VpcLattice.Inputs.TargetGroupConfigArgs
{
Port = 8080,
Protocol = "HTTP",
VpcIdentifier = exampleAwsVpc.Id,
},
});
var exampleListener = new Aws.VpcLattice.Listener("example", new()
{
Name = "example",
Protocol = "HTTP",
ServiceIdentifier = example.Id,
DefaultAction = new Aws.VpcLattice.Inputs.ListenerDefaultActionArgs
{
Forwards = new[]
{
new Aws.VpcLattice.Inputs.ListenerDefaultActionForwardArgs
{
TargetGroups = new[]
{
new Aws.VpcLattice.Inputs.ListenerDefaultActionForwardTargetGroupArgs
{
TargetGroupIdentifier = example1.Id,
Weight = 80,
},
new Aws.VpcLattice.Inputs.ListenerDefaultActionForwardTargetGroupArgs
{
TargetGroupIdentifier = example2.Id,
Weight = 20,
},
},
},
},
},
});
});
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.ServiceArgs;
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 example = new Service("example", ServiceArgs.builder()
.name("example")
.build());
var example1 = new TargetGroup("example1", TargetGroupArgs.builder()
.name("example-target-group-1")
.type("INSTANCE")
.config(TargetGroupConfigArgs.builder()
.port(80)
.protocol("HTTP")
.vpcIdentifier(exampleAwsVpc.id())
.build())
.build());
var example2 = new TargetGroup("example2", TargetGroupArgs.builder()
.name("example-target-group-2")
.type("INSTANCE")
.config(TargetGroupConfigArgs.builder()
.port(8080)
.protocol("HTTP")
.vpcIdentifier(exampleAwsVpc.id())
.build())
.build());
var exampleListener = new Listener("exampleListener", ListenerArgs.builder()
.name("example")
.protocol("HTTP")
.serviceIdentifier(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());
}
}
resources:
example:
type: aws:vpclattice:Service
properties:
name: example
example1:
type: aws:vpclattice:TargetGroup
properties:
name: example-target-group-1
type: INSTANCE
config:
port: 80
protocol: HTTP
vpcIdentifier: ${exampleAwsVpc.id}
example2:
type: aws:vpclattice:TargetGroup
properties:
name: example-target-group-2
type: INSTANCE
config:
port: 8080
protocol: HTTP
vpcIdentifier: ${exampleAwsVpc.id}
exampleListener:
type: aws:vpclattice:Listener
name: example
properties:
name: example
protocol: HTTP
serviceIdentifier: ${example.id}
defaultAction:
forwards:
- targetGroups:
- targetGroupIdentifier: ${example1.id}
weight: 80
- targetGroupIdentifier: ${example2.id}
weight: 20
Create Listener Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Listener(name: string, args: ListenerArgs, opts?: CustomResourceOptions);
@overload
def Listener(resource_name: str,
args: ListenerArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Listener(resource_name: str,
opts: Optional[ResourceOptions] = None,
default_action: Optional[ListenerDefaultActionArgs] = None,
protocol: Optional[str] = None,
name: Optional[str] = None,
port: Optional[int] = None,
service_arn: Optional[str] = None,
service_identifier: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewListener(ctx *Context, name string, args ListenerArgs, opts ...ResourceOption) (*Listener, error)
public Listener(string name, ListenerArgs args, CustomResourceOptions? opts = null)
public Listener(String name, ListenerArgs args)
public Listener(String name, ListenerArgs args, CustomResourceOptions options)
type: aws:vpclattice:Listener
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ListenerArgs
- 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 ListenerArgs
- 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 ListenerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ListenerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ListenerArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var examplelistenerResourceResourceFromVpclatticelistener = new Aws.VpcLattice.Listener("examplelistenerResourceResourceFromVpclatticelistener", new()
{
DefaultAction = new Aws.VpcLattice.Inputs.ListenerDefaultActionArgs
{
FixedResponse = new Aws.VpcLattice.Inputs.ListenerDefaultActionFixedResponseArgs
{
StatusCode = 0,
},
Forwards = new[]
{
new Aws.VpcLattice.Inputs.ListenerDefaultActionForwardArgs
{
TargetGroups = new[]
{
new Aws.VpcLattice.Inputs.ListenerDefaultActionForwardTargetGroupArgs
{
TargetGroupIdentifier = "string",
Weight = 0,
},
},
},
},
},
Protocol = "string",
Name = "string",
Port = 0,
ServiceArn = "string",
ServiceIdentifier = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := vpclattice.NewListener(ctx, "examplelistenerResourceResourceFromVpclatticelistener", &vpclattice.ListenerArgs{
DefaultAction: &vpclattice.ListenerDefaultActionArgs{
FixedResponse: &vpclattice.ListenerDefaultActionFixedResponseArgs{
StatusCode: pulumi.Int(0),
},
Forwards: vpclattice.ListenerDefaultActionForwardArray{
&vpclattice.ListenerDefaultActionForwardArgs{
TargetGroups: vpclattice.ListenerDefaultActionForwardTargetGroupArray{
&vpclattice.ListenerDefaultActionForwardTargetGroupArgs{
TargetGroupIdentifier: pulumi.String("string"),
Weight: pulumi.Int(0),
},
},
},
},
},
Protocol: pulumi.String("string"),
Name: pulumi.String("string"),
Port: pulumi.Int(0),
ServiceArn: pulumi.String("string"),
ServiceIdentifier: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var examplelistenerResourceResourceFromVpclatticelistener = new Listener("examplelistenerResourceResourceFromVpclatticelistener", ListenerArgs.builder()
.defaultAction(ListenerDefaultActionArgs.builder()
.fixedResponse(ListenerDefaultActionFixedResponseArgs.builder()
.statusCode(0)
.build())
.forwards(ListenerDefaultActionForwardArgs.builder()
.targetGroups(ListenerDefaultActionForwardTargetGroupArgs.builder()
.targetGroupIdentifier("string")
.weight(0)
.build())
.build())
.build())
.protocol("string")
.name("string")
.port(0)
.serviceArn("string")
.serviceIdentifier("string")
.tags(Map.of("string", "string"))
.build());
examplelistener_resource_resource_from_vpclatticelistener = aws.vpclattice.Listener("examplelistenerResourceResourceFromVpclatticelistener",
default_action={
"fixedResponse": {
"statusCode": 0,
},
"forwards": [{
"targetGroups": [{
"targetGroupIdentifier": "string",
"weight": 0,
}],
}],
},
protocol="string",
name="string",
port=0,
service_arn="string",
service_identifier="string",
tags={
"string": "string",
})
const examplelistenerResourceResourceFromVpclatticelistener = new aws.vpclattice.Listener("examplelistenerResourceResourceFromVpclatticelistener", {
defaultAction: {
fixedResponse: {
statusCode: 0,
},
forwards: [{
targetGroups: [{
targetGroupIdentifier: "string",
weight: 0,
}],
}],
},
protocol: "string",
name: "string",
port: 0,
serviceArn: "string",
serviceIdentifier: "string",
tags: {
string: "string",
},
});
type: aws:vpclattice:Listener
properties:
defaultAction:
fixedResponse:
statusCode: 0
forwards:
- targetGroups:
- targetGroupIdentifier: string
weight: 0
name: string
port: 0
protocol: string
serviceArn: string
serviceIdentifier: string
tags:
string: string
Listener 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 Listener resource accepts the following input properties:
- Default
Action ListenerDefault Action - Default action block for the default listener rule. Default action blocks are defined below.
- Protocol string
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- Name 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.
- Port int
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - Service
Arn string - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - Service
Identifier string ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- Dictionary<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.
- Default
Action ListenerDefault Action Args - Default action block for the default listener rule. Default action blocks are defined below.
- Protocol string
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- Name 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.
- Port int
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - Service
Arn string - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - Service
Identifier string ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- 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.
- default
Action ListenerDefault Action - Default action block for the default listener rule. Default action blocks are defined below.
- protocol String
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- name 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.
- port Integer
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - service
Arn String - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - service
Identifier String ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- 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.
- default
Action ListenerDefault Action - Default action block for the default listener rule. Default action blocks are defined below.
- protocol string
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- name 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.
- port number
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - service
Arn string - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - service
Identifier string ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- {[key: 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.
- default_
action ListenerDefault Action Args - Default action block for the default listener rule. Default action blocks are defined below.
- protocol str
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- name str
- 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.
- port int
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - service_
arn str - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - service_
identifier str ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- Mapping[str, str]
- 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.
- default
Action Property Map - Default action block for the default listener rule. Default action blocks are defined below.
- protocol String
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- name 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.
- port Number
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - service
Arn String - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - service
Identifier String ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- Map<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.
Outputs
All input properties are implicitly available as output properties. Additionally, the Listener resource produces the following output properties:
- Arn string
- ARN of the listener.
- Created
At string - Date and time that the listener was created, specified in ISO-8601 format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated stringAt - Listener
Id string - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - Dictionary<string, string>
- Arn string
- ARN of the listener.
- Created
At string - Date and time that the listener was created, specified in ISO-8601 format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated stringAt - Listener
Id string - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - map[string]string
- arn String
- ARN of the listener.
- created
At String - Date and time that the listener was created, specified in ISO-8601 format.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated StringAt - listener
Id String - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - Map<String,String>
- arn string
- ARN of the listener.
- created
At string - Date and time that the listener was created, specified in ISO-8601 format.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Updated stringAt - listener
Id string - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - {[key: string]: string}
- arn str
- ARN of the listener.
- created_
at str - Date and time that the listener was created, specified in ISO-8601 format.
- id str
- The provider-assigned unique ID for this managed resource.
- last_
updated_ strat - listener_
id str - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - Mapping[str, str]
- arn String
- ARN of the listener.
- created
At String - Date and time that the listener was created, specified in ISO-8601 format.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated StringAt - listener
Id String - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - Map<String>
Look up Existing Listener Resource
Get an existing Listener 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?: ListenerState, opts?: CustomResourceOptions): Listener
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
created_at: Optional[str] = None,
default_action: Optional[ListenerDefaultActionArgs] = None,
last_updated_at: Optional[str] = None,
listener_id: Optional[str] = None,
name: Optional[str] = None,
port: Optional[int] = None,
protocol: Optional[str] = None,
service_arn: Optional[str] = None,
service_identifier: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> Listener
func GetListener(ctx *Context, name string, id IDInput, state *ListenerState, opts ...ResourceOption) (*Listener, error)
public static Listener Get(string name, Input<string> id, ListenerState? state, CustomResourceOptions? opts = null)
public static Listener get(String name, Output<String> id, ListenerState 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.
- Arn string
- ARN of the listener.
- Created
At string - Date and time that the listener was created, specified in ISO-8601 format.
- Default
Action ListenerDefault Action - Default action block for the default listener rule. Default action blocks are defined below.
- Last
Updated stringAt - Listener
Id string - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - Name 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.
- Port int
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - Protocol string
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- Service
Arn string - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - Service
Identifier string ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- Dictionary<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. - Dictionary<string, string>
- Arn string
- ARN of the listener.
- Created
At string - Date and time that the listener was created, specified in ISO-8601 format.
- Default
Action ListenerDefault Action Args - Default action block for the default listener rule. Default action blocks are defined below.
- Last
Updated stringAt - Listener
Id string - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - Name 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.
- Port int
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - Protocol string
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- Service
Arn string - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - Service
Identifier string ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- 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. - map[string]string
- arn String
- ARN of the listener.
- created
At String - Date and time that the listener was created, specified in ISO-8601 format.
- default
Action ListenerDefault Action - Default action block for the default listener rule. Default action blocks are defined below.
- last
Updated StringAt - listener
Id String - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - name 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.
- port Integer
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - protocol String
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- service
Arn String - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - service
Identifier String ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- 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. - Map<String,String>
- arn string
- ARN of the listener.
- created
At string - Date and time that the listener was created, specified in ISO-8601 format.
- default
Action ListenerDefault Action - Default action block for the default listener rule. Default action blocks are defined below.
- last
Updated stringAt - listener
Id string - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - name 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.
- port number
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - protocol string
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- service
Arn string - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - service
Identifier string ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- {[key: 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. - {[key: string]: string}
- arn str
- ARN of the listener.
- created_
at str - Date and time that the listener was created, specified in ISO-8601 format.
- default_
action ListenerDefault Action Args - Default action block for the default listener rule. Default action blocks are defined below.
- last_
updated_ strat - listener_
id str - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - name str
- 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.
- port int
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - protocol str
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- service_
arn str - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - service_
identifier str ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- Mapping[str, str]
- 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. - Mapping[str, str]
- arn String
- ARN of the listener.
- created
At String - Date and time that the listener was created, specified in ISO-8601 format.
- default
Action Property Map - Default action block for the default listener rule. Default action blocks are defined below.
- last
Updated StringAt - listener
Id String - Standalone ID of the listener, e.g.
listener-0a1b2c3d4e5f6g
. - name 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.
- port Number
- Listener port. You can specify a value from 1 to 65535. If
port
is not specified andprotocol
is HTTP, the value will default to 80. Ifport
is not specified andprotocol
is HTTPS, the value will default to 443. - protocol String
- Protocol for the listener. Supported values are
HTTP
,HTTPS
orTLS_PASSTHROUGH
- service
Arn String - Amazon Resource Name (ARN) of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments. - service
Identifier String ID of the VPC Lattice service. You must include either the
service_arn
orservice_identifier
arguments.NOTE: You must specify one of the following arguments:
service_arn
orservice_identifier
.- Map<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. - Map<String>
Supporting Types
ListenerDefaultAction, ListenerDefaultActionArgs
- Fixed
Response ListenerDefault Action Fixed Response - Forwards
List<Listener
Default Action Forward> Route requests to one or more target groups. See Forward blocks below.
NOTE: You must specify exactly one of the following argument blocks:
fixed_response
orforward
.
- Fixed
Response ListenerDefault Action Fixed Response - Forwards
[]Listener
Default Action Forward Route requests to one or more target groups. See Forward blocks below.
NOTE: You must specify exactly one of the following argument blocks:
fixed_response
orforward
.
- fixed
Response ListenerDefault Action Fixed Response - forwards
List<Listener
Default Action Forward> Route requests to one or more target groups. See Forward blocks below.
NOTE: You must specify exactly one of the following argument blocks:
fixed_response
orforward
.
- fixed
Response ListenerDefault Action Fixed Response - forwards
Listener
Default Action Forward[] Route requests to one or more target groups. See Forward blocks below.
NOTE: You must specify exactly one of the following argument blocks:
fixed_response
orforward
.
- fixed_
response ListenerDefault Action Fixed Response - forwards
Sequence[Listener
Default Action Forward] Route requests to one or more target groups. See Forward blocks below.
NOTE: You must specify exactly one of the following argument blocks:
fixed_response
orforward
.
- fixed
Response Property Map - forwards List<Property Map>
Route requests to one or more target groups. See Forward blocks below.
NOTE: You must specify exactly one of the following argument blocks:
fixed_response
orforward
.
ListenerDefaultActionFixedResponse, ListenerDefaultActionFixedResponseArgs
- Status
Code int - Custom HTTP status code to return, e.g. a 404 response code. See Listeners in the AWS documentation for a list of supported codes.
- Status
Code int - Custom HTTP status code to return, e.g. a 404 response code. See Listeners in the AWS documentation for a list of supported codes.
- status
Code Integer - Custom HTTP status code to return, e.g. a 404 response code. See Listeners in the AWS documentation for a list of supported codes.
- status
Code number - Custom HTTP status code to return, e.g. a 404 response code. See Listeners in the AWS documentation for a list of supported codes.
- status_
code int - Custom HTTP status code to return, e.g. a 404 response code. See Listeners in the AWS documentation for a list of supported codes.
- status
Code Number - Custom HTTP status code to return, e.g. a 404 response code. See Listeners in the AWS documentation for a list of supported codes.
ListenerDefaultActionForward, ListenerDefaultActionForwardArgs
- Target
Groups List<ListenerDefault Action Forward Target Group> - One or more target group blocks.
- Target
Groups []ListenerDefault Action Forward Target Group - One or more target group blocks.
- target
Groups List<ListenerDefault Action Forward Target Group> - One or more target group blocks.
- target
Groups ListenerDefault Action Forward Target Group[] - One or more target group blocks.
- target_
groups Sequence[ListenerDefault Action Forward Target Group] - One or more target group blocks.
- target
Groups List<Property Map> - One or more target group blocks.
ListenerDefaultActionForwardTargetGroup, ListenerDefaultActionForwardTargetGroupArgs
- Target
Group stringIdentifier - ID or Amazon Resource Name (ARN) of the target group.
- Weight int
- Determines how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a
weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. See Listener rules in the AWS documentation for additional examples. Default:
100
.
- Target
Group stringIdentifier - ID or Amazon Resource Name (ARN) of the target group.
- Weight int
- Determines how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a
weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. See Listener rules in the AWS documentation for additional examples. Default:
100
.
- target
Group StringIdentifier - ID or Amazon Resource Name (ARN) of the target group.
- weight Integer
- Determines how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a
weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. See Listener rules in the AWS documentation for additional examples. Default:
100
.
- target
Group stringIdentifier - ID or Amazon Resource Name (ARN) of the target group.
- weight number
- Determines how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a
weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. See Listener rules in the AWS documentation for additional examples. Default:
100
.
- target_
group_ stridentifier - ID or Amazon Resource Name (ARN) of the target group.
- weight int
- Determines how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a
weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. See Listener rules in the AWS documentation for additional examples. Default:
100
.
- target
Group StringIdentifier - ID or Amazon Resource Name (ARN) of the target group.
- weight Number
- Determines how requests are distributed to the target group. Only required if you specify multiple target groups for a forward action. For example, if you specify two target groups, one with a
weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. See Listener rules in the AWS documentation for additional examples. Default:
100
.
Import
Using pulumi import
, import VPC Lattice Listener using the listener_id
of the listener and the id
of the VPC Lattice service combined with a /
character. For example:
$ pulumi import aws:vpclattice/listener:Listener example svc-1a2b3c4d/listener-987654321
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.