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