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(serviceIdentifier, name, protocol, port,
  defaultAction, clientToken, tags)

Arguments

serviceIdentifier

[required] The ID or ARN of the service.

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.

protocol

[required] The listener protocol.

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.

defaultAction

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

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

Value

A list with the following syntax:

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

Request syntax

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