Describes the specified instances or all instances.
If you specify instance IDs, the output includes information for only the specified
instances. If you specify filters, the output includes information for only those
instances that meet the filter criteria. If you do not specify instance IDs or filters,
the output includes information for all instances, which can affect performance. We
recommend that you use pagination to ensure that the operation returns quickly and
successfully.
If you specify an instance ID that is not valid, an error is returned. If you specify
an instance that you do not own, it is not included in the output.
Recently terminated instances might appear in the returned results. This interval is
usually less than one hour.
If you describe instances in the rare case where an Availability Zone is experiencing
a service disruption and you specify instance IDs that are in the affected zone, or do
not specify any instance IDs at all, the call fails. If you describe instances and
specify only instance IDs that are in an unaffected zone, the call works
normally.
example
Use a bare-bones client and the command you need to make an API call.
Describes the specified instances or all instances.
If you specify instance IDs, the output includes information for only the specified instances. If you specify filters, the output includes information for only those instances that meet the filter criteria. If you do not specify instance IDs or filters, the output includes information for all instances, which can affect performance. We recommend that you use pagination to ensure that the operation returns quickly and successfully.
If you specify an instance ID that is not valid, an error is returned. If you specify an instance that you do not own, it is not included in the output.
Recently terminated instances might appear in the returned results. This interval is usually less than one hour.
If you describe instances in the rare case where an Availability Zone is experiencing a service disruption and you specify instance IDs that are in the affected zone, or do not specify any instance IDs at all, the call fails. If you describe instances and specify only instance IDs that are in an unaffected zone, the call works normally.
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, DescribeInstancesCommand } from "@aws-sdk/client-ec2"; // ES Modules import // const { EC2Client, DescribeInstancesCommand } = require("@aws-sdk/client-ec2"); // CommonJS import const client = new EC2Client(config); const command = new DescribeInstancesCommand(input); const response = await client.send(command);
DescribeInstancesCommandInput for command's
input
shape.DescribeInstancesCommandOutput for command's
response
shape.config for EC2Client's
config
shape.