Package com.pulumi.aws.vpclattice
Class ListenerRule
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.vpclattice.ListenerRule
-
public class ListenerRule extends com.pulumi.resources.CustomResourceResource for managing an AWS VPC Lattice Listener Rule. ## Example Usage
### Basic Usagepackage 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.ListenerRuleMatchHttpMatchHeaderMatchArgs; import com.pulumi.aws.vpclattice.inputs.ListenerRuleMatchHttpMatchHeaderMatchMatchArgs; import com.pulumi.aws.vpclattice.inputs.ListenerRuleActionArgs; import com.pulumi.aws.vpclattice.inputs.ListenerRuleActionForwardArgs; import com.pulumi.aws.vpclattice.inputs.ListenerRuleActionForwardTargetGroupArgs; import java.util.ArrayList; import java.util.Arrays; 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 ListenerRule("example", ListenerRuleArgs.builder() .match(ListenerRuleMatchArgs.builder() .httpMatch(ListenerRuleMatchHttpMatchArgs.builder() .pathMatch(ListenerRuleMatchHttpMatchPathMatchArgs.builder() .match(ListenerRuleMatchHttpMatchPathMatchMatchArgs.builder() .prefix("/example-path") .build()) .caseSensitive(true) .build()) .headerMatches(ListenerRuleMatchHttpMatchHeaderMatchArgs.builder() .match(ListenerRuleMatchHttpMatchHeaderMatchMatchArgs.builder() .exact("example-contains") .build()) .name("example-header") .caseSensitive(false) .build()) .build()) .build()) .action(ListenerRuleActionArgs.builder() .forward(ListenerRuleActionForwardArgs.builder() .targetGroups( ListenerRuleActionForwardTargetGroupArgs.builder() .targetGroupIdentifier(exampleAwsVpclatticeTargetGroup.id()) .weight(1) .build(), ListenerRuleActionForwardTargetGroupArgs.builder() .targetGroupIdentifier(example2.id()) .weight(2) .build()) .build()) .build()) .name("example") .listenerIdentifier(exampleAwsVpclatticeListener.listenerId()) .serviceIdentifier(exampleAwsVpclatticeService.id()) .priority(20) .build()); } }
## Import Using `pulumi import`, import VPC Lattice Listener Rule using the `id`. For example: ```sh $ pulumi import aws:vpclattice/listenerRule:ListenerRule example service123/listener456/rule789 ```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.ArrayList; import java.util.Arrays; 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 ListenerRule("example", ListenerRuleArgs.builder() .match(ListenerRuleMatchArgs.builder() .httpMatch(ListenerRuleMatchHttpMatchArgs.builder() .pathMatch(ListenerRuleMatchHttpMatchPathMatchArgs.builder() .match(ListenerRuleMatchHttpMatchPathMatchMatchArgs.builder() .exact("/example-path") .build()) .caseSensitive(false) .build()) .build()) .build()) .action(ListenerRuleActionArgs.builder() .fixedResponse(ListenerRuleActionFixedResponseArgs.builder() .statusCode(404) .build()) .build()) .name("example") .listenerIdentifier(exampleAwsVpclatticeListener.listenerId()) .serviceIdentifier(exampleAwsVpclatticeService.id()) .priority(10) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description ListenerRule(java.lang.String name)ListenerRule(java.lang.String name, ListenerRuleArgs args)ListenerRule(java.lang.String name, ListenerRuleArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<ListenerRuleAction>action()com.pulumi.core.Output<java.lang.String>arn()static ListenerRuleget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ListenerRuleState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>listenerIdentifier()com.pulumi.core.Output<ListenerRuleMatch>match()com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.lang.Integer>priority()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.lang.String>ruleId()com.pulumi.core.Output<java.lang.String>serviceIdentifier()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()
-
-
-
Constructor Detail
-
ListenerRule
public ListenerRule(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
ListenerRule
public ListenerRule(java.lang.String name, ListenerRuleArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
ListenerRule
public ListenerRule(java.lang.String name, ListenerRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
action
public com.pulumi.core.Output<ListenerRuleAction> action()
- Returns:
- Action for the listener rule. See `action` Block for details.
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN for the listener rule.
-
listenerIdentifier
public com.pulumi.core.Output<java.lang.String> listenerIdentifier()
- Returns:
- ID or ARN of the listener.
-
match
public com.pulumi.core.Output<ListenerRuleMatch> match()
- Returns:
- Rule match. See `match` Block for details.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Name of the rule. Must be unique within the listener. 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
public com.pulumi.core.Output<java.lang.Integer> priority()
- Returns:
- 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.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
ruleId
public com.pulumi.core.Output<java.lang.String> ruleId()
- Returns:
- Unique identifier for the listener rule.
-
serviceIdentifier
public com.pulumi.core.Output<java.lang.String> serviceIdentifier()
- Returns:
- ID or ARN of the service. The following arguments are optional:
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
get
public static ListenerRule get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ListenerRuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-