A mock endpoint of Amazon EC2 for testing
$ gem install fake_ec2
$ fake_ec2_server -p 4567
require 'aws-sdk'
ec2 = AWS::EC2.new(
access_key_id: 'AAA',
secret_access_key: 'BBB',
ec2_endpoint: '0.0.0.0:4567',
ec2_port: 80,
use_ssl: false
)
# RunInstances
ec2.instances.create( count: 2, ... )
)
# => [<AWS::EC2::Instance id:i-e61c02eb>, <AWS::EC2::Instance id:i-aa463e98>]
# DescribeInstances
ec2.instances.to_a
# => [<AWS::EC2::Instance id:i-e61c02eb>, <AWS::EC2::Instance id:i-aa463e98>]
require 'aws-sdk'
require 'fake_ec2'
ec2 = AWS::EC2.new(
http_handler: FakeEc2::HttpHandler.new
)
ec2.instances.create( count: 2, ... )
ec2.instances.to_a
# => [<AWS::EC2::Instance id:i-e61c02eb>, <AWS::EC2::Instance id:i-aa463e98>]
- RunInstances
- DescribeInstances
- CreateTags
- DescribeTags