Viewing public address ranges

You can view public address ranges with the console, CLI, API, and Terraform.

Viewing public address ranges in the console

To view public address ranges in the IBM Cloud console, select the Navigation menu Menu icon, then click Infrastructure VPC icon > Network > Public address ranges.

The Public address ranges for VPC page shows the following information:

  • Name: The name of the public address range object.
  • Status: States whether the address range is bound or unbound to the specified VPC.
  • Lifecycle state: States whether the binding or unbinding of the address range is successful, and if it is stable or not.
  • IP range: The range of IP addresses included in the address range.
  • Zone: States the zone that the address range is bound to (if applicable).
  • Target resource: States the VPC that the address range is bound to in the previous zone (if applicable).

Viewing public address ranges from the CLI

To view public address ranges from the command line, follow these steps:

  1. Set up your CLI environment.

  2. Log in to your CLI environments. After you enter the password, the system prompts which account and region that you want to use:

    ibmcloud login --sso
    
  3. Run the following command:

    ibmcloud is public-address-range PUBLIC_ADDRESS_RANGE [--output JSON] [-q, --quiet]
    

    Where:

    PUBLIC_ADDRESS_RANGE
    The ID or name of the public address range to view.
    --output
    The output format, only JSON is supported. One of: JSON.
    -q, --quiet
    Suppress verbose output.

Command examples

View the public address range $par-id:

ibmcloud is public-address-range $par-id

View all public address ranges:

ibmcloud is public-address-ranges

Viewing public address ranges with the API

Before you begin, set up your API environment.

Select one of the following options:

  • View all public address ranges for an account:

    curl -sX GET \
             "$vpc_api_endpoint/v1/public_address_ranges?version=$api_version&generation=2" \
             -H "Authorization: Bearer $iam_token"
    
  • View a specific public address range:

    curl -sX GET \
             "$vpc_api_endpoint/v1/public_address_ranges/$par_id?version=$api_version&generation=2" \
             -H "Authorization: Bearer $iam_token"
    

Viewing public address ranges with Terraform

To view a public address range with Terraform, use the following example:


data "ibm_is_public_address_range" "public_address_range_instance" {
  name = "example-public-address-range"
}
data "ibm_is_public_address_range" "public_address_range_instance1" {
  # name = "example-public-address-range"
  identifier =  ibm_is_public_address_range.public_address_range_instance.id
}

To get a list of public address ranges:

data "ibm_is_public_address_ranges" "public_address_range_instances_example_testing" {
}

Next steps