Add a class level store in models/VPCBackend of ec2
for saving vpcs of all regions info. Any instance can correctly find vpc in another region
when connecting vpc of cross-region or vpc of same region.
Modify vpc_peering_connections in ec2/responses to handle
vpc peering of same region or cross region.
Update vpc_peering_connections response
template content to latest (2016-11-15) .
Add vpc cross region peering successful test case.
Add vpc cross region peering fail test case.
Related: https://github.com/spulec/moto/issues/1830
Reference
CreateVpcPeeringConnection Sample Response
https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateVpcPeeringConnection.html
* Enable Extended CIDR Associations on VPC
* Ooops missed the utils, try to be more flakey?, remove unnecessary part in tests
* try to be even more flakey
* Delete the volume used during AMI creation
Creating an AMI doesn't actually result in the creation of an EBS
volume, although the associated snapshot does reference one. To that
end, delete the volume once we've used it.
* Add `owner_id` to `Snapshot`, verify AMI snapshots
The default AMIs which are created by moto have EBS volume mappings
but the snapshots associated with those don't have the correct
owners set.
This adds the owner to the snapshot model and passes it through from
the JSON data.
The logic which contructed a list of values for parameters with
multiple values was flawed in that e.g. `Subnet.1` and `Subnet.10`
would be have their values counted against `Subnet.1` because they
share a prefix.
This now checks for a starting `.` before counting that name as
having the requested prefix.
The AWS docs say that: "Currently, the resource types that support
tagging on creation are instance and volume." Calling `create_volume`
and passing `image` as the resource type in tag specifications causes
an `InvalidParameterValue` error.
- missing and malformed image ids
- test_ami_filters
- test_ami_copy tests
- test_ami_create_and_delete test
- test_ami_filter_wildcard test
- the rest of the tests by using the non-deprecated mock_ec2
In trying to debug changes to the ami mock introduced in 1.1.25,
I noticed that the ami tests were not running. Turns out that nose does not
run test files that are executable.
http://nose.readthedocs.io/en/latest/finding_tests.html
The ami test file was the only test file I could find that had the executable bit set.
* Adding owner-id/OwnerId to the AMI classes to allow the value to be specified to test filtering images based on owner.
* Added default AMIs and filtering by owner-id
* Fixed some tests
* Fixed more random tests
* Updated MANIFEST
* .
* add private-dns-name to filter_dict_attribute_mapping
* add region_name attribute to Instance and InstanceResponse
* set dns name based on region
* test private-dns-name and network-interface.private-dns-name filters. checking both regional dns formats
* update test_ec2_classic_has_public_ip_address to use correct dns values
Boto can be configured with extra regions, but moto will fail to import
if they are not in the hardcoded list in ec2/models.py. Instead, use the
region list from boto to build the ec2_backends dict to ensure all
regions are available.