Listener Rule
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());
}
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
Import
VPC Lattice Listener Rule can be imported using the example_id_arg
, e.g.,
$ pulumi import aws:vpclattice/listenerRule:ListenerRule example rft-8012925589
Content copied to clipboard
Properties
Link copied to clipboard
The action for the default rule.
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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
The ID or Amazon Resource Identifier (ARN) of the service.