AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Module: Aws::EC2

Defined in:


This module provides a client for making API requests to Amazon Elastic Compute Cloud.


The Client class provides one-to-one mapping for each API operation.

ec2 = 'us-east-1')
#=> [:accept_reserved_instances_exchange_quote, :accept_transit_gateway_peering_attachment, :accept_transit_gateway_vpc_attachment, :accept_vpc_endpoint_connections, ...]

Each API operation method accepts a hash of request parameters and returns a response object.

resp = ec2.accept_reserved_instances_exchange_quote(params)

See Client for more information.


Errors returned from Amazon Elastic Compute Cloud are defined in the Errors module and extend Errors::ServiceError.

  # do stuff
rescue Aws::EC2::Errors::ServiceError
  # rescues all errors returned by Amazon Elastic Compute Cloud

See Errors for more information.

Defined Under Namespace

Modules: Errors, Types Classes: ClassicAddress, Client, DhcpOptions, Image, Instance, InternetGateway, KeyPair, KeyPairInfo, NatGateway, NetworkAcl, NetworkInterface, NetworkInterfaceAssociation, PlacementGroup, Resource, Route, RouteTable, RouteTableAssociation, SecurityGroup, Snapshot, Subnet, Tag, Volume, Vpc, VpcAddress, VpcPeeringConnection