今回は、指定したEIPを自分自身(EC2)に付け替えるPHPスクリプトを紹介します。 #!/usr/bin/php require_once("/opt/aws/php/default/sdk.class.php"); define("EIP", "xxx.xxx.xxx.xxx"); $ec2 = new AmazonEC2(array( "key" => "ACCESS KEY", "secret" => "SECRET KEY" )); $ec2->set_region(AmazonEC2::REGION_APAC_NE1); $response = $ec2->disassociate_address(EIP); if(!$response->isOK()) { error_log("[" . $response->body->Errors->Error->Code . "] "
![EIPを付け替えるPHPスクリプト | iret.media](https://cdn-ak-scissors.b.st-hatena.com/image/square/377a9c51a86d20c871561f0ba1caf65409e4f7f2/height=288;version=1;width=512/https%3A%2F%2Firet.media%2Fwp-content%2Fthemes%2Fclp_media%2Fimg%2Fcommon%2Fogp-thumbnail_1200x630.png%3F135792468)