Table Of Contents


User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . lightsail ]



Returns the port states for a specific virtual private server, or instance .

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


--instance-name <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--instance-name (string)

The name of the instance.

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.


portStates -> (list)

Information about the port states resulting from your request.


Describes the port state.

fromPort -> (integer)

The first port in the range.

toPort -> (integer)

The last port in the range.

protocol -> (string)

The protocol being used. Can be one of the following.

  • tcp - Transmission Control Protocol (TCP) provides reliable, ordered, and error-checked delivery of streamed data between applications running on hosts communicating by an IP network. If you have an application that doesn't require reliable data stream service, use UDP instead.
  • all - All transport layer protocol types. For more general information, see Transport layer on Wikipedia.
  • udp - With User Datagram Protocol (UDP), computer applications can send messages (or datagrams) to other hosts on an Internet Protocol (IP) network. Prior communications are not required to set up transmission channels or data paths. Applications that don't require reliable data stream service can use UDP, which provides a connectionless datagram service that emphasizes reduced latency over reliability. If you do require reliable data stream service, use TCP instead.

state -> (string)

Specifies whether the instance port is open or closed .