aws opsworks associate-elastic-ip fails

0

I'm trying to allocate an elastic IP to an existing instance in ap-southeast-2 (Sydney) using this command: aws opsworks --profile COMPANY --region ap-southeast-2 associate-elastic-ip --instance-id $IID --elastic-ip $EIP and it fails with this error message: An error occurred (ResourceNotFoundException) when calling the AssociateElasticIp operation: Unable to find elastic ip with ID 999.999.999.999

I'm running this on Linux from the CLI. I export the instance id and the elastic IP to the 2 variables and i've verified that they exist and are available. I've also verified that the --profile is valid as I can run the aws ec2 describe-addresses using that profile id. I've also tried using the actual IP instead of the variable and it gives the same error.

Any insight? This seems to be a very simple command but I can't make it work. Thanks.

JL
已提问 10 个月前248 查看次数
2 回答
0
已接受的回答

I get the same error in the same region, and I'm wondering if it's because I'm trying it with a brand new instance that isn't registered with an OpsWorks stack (and I'm not able to register a new stack because OpsWorks is EOL https://docs.aws.amazon.com/opsworks/latest/userguide/stacks-eol-faqs.html ).

Is your instance registered to an existing OpsWorks stack?

Using aws ec2 rather than aws opsworks is fine using the same instance and EIP, but I'm guessing you have a good reason for wanting to use OpsWorks.

$ aws opsworks --region ap-southeast-2 associate-elastic-ip --instance-id i-0635149fxyzxyzxyz --elastic-ip 13.x.y.z

An error occurred (ResourceNotFoundException) when calling the AssociateElasticIp operation: Unable to find elastic ip with ID 13.x.y.z
$ aws ec2 associate-address --region ap-southeast-2 --instance-id i-0635149fxyzxyzxyz --public-ip 13.x.y.z
{
    "AssociationId": "eipassoc-0f5ceba5xyzxyzxyz"
}
$
profile picture
专家
Steve_M
已回答 10 个月前
0

Steve, While you didn't solve the opsworks problem, you did show me that I overlooked the obvious solution in ec2 associate-address. So thanks very much.

jon

JL
已回答 10 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则