-
Notifications
You must be signed in to change notification settings - Fork 27
Technical Specifications
aws-mock is a language-agnostic Java web application that can be run in any standard servlet container.
It's function is to replicate AWS instances (mocks) that you can use to automatically and quickly test your instances, endpoints and interfaces.
Since all of Amazon's web services expose their API over http protocol, and they provide WSDL for each service, aws-mock' runs separate servlets as mocks of different AWS endpoints. At the time of writing only EC2 is implemented.
Fully compliant with the official WSDL, aws-mock is compatible with AWS' official SDKs, and can be made compatible with command-line tools and other clients.
Aws-mock is developed on top of a component called cxf-stub - a Java port of request/response data structure defined in WSDL, done by "wsdl2java" tool from Apache CXF.
The work flow of aws-mock is as follows:
For a single Query Request from a client, the servlet parses all parameters and picks suitable routes of core logic doing the mock on the server.
It internally organizes a response object with the class provided by cxf-stub and then uses a marshaller to produce an XML body which the client recognizes.
With aws-mock, modular mocking and automated testing are incredibly easy with the use of generic components ready for use (cxf-stub, query parser, marshaller etc).
All the implemented interfaces belong to a small essential subset of Amazon Web Services.
We have implemented mock EC2 web service endpoint with the following reqeuest/response:
Interface | Query Params | Data in Response |
---|---|---|
DescribeImages | Version |
(Per AMI) ImageId |
RunInstances |
ImageId InstanceType MinCount MaxCount Version |
(Per Instance) InstanceId ImageId InstanceType InstanceState DnsName Placement |
DescribeInstances |
InstanceId.x Version MaxResults NextToken |
NextToken (Per Reservation) ReservationId OwnerId GroupSet +(Per Instance) Version InstanceId ImageId InstanceType InstanceState DnsName Placement |
StartInstances |
InstanceId.x Version |
RequestId (Per InstanceStateChange) InstanceId PreviousState CurrentState |
StopInstances | ||
TerminateInstances | ||
DescribeRouteTables | Version |
RequestId (Per RouteTable) VpcId RouteTableId AssociationSet |
DescribeInternetGateways | Version |
(Per InternetGateway) InternetGatewayId |
DescribeSecurityGroups | Version |
RequestId (Per SecurityGroup) OwnerId GroupName GroupId VpcId IpPermissionSet FromPort ToPort IpProtocol |
DescribeVpcs | Version |
RequestId (Per VPC) VpcId VpcState CidrBlock IsDefault |
DescribeVolumes | Version |
RequestId (Per VolumesSetItem) VolumeId VolumeType Size AvailabilityZone Status +(Per attachmentSetItem) VolumeId InstanceId Device Status |
DescribeSubnets | Version |
RequestId (Per Subnet) SubnetId State VpcId AvailableIpAddressCount AvailabilityZone DefaultForAz MapPublicIpOnLaunch |
(Unimplemented Interface) |
Error Code Error Message |
All the implemented interfaces belong to a small essential subset of Amazon Web Services.
We have implemented mock Cloudwatch web service endpoint with the following reqeuest/response:
Interface | Query Params | Data in Response |
---|---|---|
GetMetricStatistics |
StartTime EndTime NameSpace Metric Name Statistics (Average, Sample Count) Collection Dimensions |
Metric Name Collection datapoints. |