From d4cbc71b0a1c578340d826a7bfcbf07ec0d763bf Mon Sep 17 00:00:00 2001 From: Joseph Lawson Date: Tue, 21 Oct 2014 16:37:54 -0400 Subject: [PATCH] fix eip physical_resource_id not returning an public_ip if it is in EC2 classic. --- moto/ec2/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moto/ec2/models.py b/moto/ec2/models.py index 6038db09..b7ab1266 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -1964,7 +1964,7 @@ class ElasticAddress(object): @property def physical_resource_id(self): - return self.allocation_id + return self.allocation_id if self.allocation_id else self.public_ip def get_cfn_attribute(self, attribute_name): from moto.cloudformation.exceptions import UnformattedGetAttTemplateException