Skip to content

Creates a listener rule

Description

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 in the Amazon VPC Lattice User Guide.

Usage

vpclattice_create_rule(serviceIdentifier, listenerIdentifier, name,
  match, priority, action, clientToken, tags)

Arguments

  • serviceIdentifier

[required] The ID or ARN of the service.

  • listenerIdentifier

[required] The ID or ARN of the listener.

  • name

[required] 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.

  • match

[required] The rule match.

  • priority

[required] 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.

  • action

[required] The action for the default rule.

  • clientToken

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.

  • tags

The tags for the rule.

Value

A list with the following syntax:

list(
  arn = "string",
  id = "string",
  name = "string",
  match = list(
    httpMatch = list(
      method = "string",
      pathMatch = list(
        match = list(
          exact = "string",
          prefix = "string"
        ),
        caseSensitive = TRUE|FALSE
      ),
      headerMatches = list(
        list(
          name = "string",
          match = list(
            exact = "string",
            prefix = "string",
            contains = "string"
          ),
          caseSensitive = TRUE|FALSE
        )
      )
    )
  ),
  priority = 123,
  action = list(
    forward = list(
      targetGroups = list(
        list(
          targetGroupIdentifier = "string",
          weight = 123
        )
      )
    ),
    fixedResponse = list(
      statusCode = 123
    )
  )
)

Request syntax

svc$create_rule(
  serviceIdentifier = "string",
  listenerIdentifier = "string",
  name = "string",
  match = list(
    httpMatch = list(
      method = "string",
      pathMatch = list(
        match = list(
          exact = "string",
          prefix = "string"
        ),
        caseSensitive = TRUE|FALSE
      ),
      headerMatches = list(
        list(
          name = "string",
          match = list(
            exact = "string",
            prefix = "string",
            contains = "string"
          ),
          caseSensitive = TRUE|FALSE
        )
      )
    )
  ),
  priority = 123,
  action = list(
    forward = list(
      targetGroups = list(
        list(
          targetGroupIdentifier = "string",
          weight = 123
        )
      )
    ),
    fixedResponse = list(
      statusCode = 123
    )
  ),
  clientToken = "string",
  tags = list(
    "string"
  )
)