ListenerRuleArgs

data class ListenerRuleArgs(val action: Output<ListenerRuleActionArgs>? = null, val listenerIdentifier: Output<String>? = null, val match: Output<ListenerRuleMatchArgs>? = null, val name: Output<String>? = null, val priority: Output<Int>? = null, val serviceIdentifier: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<ListenerRuleArgs>

Resource for managing an AWS VPC Lattice Listener Rule.

Example Usage

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()
.listenerIdentifier(aws_vpclattice_listener.example().listener_id())
.serviceIdentifier(aws_vpclattice_service.example().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(aws_vpclattice_target_group.example().id())
.weight(1)
.build(),
ListenerRuleActionForwardTargetGroupArgs.builder()
.targetGroupIdentifier(aws_vpclattice_target_group.example2().id())
.weight(2)
.build())
.build())
.build())
.build());
}
}

Basic Usage

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()
.listenerIdentifier(aws_vpclattice_listener.example().listener_id())
.serviceIdentifier(aws_vpclattice_service.example().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());
}
}

Import

VPC Lattice Listener Rule can be imported using the example_id_arg, e.g.,

$ pulumi import aws:vpclattice/listenerRule:ListenerRule example rft-8012925589

Constructors

Link copied to clipboard
constructor(action: Output<ListenerRuleActionArgs>? = null, listenerIdentifier: Output<String>? = null, match: Output<ListenerRuleMatchArgs>? = null, name: Output<String>? = null, priority: Output<Int>? = null, serviceIdentifier: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val action: Output<ListenerRuleActionArgs>? = null

The action for the default rule.

Link copied to clipboard
val listenerIdentifier: Output<String>? = null

The ID or Amazon Resource Name (ARN) of the listener.

Link copied to clipboard
val match: Output<ListenerRuleMatchArgs>? = null

The rule match.

Link copied to clipboard
val name: Output<String>? = null

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.

Link copied to clipboard
val priority: Output<Int>? = null

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:

Link copied to clipboard
val serviceIdentifier: Output<String>? = null

The ID or Amazon Resource Identifier (ARN) of the service.

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

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.

Functions

Link copied to clipboard
open override fun toJava(): ListenerRuleArgs