Search

Get Public IP Address

Articles

Use this function to fetch the Public IP address of an instance from AWS with the given details.

Syntax

Get Public IP Address (access_key, secret_key, location, instance_id)

Parameters

Input Parameter Name Description
access_key AWS access_key_ID of the user
secret_key AWS Secret_access_key of the user
location Location of the machine to be hosted
instance_id Instance is ec2

To know more about access_key and secret_key, click here.

Returns

Return Value Description
Output
  • On Success returns 1 | Public IP Address
  • On Failure returns 0 | Error Message

Sample

Get Public IP Address (XYZ, ABC, us-east-2, ec2)

  • Uses the access key XYZ and the secret key ABC to login to AWS, gets the public IP address of the instance ec2 in the location us-east-2.
    Returns the Public IP Address of the instance.

To view all the AWS functions, click here.

Did you find what you were looking for?