AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::VpcLattice::Rule

CfnRule

Creates a listener rule. Each listener has a default rule for checking connection requests, but you can define additional rules. Each rule consists of a priority, one or more actions, and one or more conditions. For more information, see [Listener rules](https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html#listener-rules) in the *Amazon VPC Lattice User Guide* .

Import

import { CfnRule } from 'aws-cdk-lib/aws-vpclattice';

Or use the module namespace:

import * as vpclattice from 'aws-cdk-lib/aws-vpclattice';
// vpclattice.CfnRule

Properties

Configuration passed to the constructor as CfnRuleProps.

actionRequired
IResolvable | ActionProperty

Describes the action for a rule.

matchRequired
IResolvable | MatchProperty

The rule match.

priorityRequired
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.

listenerIdentifierOptional
string

The ID or ARN of the listener.

nameOptional
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. If you don't specify a name, CloudFormation generates one. However, if you specify a name, and later want to replace the resource, you must specify a new name.

serviceIdentifierOptional
string

The ID or ARN of the service.

tagsOptional
CfnTag[]

The tags for the rule.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter