diff --git a/moto/ec2/models/instances.py b/moto/ec2/models/instances.py index 530d8097d..8ae642c44 100644 --- a/moto/ec2/models/instances.py +++ b/moto/ec2/models/instances.py @@ -111,6 +111,7 @@ class Instance(TaggedEC2Resource, BotoInstance, CloudFormationModel): self.instance_type: str = kwargs.get("instance_type", "m1.small") self.region_name = kwargs.get("region_name", "us-east-1") placement = kwargs.get("placement", None) + self.placement_hostid = kwargs.get("placement_hostid") self.subnet_id = kwargs.get("subnet_id") if not self.subnet_id: self.subnet_id = next( diff --git a/moto/ec2/responses/instances.py b/moto/ec2/responses/instances.py index c1ec8fc92..c3bbf45ee 100644 --- a/moto/ec2/responses/instances.py +++ b/moto/ec2/responses/instances.py @@ -61,6 +61,7 @@ class InstanceResponse(EC2BaseResponse): "instance_type": self._get_param("InstanceType", if_none="m1.small"), "is_instance_type_default": not self._get_param("InstanceType"), "placement": self._get_param("Placement.AvailabilityZone"), + "placement_hostid": self._get_param("Placement.HostId"), "region_name": self.region, "subnet_id": self._get_param("SubnetId"), "owner_id": owner_id, @@ -470,6 +471,7 @@ EC2_RUN_INSTANCES = """