Skip to content

Create Listener

vpclattice_create_listener R Documentation

Creates a listener for a service

Description

Creates a listener for a service. Before you start using your Amazon VPC Lattice service, you must add one or more listeners. A listener is a process that checks for connection requests to your services. For more information, see Listeners in the Amazon VPC Lattice User Guide.

Usage

vpclattice_create_listener(clientToken, defaultAction, name, port,
  protocol, serviceIdentifier, tags)

Arguments

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.

defaultAction

[required] The action for the default rule. Each listener has a default rule. The default rule is used if no other rules match.

name

[required] The name of the listener. A listener name must be unique within a service. 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.

port

The listener port. You can specify a value from 1 to 65535. For HTTP, the default is 80. For HTTPS, the default is 443.

protocol

[required] The listener protocol.

serviceIdentifier

[required] The ID or Amazon Resource Name (ARN) of the service.

tags

The tags for the listener.

Value

A list with the following syntax:

list(
  arn = "string",
  defaultAction = list(
    fixedResponse = list(
      statusCode = 123
    ),
    forward = list(
      targetGroups = list(
        list(
          targetGroupIdentifier = "string",
          weight = 123
        )
      )
    )
  ),
  id = "string",
  name = "string",
  port = 123,
  protocol = "HTTP"|"HTTPS"|"TLS_PASSTHROUGH",
  serviceArn = "string",
  serviceId = "string"
)

Request syntax

svc$create_listener(
  clientToken = "string",
  defaultAction = list(
    fixedResponse = list(
      statusCode = 123
    ),
    forward = list(
      targetGroups = list(
        list(
          targetGroupIdentifier = "string",
          weight = 123
        )
      )
    )
  ),
  name = "string",
  port = 123,
  protocol = "HTTP"|"HTTPS"|"TLS_PASSTHROUGH",
  serviceIdentifier = "string",
  tags = list(
    "string"
  )
)