aws.vpclattice.ListenerRule
Explore with Pulumi AI
Resource for managing an AWS VPC Lattice Listener Rule.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.vpclattice.ListenerRule("test", {
name: "example",
listenerIdentifier: exampleAwsVpclatticeListener.listenerId,
serviceIdentifier: exampleAwsVpclatticeService.id,
priority: 20,
match: {
httpMatch: {
headerMatches: [{
name: "example-header",
caseSensitive: false,
match: {
exact: "example-contains",
},
}],
pathMatch: {
caseSensitive: true,
match: {
prefix: "/example-path",
},
},
},
},
action: {
forward: {
targetGroups: [
{
targetGroupIdentifier: example.id,
weight: 1,
},
{
targetGroupIdentifier: example2.id,
weight: 2,
},
],
},
},
});
import pulumi
import pulumi_aws as aws
test = aws.vpclattice.ListenerRule("test",
name="example",
listener_identifier=example_aws_vpclattice_listener["listenerId"],
service_identifier=example_aws_vpclattice_service["id"],
priority=20,
match={
"http_match": {
"header_matches": [{
"name": "example-header",
"case_sensitive": False,
"match": {
"exact": "example-contains",
},
}],
"path_match": {
"case_sensitive": True,
"match": {
"prefix": "/example-path",
},
},
},
},
action={
"forward": {
"target_groups": [
{
"target_group_identifier": example["id"],
"weight": 1,
},
{
"target_group_identifier": example2["id"],
"weight": 2,
},
],
},
})
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 {
_, err := vpclattice.NewListenerRule(ctx, "test", &vpclattice.ListenerRuleArgs{
Name: pulumi.String("example"),
ListenerIdentifier: pulumi.Any(exampleAwsVpclatticeListener.ListenerId),
ServiceIdentifier: pulumi.Any(exampleAwsVpclatticeService.Id),
Priority: pulumi.Int(20),
Match: &vpclattice.ListenerRuleMatchArgs{
HttpMatch: &vpclattice.ListenerRuleMatchHttpMatchArgs{
HeaderMatches: vpclattice.ListenerRuleMatchHttpMatchHeaderMatchArray{
&vpclattice.ListenerRuleMatchHttpMatchHeaderMatchArgs{
Name: pulumi.String("example-header"),
CaseSensitive: pulumi.Bool(false),
Match: &vpclattice.ListenerRuleMatchHttpMatchHeaderMatchMatchArgs{
Exact: pulumi.String("example-contains"),
},
},
},
PathMatch: &vpclattice.ListenerRuleMatchHttpMatchPathMatchArgs{
CaseSensitive: pulumi.Bool(true),
Match: &vpclattice.ListenerRuleMatchHttpMatchPathMatchMatchArgs{
Prefix: pulumi.String("/example-path"),
},
},
},
},
Action: &vpclattice.ListenerRuleActionArgs{
Forward: &vpclattice.ListenerRuleActionForwardArgs{
TargetGroups: vpclattice.ListenerRuleActionForwardTargetGroupArray{
&vpclattice.ListenerRuleActionForwardTargetGroupArgs{
TargetGroupIdentifier: pulumi.Any(example.Id),
Weight: pulumi.Int(1),
},
&vpclattice.ListenerRuleActionForwardTargetGroupArgs{
TargetGroupIdentifier: pulumi.Any(example2.Id),
Weight: pulumi.Int(2),
},
},
},
},
})
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 test = new Aws.VpcLattice.ListenerRule("test", new()
{
Name = "example",
ListenerIdentifier = exampleAwsVpclatticeListener.ListenerId,
ServiceIdentifier = exampleAwsVpclatticeService.Id,
Priority = 20,
Match = new Aws.VpcLattice.Inputs.ListenerRuleMatchArgs
{
HttpMatch = new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchArgs
{
HeaderMatches = new[]
{
new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchHeaderMatchArgs
{
Name = "example-header",
CaseSensitive = false,
Match = new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchHeaderMatchMatchArgs
{
Exact = "example-contains",
},
},
},
PathMatch = new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchPathMatchArgs
{
CaseSensitive = true,
Match = new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchPathMatchMatchArgs
{
Prefix = "/example-path",
},
},
},
},
Action = new Aws.VpcLattice.Inputs.ListenerRuleActionArgs
{
Forward = new Aws.VpcLattice.Inputs.ListenerRuleActionForwardArgs
{
TargetGroups = new[]
{
new Aws.VpcLattice.Inputs.ListenerRuleActionForwardTargetGroupArgs
{
TargetGroupIdentifier = example.Id,
Weight = 1,
},
new Aws.VpcLattice.Inputs.ListenerRuleActionForwardTargetGroupArgs
{
TargetGroupIdentifier = example2.Id,
Weight = 2,
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.vpclattice.ListenerRule;
import com.pulumi.aws.vpclattice.ListenerRuleArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleMatchArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleMatchHttpMatchArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleMatchHttpMatchPathMatchArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleMatchHttpMatchPathMatchMatchArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleActionArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleActionForwardArgs;
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 ListenerRule("test", ListenerRuleArgs.builder()
.name("example")
.listenerIdentifier(exampleAwsVpclatticeListener.listenerId())
.serviceIdentifier(exampleAwsVpclatticeService.id())
.priority(20)
.match(ListenerRuleMatchArgs.builder()
.httpMatch(ListenerRuleMatchHttpMatchArgs.builder()
.headerMatches(ListenerRuleMatchHttpMatchHeaderMatchArgs.builder()
.name("example-header")
.caseSensitive(false)
.match(ListenerRuleMatchHttpMatchHeaderMatchMatchArgs.builder()
.exact("example-contains")
.build())
.build())
.pathMatch(ListenerRuleMatchHttpMatchPathMatchArgs.builder()
.caseSensitive(true)
.match(ListenerRuleMatchHttpMatchPathMatchMatchArgs.builder()
.prefix("/example-path")
.build())
.build())
.build())
.build())
.action(ListenerRuleActionArgs.builder()
.forward(ListenerRuleActionForwardArgs.builder()
.targetGroups(
ListenerRuleActionForwardTargetGroupArgs.builder()
.targetGroupIdentifier(example.id())
.weight(1)
.build(),
ListenerRuleActionForwardTargetGroupArgs.builder()
.targetGroupIdentifier(example2.id())
.weight(2)
.build())
.build())
.build())
.build());
}
}
resources:
test:
type: aws:vpclattice:ListenerRule
properties:
name: example
listenerIdentifier: ${exampleAwsVpclatticeListener.listenerId}
serviceIdentifier: ${exampleAwsVpclatticeService.id}
priority: 20
match:
httpMatch:
headerMatches:
- name: example-header
caseSensitive: false
match:
exact: example-contains
pathMatch:
caseSensitive: true
match:
prefix: /example-path
action:
forward:
targetGroups:
- targetGroupIdentifier: ${example.id}
weight: 1
- targetGroupIdentifier: ${example2.id}
weight: 2
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.vpclattice.ListenerRule("test", {
name: "example",
listenerIdentifier: example.listenerId,
serviceIdentifier: exampleAwsVpclatticeService.id,
priority: 10,
match: {
httpMatch: {
pathMatch: {
caseSensitive: false,
match: {
exact: "/example-path",
},
},
},
},
action: {
fixedResponse: {
statusCode: 404,
},
},
});
import pulumi
import pulumi_aws as aws
test = aws.vpclattice.ListenerRule("test",
name="example",
listener_identifier=example["listenerId"],
service_identifier=example_aws_vpclattice_service["id"],
priority=10,
match={
"http_match": {
"path_match": {
"case_sensitive": False,
"match": {
"exact": "/example-path",
},
},
},
},
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 {
_, err := vpclattice.NewListenerRule(ctx, "test", &vpclattice.ListenerRuleArgs{
Name: pulumi.String("example"),
ListenerIdentifier: pulumi.Any(example.ListenerId),
ServiceIdentifier: pulumi.Any(exampleAwsVpclatticeService.Id),
Priority: pulumi.Int(10),
Match: &vpclattice.ListenerRuleMatchArgs{
HttpMatch: &vpclattice.ListenerRuleMatchHttpMatchArgs{
PathMatch: &vpclattice.ListenerRuleMatchHttpMatchPathMatchArgs{
CaseSensitive: pulumi.Bool(false),
Match: &vpclattice.ListenerRuleMatchHttpMatchPathMatchMatchArgs{
Exact: pulumi.String("/example-path"),
},
},
},
},
Action: &vpclattice.ListenerRuleActionArgs{
FixedResponse: &vpclattice.ListenerRuleActionFixedResponseArgs{
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 test = new Aws.VpcLattice.ListenerRule("test", new()
{
Name = "example",
ListenerIdentifier = example.ListenerId,
ServiceIdentifier = exampleAwsVpclatticeService.Id,
Priority = 10,
Match = new Aws.VpcLattice.Inputs.ListenerRuleMatchArgs
{
HttpMatch = new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchArgs
{
PathMatch = new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchPathMatchArgs
{
CaseSensitive = false,
Match = new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchPathMatchMatchArgs
{
Exact = "/example-path",
},
},
},
},
Action = new Aws.VpcLattice.Inputs.ListenerRuleActionArgs
{
FixedResponse = new Aws.VpcLattice.Inputs.ListenerRuleActionFixedResponseArgs
{
StatusCode = 404,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.vpclattice.ListenerRule;
import com.pulumi.aws.vpclattice.ListenerRuleArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleMatchArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleMatchHttpMatchArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleMatchHttpMatchPathMatchArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleMatchHttpMatchPathMatchMatchArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleActionArgs;
import com.pulumi.aws.vpclattice.inputs.ListenerRuleActionFixedResponseArgs;
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 ListenerRule("test", ListenerRuleArgs.builder()
.name("example")
.listenerIdentifier(example.listenerId())
.serviceIdentifier(exampleAwsVpclatticeService.id())
.priority(10)
.match(ListenerRuleMatchArgs.builder()
.httpMatch(ListenerRuleMatchHttpMatchArgs.builder()
.pathMatch(ListenerRuleMatchHttpMatchPathMatchArgs.builder()
.caseSensitive(false)
.match(ListenerRuleMatchHttpMatchPathMatchMatchArgs.builder()
.exact("/example-path")
.build())
.build())
.build())
.build())
.action(ListenerRuleActionArgs.builder()
.fixedResponse(ListenerRuleActionFixedResponseArgs.builder()
.statusCode(404)
.build())
.build())
.build());
}
}
resources:
test:
type: aws:vpclattice:ListenerRule
properties:
name: example
listenerIdentifier: ${example.listenerId}
serviceIdentifier: ${exampleAwsVpclatticeService.id}
priority: 10
match:
httpMatch:
pathMatch:
caseSensitive: false
match:
exact: /example-path
action:
fixedResponse:
statusCode: 404
Create ListenerRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ListenerRule(name: string, args: ListenerRuleArgs, opts?: CustomResourceOptions);
@overload
def ListenerRule(resource_name: str,
args: ListenerRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ListenerRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
action: Optional[ListenerRuleActionArgs] = None,
listener_identifier: Optional[str] = None,
match: Optional[ListenerRuleMatchArgs] = None,
priority: Optional[int] = None,
service_identifier: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewListenerRule(ctx *Context, name string, args ListenerRuleArgs, opts ...ResourceOption) (*ListenerRule, error)
public ListenerRule(string name, ListenerRuleArgs args, CustomResourceOptions? opts = null)
public ListenerRule(String name, ListenerRuleArgs args)
public ListenerRule(String name, ListenerRuleArgs args, CustomResourceOptions options)
type: aws:vpclattice:ListenerRule
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 ListenerRuleArgs
- 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 ListenerRuleArgs
- 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 ListenerRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ListenerRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ListenerRuleArgs
- 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 examplelistenerRuleResourceResourceFromVpclatticelistenerRule = new Aws.VpcLattice.ListenerRule("examplelistenerRuleResourceResourceFromVpclatticelistenerRule", new()
{
Action = new Aws.VpcLattice.Inputs.ListenerRuleActionArgs
{
FixedResponse = new Aws.VpcLattice.Inputs.ListenerRuleActionFixedResponseArgs
{
StatusCode = 0,
},
Forward = new Aws.VpcLattice.Inputs.ListenerRuleActionForwardArgs
{
TargetGroups = new[]
{
new Aws.VpcLattice.Inputs.ListenerRuleActionForwardTargetGroupArgs
{
TargetGroupIdentifier = "string",
Weight = 0,
},
},
},
},
ListenerIdentifier = "string",
Match = new Aws.VpcLattice.Inputs.ListenerRuleMatchArgs
{
HttpMatch = new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchArgs
{
HeaderMatches = new[]
{
new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchHeaderMatchArgs
{
Match = new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchHeaderMatchMatchArgs
{
Contains = "string",
Exact = "string",
Prefix = "string",
},
Name = "string",
CaseSensitive = false,
},
},
Method = "string",
PathMatch = new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchPathMatchArgs
{
Match = new Aws.VpcLattice.Inputs.ListenerRuleMatchHttpMatchPathMatchMatchArgs
{
Exact = "string",
Prefix = "string",
},
CaseSensitive = false,
},
},
},
Priority = 0,
ServiceIdentifier = "string",
Name = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := vpclattice.NewListenerRule(ctx, "examplelistenerRuleResourceResourceFromVpclatticelistenerRule", &vpclattice.ListenerRuleArgs{
Action: &vpclattice.ListenerRuleActionArgs{
FixedResponse: &vpclattice.ListenerRuleActionFixedResponseArgs{
StatusCode: pulumi.Int(0),
},
Forward: &vpclattice.ListenerRuleActionForwardArgs{
TargetGroups: vpclattice.ListenerRuleActionForwardTargetGroupArray{
&vpclattice.ListenerRuleActionForwardTargetGroupArgs{
TargetGroupIdentifier: pulumi.String("string"),
Weight: pulumi.Int(0),
},
},
},
},
ListenerIdentifier: pulumi.String("string"),
Match: &vpclattice.ListenerRuleMatchArgs{
HttpMatch: &vpclattice.ListenerRuleMatchHttpMatchArgs{
HeaderMatches: vpclattice.ListenerRuleMatchHttpMatchHeaderMatchArray{
&vpclattice.ListenerRuleMatchHttpMatchHeaderMatchArgs{
Match: &vpclattice.ListenerRuleMatchHttpMatchHeaderMatchMatchArgs{
Contains: pulumi.String("string"),
Exact: pulumi.String("string"),
Prefix: pulumi.String("string"),
},
Name: pulumi.String("string"),
CaseSensitive: pulumi.Bool(false),
},
},
Method: pulumi.String("string"),
PathMatch: &vpclattice.ListenerRuleMatchHttpMatchPathMatchArgs{
Match: &vpclattice.ListenerRuleMatchHttpMatchPathMatchMatchArgs{
Exact: pulumi.String("string"),
Prefix: pulumi.String("string"),
},
CaseSensitive: pulumi.Bool(false),
},
},
},
Priority: pulumi.Int(0),
ServiceIdentifier: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var examplelistenerRuleResourceResourceFromVpclatticelistenerRule = new ListenerRule("examplelistenerRuleResourceResourceFromVpclatticelistenerRule", ListenerRuleArgs.builder()
.action(ListenerRuleActionArgs.builder()
.fixedResponse(ListenerRuleActionFixedResponseArgs.builder()
.statusCode(0)
.build())
.forward(ListenerRuleActionForwardArgs.builder()
.targetGroups(ListenerRuleActionForwardTargetGroupArgs.builder()
.targetGroupIdentifier("string")
.weight(0)
.build())
.build())
.build())
.listenerIdentifier("string")
.match(ListenerRuleMatchArgs.builder()
.httpMatch(ListenerRuleMatchHttpMatchArgs.builder()
.headerMatches(ListenerRuleMatchHttpMatchHeaderMatchArgs.builder()
.match(ListenerRuleMatchHttpMatchHeaderMatchMatchArgs.builder()
.contains("string")
.exact("string")
.prefix("string")
.build())
.name("string")
.caseSensitive(false)
.build())
.method("string")
.pathMatch(ListenerRuleMatchHttpMatchPathMatchArgs.builder()
.match(ListenerRuleMatchHttpMatchPathMatchMatchArgs.builder()
.exact("string")
.prefix("string")
.build())
.caseSensitive(false)
.build())
.build())
.build())
.priority(0)
.serviceIdentifier("string")
.name("string")
.tags(Map.of("string", "string"))
.build());
examplelistener_rule_resource_resource_from_vpclatticelistener_rule = aws.vpclattice.ListenerRule("examplelistenerRuleResourceResourceFromVpclatticelistenerRule",
action={
"fixedResponse": {
"statusCode": 0,
},
"forward": {
"targetGroups": [{
"targetGroupIdentifier": "string",
"weight": 0,
}],
},
},
listener_identifier="string",
match={
"httpMatch": {
"headerMatches": [{
"match": {
"contains": "string",
"exact": "string",
"prefix": "string",
},
"name": "string",
"caseSensitive": False,
}],
"method": "string",
"pathMatch": {
"match": {
"exact": "string",
"prefix": "string",
},
"caseSensitive": False,
},
},
},
priority=0,
service_identifier="string",
name="string",
tags={
"string": "string",
})
const examplelistenerRuleResourceResourceFromVpclatticelistenerRule = new aws.vpclattice.ListenerRule("examplelistenerRuleResourceResourceFromVpclatticelistenerRule", {
action: {
fixedResponse: {
statusCode: 0,
},
forward: {
targetGroups: [{
targetGroupIdentifier: "string",
weight: 0,
}],
},
},
listenerIdentifier: "string",
match: {
httpMatch: {
headerMatches: [{
match: {
contains: "string",
exact: "string",
prefix: "string",
},
name: "string",
caseSensitive: false,
}],
method: "string",
pathMatch: {
match: {
exact: "string",
prefix: "string",
},
caseSensitive: false,
},
},
},
priority: 0,
serviceIdentifier: "string",
name: "string",
tags: {
string: "string",
},
});
type: aws:vpclattice:ListenerRule
properties:
action:
fixedResponse:
statusCode: 0
forward:
targetGroups:
- targetGroupIdentifier: string
weight: 0
listenerIdentifier: string
match:
httpMatch:
headerMatches:
- caseSensitive: false
match:
contains: string
exact: string
prefix: string
name: string
method: string
pathMatch:
caseSensitive: false
match:
exact: string
prefix: string
name: string
priority: 0
serviceIdentifier: string
tags:
string: string
ListenerRule 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 ListenerRule resource accepts the following input properties:
- Action
Listener
Rule Action - The action for the listener rule.
- Listener
Identifier string - The ID or Amazon Resource Name (ARN) of the listener.
- Match
Listener
Rule Match - The rule match.
- Priority int
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- Service
Identifier string - The ID or Amazon Resource Identifier (ARN) of the service.
- Name string
- The name of the rule. The name must be unique within the listener. The 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.
- Dictionary<string, string>
- Key-value mapping of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Action
Listener
Rule Action Args - The action for the listener rule.
- Listener
Identifier string - The ID or Amazon Resource Name (ARN) of the listener.
- Match
Listener
Rule Match Args - The rule match.
- Priority int
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- Service
Identifier string - The ID or Amazon Resource Identifier (ARN) of the service.
- Name string
- The name of the rule. The name must be unique within the listener. The 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.
- map[string]string
- Key-value mapping of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- action
Listener
Rule Action - The action for the listener rule.
- listener
Identifier String - The ID or Amazon Resource Name (ARN) of the listener.
- match
Listener
Rule Match - The rule match.
- priority Integer
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- service
Identifier String - The ID or Amazon Resource Identifier (ARN) of the service.
- name String
- The name of the rule. The name must be unique within the listener. The 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.
- Map<String,String>
- Key-value mapping of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- action
Listener
Rule Action - The action for the listener rule.
- listener
Identifier string - The ID or Amazon Resource Name (ARN) of the listener.
- match
Listener
Rule Match - The rule match.
- priority number
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- service
Identifier string - The ID or Amazon Resource Identifier (ARN) of the service.
- name string
- The name of the rule. The name must be unique within the listener. The 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.
- {[key: string]: string}
- Key-value mapping of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- action
Listener
Rule Action Args - The action for the listener rule.
- listener_
identifier str - The ID or Amazon Resource Name (ARN) of the listener.
- match
Listener
Rule Match Args - The rule match.
- priority int
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- service_
identifier str - The ID or Amazon Resource Identifier (ARN) of the service.
- name str
- The name of the rule. The name must be unique within the listener. The 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.
- Mapping[str, str]
- Key-value mapping of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- action Property Map
- The action for the listener rule.
- listener
Identifier String - The ID or Amazon Resource Name (ARN) of the listener.
- match Property Map
- The rule match.
- priority Number
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- service
Identifier String - The ID or Amazon Resource Identifier (ARN) of the service.
- name String
- The name of the rule. The name must be unique within the listener. The 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.
- Map<String>
- Key-value mapping of resource tags. 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 ListenerRule resource produces the following output properties:
- Arn string
- The ARN for the listener rule.
- Id string
- The provider-assigned unique ID for this managed resource.
- Rule
Id string - Unique identifier for the listener rule.
- Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up Existing ListenerRule Resource
Get an existing ListenerRule 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?: ListenerRuleState, opts?: CustomResourceOptions): ListenerRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
action: Optional[ListenerRuleActionArgs] = None,
arn: Optional[str] = None,
listener_identifier: Optional[str] = None,
match: Optional[ListenerRuleMatchArgs] = None,
name: Optional[str] = None,
priority: Optional[int] = None,
rule_id: Optional[str] = None,
service_identifier: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> ListenerRule
func GetListenerRule(ctx *Context, name string, id IDInput, state *ListenerRuleState, opts ...ResourceOption) (*ListenerRule, error)
public static ListenerRule Get(string name, Input<string> id, ListenerRuleState? state, CustomResourceOptions? opts = null)
public static ListenerRule get(String name, Output<String> id, ListenerRuleState 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.
- Action
Listener
Rule Action - The action for the listener rule.
- Arn string
- The ARN for the listener rule.
- Listener
Identifier string - The ID or Amazon Resource Name (ARN) of the listener.
- Match
Listener
Rule Match - The rule match.
- Name string
- The name of the rule. The name must be unique within the listener. The 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.
- Priority int
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- Rule
Id string - Unique identifier for the listener rule.
- Service
Identifier string - The ID or Amazon Resource Identifier (ARN) of the service.
- Dictionary<string, string>
- Key-value mapping of resource tags. 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>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Action
Listener
Rule Action Args - The action for the listener rule.
- Arn string
- The ARN for the listener rule.
- Listener
Identifier string - The ID or Amazon Resource Name (ARN) of the listener.
- Match
Listener
Rule Match Args - The rule match.
- Name string
- The name of the rule. The name must be unique within the listener. The 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.
- Priority int
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- Rule
Id string - Unique identifier for the listener rule.
- Service
Identifier string - The ID or Amazon Resource Identifier (ARN) of the service.
- map[string]string
- Key-value mapping of resource tags. 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
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- action
Listener
Rule Action - The action for the listener rule.
- arn String
- The ARN for the listener rule.
- listener
Identifier String - The ID or Amazon Resource Name (ARN) of the listener.
- match
Listener
Rule Match - The rule match.
- name String
- The name of the rule. The name must be unique within the listener. The 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.
- priority Integer
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- rule
Id String - Unique identifier for the listener rule.
- service
Identifier String - The ID or Amazon Resource Identifier (ARN) of the service.
- Map<String,String>
- Key-value mapping of resource tags. 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>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- action
Listener
Rule Action - The action for the listener rule.
- arn string
- The ARN for the listener rule.
- listener
Identifier string - The ID or Amazon Resource Name (ARN) of the listener.
- match
Listener
Rule Match - The rule match.
- name string
- The name of the rule. The name must be unique within the listener. The 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.
- priority number
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- rule
Id string - Unique identifier for the listener rule.
- service
Identifier string - The ID or Amazon Resource Identifier (ARN) of the service.
- {[key: string]: string}
- Key-value mapping of resource tags. 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}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- action
Listener
Rule Action Args - The action for the listener rule.
- arn str
- The ARN for the listener rule.
- listener_
identifier str - The ID or Amazon Resource Name (ARN) of the listener.
- match
Listener
Rule Match Args - The rule match.
- name str
- The name of the rule. The name must be unique within the listener. The 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.
- priority int
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- rule_
id str - Unique identifier for the listener rule.
- service_
identifier str - The ID or Amazon Resource Identifier (ARN) of the service.
- Mapping[str, str]
- Key-value mapping of resource tags. 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]
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- action Property Map
- The action for the listener rule.
- arn String
- The ARN for the listener rule.
- listener
Identifier String - The ID or Amazon Resource Name (ARN) of the listener.
- match Property Map
- The rule match.
- name String
- The name of the rule. The name must be unique within the listener. The 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.
- priority Number
The priority assigned to the rule. Each rule for a specific listener must have a unique priority. The lower the priority number the higher the priority.
The following arguments are optional:
- rule
Id String - Unique identifier for the listener rule.
- service
Identifier String - The ID or Amazon Resource Identifier (ARN) of the service.
- Map<String>
- Key-value mapping of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Supporting Types
ListenerRuleAction, ListenerRuleActionArgs
- Fixed
Response ListenerRule Action Fixed Response - Describes the rule action that returns a custom HTTP response.
- Forward
Listener
Rule Action Forward - The forward action. Traffic that matches the rule is forwarded to the specified target groups.
- Fixed
Response ListenerRule Action Fixed Response - Describes the rule action that returns a custom HTTP response.
- Forward
Listener
Rule Action Forward - The forward action. Traffic that matches the rule is forwarded to the specified target groups.
- fixed
Response ListenerRule Action Fixed Response - Describes the rule action that returns a custom HTTP response.
- forward
Listener
Rule Action Forward - The forward action. Traffic that matches the rule is forwarded to the specified target groups.
- fixed
Response ListenerRule Action Fixed Response - Describes the rule action that returns a custom HTTP response.
- forward
Listener
Rule Action Forward - The forward action. Traffic that matches the rule is forwarded to the specified target groups.
- fixed_
response ListenerRule Action Fixed Response - Describes the rule action that returns a custom HTTP response.
- forward
Listener
Rule Action Forward - The forward action. Traffic that matches the rule is forwarded to the specified target groups.
- fixed
Response Property Map - Describes the rule action that returns a custom HTTP response.
- forward Property Map
- The forward action. Traffic that matches the rule is forwarded to the specified target groups.
ListenerRuleActionFixedResponse, ListenerRuleActionFixedResponseArgs
- Status
Code int - The HTTP response code.
- Status
Code int - The HTTP response code.
- status
Code Integer - The HTTP response code.
- status
Code number - The HTTP response code.
- status_
code int - The HTTP response code.
- status
Code Number - The HTTP response code.
ListenerRuleActionForward, ListenerRuleActionForwardArgs
- Target
Groups List<ListenerRule Action Forward Target Group> The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic.
The default value is 1 with maximum number of 2. If only one target group is provided, there is no need to set the weight; 100% of traffic will go to that target group.
- Target
Groups []ListenerRule Action Forward Target Group The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic.
The default value is 1 with maximum number of 2. If only one target group is provided, there is no need to set the weight; 100% of traffic will go to that target group.
- target
Groups List<ListenerRule Action Forward Target Group> The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic.
The default value is 1 with maximum number of 2. If only one target group is provided, there is no need to set the weight; 100% of traffic will go to that target group.
- target
Groups ListenerRule Action Forward Target Group[] The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic.
The default value is 1 with maximum number of 2. If only one target group is provided, there is no need to set the weight; 100% of traffic will go to that target group.
- target_
groups Sequence[ListenerRule Action Forward Target Group] The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic.
The default value is 1 with maximum number of 2. If only one target group is provided, there is no need to set the weight; 100% of traffic will go to that target group.
- target
Groups List<Property Map> The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions, you can assign a weight that controls the prioritization and selection of each target group. This means that requests are distributed to individual target groups based on their weights. For example, if two target groups have the same weight, each target group receives half of the traffic.
The default value is 1 with maximum number of 2. If only one target group is provided, there is no need to set the weight; 100% of traffic will go to that target group.
ListenerRuleActionForwardTargetGroup, ListenerRuleActionForwardTargetGroupArgs
- Target
Group stringIdentifier - Weight int
- Target
Group stringIdentifier - Weight int
- target
Group StringIdentifier - weight Integer
- target
Group stringIdentifier - weight number
- target_
group_ stridentifier - weight int
- target
Group StringIdentifier - weight Number
ListenerRuleMatch, ListenerRuleMatchArgs
- Http
Match ListenerRule Match Http Match - The HTTP criteria that a rule must match.
- Http
Match ListenerRule Match Http Match - The HTTP criteria that a rule must match.
- http
Match ListenerRule Match Http Match - The HTTP criteria that a rule must match.
- http
Match ListenerRule Match Http Match - The HTTP criteria that a rule must match.
- http_
match ListenerRule Match Http Match - The HTTP criteria that a rule must match.
- http
Match Property Map - The HTTP criteria that a rule must match.
ListenerRuleMatchHttpMatch, ListenerRuleMatchHttpMatchArgs
- Header
Matches List<ListenerRule Match Http Match Header Match> - The header matches. Matches incoming requests with rule based on request header value before applying rule action.
- Method string
- The HTTP method type.
- Path
Match ListenerRule Match Http Match Path Match - The path match.
- Header
Matches []ListenerRule Match Http Match Header Match - The header matches. Matches incoming requests with rule based on request header value before applying rule action.
- Method string
- The HTTP method type.
- Path
Match ListenerRule Match Http Match Path Match - The path match.
- header
Matches List<ListenerRule Match Http Match Header Match> - The header matches. Matches incoming requests with rule based on request header value before applying rule action.
- method String
- The HTTP method type.
- path
Match ListenerRule Match Http Match Path Match - The path match.
- header
Matches ListenerRule Match Http Match Header Match[] - The header matches. Matches incoming requests with rule based on request header value before applying rule action.
- method string
- The HTTP method type.
- path
Match ListenerRule Match Http Match Path Match - The path match.
- header_
matches Sequence[ListenerRule Match Http Match Header Match] - The header matches. Matches incoming requests with rule based on request header value before applying rule action.
- method str
- The HTTP method type.
- path_
match ListenerRule Match Http Match Path Match - The path match.
- header
Matches List<Property Map> - The header matches. Matches incoming requests with rule based on request header value before applying rule action.
- method String
- The HTTP method type.
- path
Match Property Map - The path match.
ListenerRuleMatchHttpMatchHeaderMatch, ListenerRuleMatchHttpMatchHeaderMatchArgs
- Match
Listener
Rule Match Http Match Header Match Match - The header match type.
- Name string
- The name of the header.
- Case
Sensitive bool - Indicates whether the match is case sensitive. Defaults to false.
- Match
Listener
Rule Match Http Match Header Match Match - The header match type.
- Name string
- The name of the header.
- Case
Sensitive bool - Indicates whether the match is case sensitive. Defaults to false.
- match
Listener
Rule Match Http Match Header Match Match - The header match type.
- name String
- The name of the header.
- case
Sensitive Boolean - Indicates whether the match is case sensitive. Defaults to false.
- match
Listener
Rule Match Http Match Header Match Match - The header match type.
- name string
- The name of the header.
- case
Sensitive boolean - Indicates whether the match is case sensitive. Defaults to false.
- match
Listener
Rule Match Http Match Header Match Match - The header match type.
- name str
- The name of the header.
- case_
sensitive bool - Indicates whether the match is case sensitive. Defaults to false.
- match Property Map
- The header match type.
- name String
- The name of the header.
- case
Sensitive Boolean - Indicates whether the match is case sensitive. Defaults to false.
ListenerRuleMatchHttpMatchHeaderMatchMatch, ListenerRuleMatchHttpMatchHeaderMatchMatchArgs
ListenerRuleMatchHttpMatchPathMatch, ListenerRuleMatchHttpMatchPathMatchArgs
- Match
Listener
Rule Match Http Match Path Match Match - The header match type.
- Case
Sensitive bool - Indicates whether the match is case sensitive. Defaults to false.
- Match
Listener
Rule Match Http Match Path Match Match - The header match type.
- Case
Sensitive bool - Indicates whether the match is case sensitive. Defaults to false.
- match
Listener
Rule Match Http Match Path Match Match - The header match type.
- case
Sensitive Boolean - Indicates whether the match is case sensitive. Defaults to false.
- match
Listener
Rule Match Http Match Path Match Match - The header match type.
- case
Sensitive boolean - Indicates whether the match is case sensitive. Defaults to false.
- match
Listener
Rule Match Http Match Path Match Match - The header match type.
- case_
sensitive bool - Indicates whether the match is case sensitive. Defaults to false.
- match Property Map
- The header match type.
- case
Sensitive Boolean - Indicates whether the match is case sensitive. Defaults to false.
ListenerRuleMatchHttpMatchPathMatchMatch, ListenerRuleMatchHttpMatchPathMatchMatchArgs
Import
Using pulumi import
, import VPC Lattice Listener Rule using the id
. For example:
$ pulumi import aws:vpclattice/listenerRule:ListenerRule example service123/listener456/rule789
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.