ListenerRule

class ListenerRule : KotlinCustomResource

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

Properties

Link copied to clipboard

The action for the default rule.

Link copied to clipboard
val arn: Output<String>

ARN of the target group.

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

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

Link copied to clipboard

The rule match.

Link copied to clipboard
val name: Output<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.

Link copied to clipboard
val priority: Output<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:

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

Unique identifier for the target group.

Link copied to clipboard

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

Link copied to clipboard
val tags: Output<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.

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

Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urn: Output<String>