Skip to content

describe_addresses

describe_addresses(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    public_ips: Optional[PublicIpStringList] = None,
    dry_run: Optional[Boolean] = None,
    filters: Optional[FilterList] = None,
    allocation_ids: Optional[AllocationIdList] = None,
) -> DescribeAddressesResult

Describes the specified Elastic IP addresses or all of your Elastic IP addresses.

Parameters:

  • public_ips (Optional[PublicIpStringList], default: None ) –

    One or more Elastic IP addresses.

    Default: Describes all your Elastic IP addresses.

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • filters (Optional[FilterList], default: None ) –

    One or more filters. Filter names and values are case-sensitive.

    • allocation-id - The allocation ID for the address.

    • association-id - The association ID for the address.

    • instance-id - The ID of the instance the address is associated with, if any.

    • network-border-group - A unique set of Availability Zones, Local Zones, or Wavelength Zones from where Amazon Web Services advertises IP addresses.

    • network-interface-id - The ID of the network interface that the address is associated with, if any.

    • network-interface-owner-id - The Amazon Web Services account ID of the owner.

    • private-ip-address - The private IP address associated with the Elastic IP address.

    • public-ip - The Elastic IP address, or the carrier IP address.

    • tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    • tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

  • allocation_ids (Optional[AllocationIdList], default: None ) –

    Information about the allocation IDs.

Raises:

Examples:

To describe your Elastic IP addresses This example describes your Elastic IP addresses.

>>> client.describe_addresses()
Source code in docs_src/capo_ec2/_services/ec2.py
def describe_addresses(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    public_ips: Optional[
        "capo_ec2.types.public_ip_string_list.PublicIpStringList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    allocation_ids: Optional[
        "capo_ec2.types.allocation_id_list.AllocationIdList"
    ] = None,
) -> "capo_ec2.types.describe_addresses_result.DescribeAddressesResult":
    """<p>Describes the specified Elastic IP addresses or all of your Elastic IP addresses.</p>

    Args:
        public_ips: <p>One or more Elastic IP addresses.</p> <p>Default: Describes all your Elastic IP addresses.</p>
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        filters: <p>One or more filters. Filter names and values are case-sensitive.</p> <ul> <li> <p> <code>allocation-id</code> - The allocation ID for the address.</p> </li> <li> <p> <code>association-id</code> - The association ID for the address.</p> </li> <li> <p> <code>instance-id</code> - The ID of the instance the address is associated with, if any.</p> </li> <li> <p> <code>network-border-group</code> - A unique set of Availability Zones, Local Zones, or Wavelength Zones from where Amazon Web Services advertises IP addresses. </p> </li> <li> <p> <code>network-interface-id</code> - The ID of the network interface that the address is associated with, if any.</p> </li> <li> <p> <code>network-interface-owner-id</code> - The Amazon Web Services account ID of the owner.</p> </li> <li> <p> <code>private-ip-address</code> - The private IP address associated with the Elastic IP address.</p> </li> <li> <p> <code>public-ip</code> - The Elastic IP address, or the carrier IP address.</p> </li> <li> <p> <code>tag</code>:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p> </li> <li> <p> <code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p> </li> </ul>
        allocation_ids: <p>Information about the allocation IDs.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe your Elastic IP addresses
        This example describes your Elastic IP addresses.

        >>> client.describe_addresses()
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_addresses_request.DescribeAddressesRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_addresses_result.DescribeAddressesResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_addresses

        output, http_response = (
            capo_ec2._operations.amazon_ec2.describe_addresses.describe_addresses(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeAddresses")
    )
    input_: capo_ec2.types.describe_addresses_request.DescribeAddressesRequest = {}
    if public_ips is not None:
        input_["public_ips"] = public_ips
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if filters is not None:
        input_["filters"] = filters
    if allocation_ids is not None:
        input_["allocation_ids"] = allocation_ids

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output