Get details for a specific EC2 instance. Args: instance_id: The ID of the instance. Returns: Instance details. Raises: ResourceNotFoundError: If the instance does not exist.
(self, instance_id: str)
| 87 | |
| 88 | @aws_operation("get_instance") |
| 89 | def get_instance(self, instance_id: str) -> Dict[str, Any]: |
| 90 | """ |
| 91 | Get details for a specific EC2 instance. |
| 92 | |
| 93 | Args: |
| 94 | instance_id: The ID of the instance. |
| 95 | |
| 96 | Returns: |
| 97 | Instance details. |
| 98 | |
| 99 | Raises: |
| 100 | ResourceNotFoundError: If the instance does not exist. |
| 101 | """ |
| 102 | instances = self.list_instances(instance_ids=[instance_id]) |
| 103 | if not instances: |
| 104 | raise ResourceNotFoundError(f"Instance {instance_id} not found") |
| 105 | return instances[0] |
| 106 | |
| 107 | @aws_operation("create_instance") |
| 108 | def create_instance( |