Recovering an Elastic IP address
An Elastic IP address is a static IPv4 address designed for dynamic cloud computing. By using an Elastic IP address, you can mask the failure of an instance or software by rapidly remapping the address to another instance in your account. An Elastic IP address is allocated to your AWS account and is yours until you release it. If you have released your Elastic IP address, you might be able to recover it. The following rules apply:
You cannot recover an Elastic IP address if it has been allocated to another AWS account, or if it will result in your exceeding your Elastic IP address limit.
You cannot recover tags associated with an Elastic IP address.
You can recover an Elastic IP address using the Amazon EC2 API or a command-line tool only.
Recovering an Elastic IP address with AWS CLI
You need to install the AWS Command Line Interface (CLI).
1. For the latest version of the AWS CLI, use the following command block:
2. Confirm the installation.
3. Type aws configure and press enter. Enter the following when prompted:
4. Use the allocate-address AWS CLI command and specify the IP address using the --address parameter as follows.
Recovering an Elastic IP address with PowerShell
You need to install AWS Tools for PowerShell on computers that are running Windows with Windows PowerShell 5.1, or PowerShell Core 6.0 or later.
1. Start a PowerShell session. We recommend that you don't run PowerShell as an administrator with elevated permissions except when required by the task at hand. This is because of the potential security risk and is inconsistent with the principle of least privilege.
2. To install the modularized AWS.Tools package, run the following command.
If you are notified that the repository is "untrusted", it asks you if you want to install anyway. Enter y to allow PowerShell to install the module. To avoid the prompt and install the module without trusting the repository, you can run the command with the -Force parameter.
3. You can now install the module for each AWS service that you want to use by using the Install-AWSToolsModule cmdlet. For example, the following command installs the IAM module. This command also installs any dependent modules that are required for the specified module to work. For example, when you install your first AWS.Tools service module, it also installs AWS.Tools.Common. This is a shared module required by all AWS service modules. It also removes older versions of the modules, and updates other modules to the same newer version.
4. To add a new profile to the AWS SDK store, run the command Set-AWSCredential. It stores your access key and secret key in your default credentials file under the profile name you specify.
-AccessKey– The access key ID.
-SecretKey– The secret key.
-StoreAs– The profile name, which must be unique. To specify the default profile, use the name default.
5. Use the New-EC2Address AWS Tools for Windows PowerShell command and specify the IP address using the -Address parameter as follows.
Last updated
Was this helpful?