Commit Graph

1911 Commits

Author SHA1 Message Date
Steve Pulec
cad185c74d Cleanup headers and encoding. 2017-02-16 22:51:04 -05:00
Steve Pulec
468a1b970c Add responses dependencies. 2017-02-15 22:47:33 -05:00
Steve Pulec
678f73389f Fix package being submodule. 2017-02-15 22:45:20 -05:00
Steve Pulec
fde721bed7 Testing new version of decorator. 2017-02-15 22:35:45 -05:00
Steve Pulec
d3df810065 Generalize decorator code. 2017-02-12 00:22:29 -05:00
Steve Pulec
9076e48fee Fix sqs tests region. 2017-02-11 19:50:26 -05:00
Steve Pulec
2d03182ae2 Migrate some sqs tests to boto3. 2017-02-11 19:41:09 -05:00
Jack Danger
53fbd7dca0 KMS encryption under Python 3 (#826)
This upgrades the KMS encrypt and decrypt endpoints to work
under both Python 2 and 3
2017-02-09 22:36:24 -05:00
Joseph Lawson
fd7b8e7c88 install server version of moto for Dockerfile (#824) 2017-02-08 21:30:27 -05:00
David Wilcox
012dd497f2 make get_all_security_groups filter AND match group ids, not OR them (#822) 2017-02-08 21:29:37 -05:00
Jason DeTiberus
1045dca7b2 make instanceTenancy configurable for VPCs (#819)
* make instanceTenancy configurable for VPCs

* fix issue with setting tenenancy
2017-02-08 21:23:49 -05:00
Jeffrey Gelens
8fc1ad03bd Reload the server on a file change (#817)
* Added simple server reload support

* updated help text
2017-02-08 21:22:14 -05:00
Stefan Nordhausen
1a01bae74e Implement list_objects_v2() for S3 buckets (#814)
This adds/fixes the following things:
- Add missing KeyCount in result (fixes #734).
- Do not hard code MaxKeys to 1000.
- Truncate result if it has more than MaxKeys items. Set IsTruncated
    and NextContinuationToken accordingly.
- Support the StartAfter parameter.
- Return Owner information only when FetchOwner=True is given.
- "Prefix" in response is now "" instead of None when omitted in request.
- "Delimiter" is now omitted from response when not given in request.
2017-02-08 21:21:43 -05:00
Steve Pulec
ba7223f046 Fix issue for returning dynamodb floats. Closes #812. 2017-02-08 21:06:05 -05:00
Steve Pulec
4eaf5d527e 0.4.31 2017-01-24 09:48:31 -05:00
Hugo Lopes Tavares
88d5e36ffe Add resource IDs to ECS Cluster and Service models (#811) 2017-01-19 11:59:28 -05:00
Michael Nussbaum
51129f6ef3 Allow ELB policies to be set via Cloudformation. (#809)
Also more closely mirror AWS by not returning ELB
BackendServerDescriptions that don't have policies.

Signed-off-by: Michael Nussbaum <michael.nussbaum@getbraintree.com>
2017-01-18 23:02:04 -05:00
Jesse Szwedko
e1260bca06 cloudformation: Support RoleARN for create and update stack (#807)
Signed-off-by: Andrew Harris <andrew.harris@getbraintree.com>
2017-01-18 22:59:47 -05:00
Jesse Szwedko
f68b2963db sts: Implement get_caller_identity (#806)
Return a canned response

Signed-off-by: Andrew Harris <andrew.harris@getbraintree.com>
2017-01-18 22:59:04 -05:00
Jesse Szwedko
55f39265dd Upgrade to boto 2.45 (#803)
Adds support for additional regions:

* ca-central-1
* eu-west-2

Signed-off-by: Andrew Harris <andrew.harris@getbraintree.com>
2017-01-18 22:55:22 -05:00
Steve Pulec
82bc502cf7 Fix assert_raises for catching parents of exceptions. 2017-01-18 22:46:51 -05:00
Akhter Ali
2bf85fe25d Fix Route53 response and tests (#804)
* Fix route53 response \n Fix route53 tests

* Fixing index

* fix zone ID on test_route53_with_update
2017-01-18 21:40:04 -05:00
costypetrisor
a967ec0d39 made the Security Group backend throw the same error as AWS if the nb of sec groups limit is hit (#742)
* made the Security Group backend throw the same error as AWS if the security group limit is hit

* included in the security group limit the count of grants to other security groups & updated the unit tests to cover these

* refactored a few things about the sec group rule count limit
2017-01-18 21:37:55 -05:00
Jesse Szwedko
d42432bfef IAM: raise error if requiested instance profile does not exist (#802)
Signed-off-by: Andrew Harris <andrew.harris@getbraintree.com>
2017-01-18 21:36:50 -05:00
Steve Pulec
a292150087 Throw exception if same security group rule added twice. Closes #737. 2017-01-11 22:35:27 -05:00
Steve Pulec
6ac8c2b4da Add boto3 standalone example. 2017-01-11 21:33:17 -05:00
Michael Nussbaum
74bbd9c8e5 Various RDS, RDS/Cloudformation, RDS/KMS improvements. (#789)
We need to mock out deploying RDS instances with full disk encryption
and detailed tagging. We also need to be able do deploy these instances
with Cloudformation, and then access them with both boto and boto3.

* Join RDS and RDS2 backends - this makes RDS resources created via
  either of the two boto RDS APIs visible to both, more closely
  mirroring how AWS works
* Fix RDS responses that were returning JSON but should be returning XML
* Add mocking of RDS Cloudformation calls
* Add mocking of RDS full disk encryption with KMS
* Add mocking of RDS DBParameterGroups
* Fix mocking of RDS DBSecurityGroupIngress rules
* Make mocking of RDS OptionGroupOptions more accurate
* Fix mocking of RDS cross-region DB replication
* Add RDS tag support to:
  * DBs
  * DBSubnetGroups
  * DBSecurityGroups

Signed-off-by: Andrew Garrett <andrew.garrett@getbraintree.com>
2017-01-11 21:02:51 -05:00
Steve Pulec
201efd5773 Fix bug with listing IAM users. 2017-01-11 20:54:47 -05:00
Jia Chen
2a02259a3c Adding PolicyType to scaling policy and implementing filtering in describe_policies (#797)
* Adding PolicyType to FakeScalingPolicy

* Implement filtering for AutoScalingBackend.describe_policies(...)

* Unit test for describe_policies fuction in autoscaling
2017-01-11 20:40:57 -05:00
Brian Kruger
f212d70104 Use a sane aws sender_id from SQS. (#791) 2017-01-11 20:38:55 -05:00
Taro Sato
02324ad708 Add more availability regions and implement default VPC (#773)
Fix filter name for availability zone

Fix bug assuming dict keys are ordered

Fix tests

Fix tests

Fix bug
2017-01-11 20:37:57 -05:00
Andrew Garrett
231d3cadcb Fix the CloudFormation ValidationError message (#788)
It should be a string, not a tuple, and it has a different form.
I'm not sure if it used to be different, but in the most recent
boto3/botocore, the message is "Stack with id {id} does not exist"

```python
>>> cf = boto3.client('cloudformation', region_name='us-west-2')
>>> try:
...     cf.describe_stacks(StackName='adfgfhghg')
... except botocore.exceptions.ClientError as e:
...     print e.response['Error']['Message']
...
Stack with id adfgfhghg does not exist
```

I am on boto3 1.4.2 and botocore 1.4.82 as of this commit message.
2017-01-11 20:36:45 -05:00
Raghavendra D Prabhu
d07c646032 sqs: Use unix_time in place of time.time() (#787)
unix_time() from moto.core.utils is used as the time source through moto,
and it is identical to time.time() in output. Hence, using unix_time()
since it makes mocking easier during testing (when time is mocked out).
2017-01-11 20:35:56 -05:00
Hugo Lopes Tavares
b5ff3345be Add service ARNs support to the DescribeServices ECS API (#796) 2016-12-20 10:37:49 -05:00
Hugo Lopes Tavares
0115267f2a Add ECS CloudFormation support (#795)
* Add cloudformation support to AWS::ECS::Cluster

* Add CloudFormation support to AWS::ECS::TaskDefinition

* Add CloudFormation support to AWS::ECS::Service

* Add support to update AWS::ECS::Cluster through CloudFormation

* Fix Cluster.update_from_cloudformation_json to return original_resource if nothing changed

* Implement TaskDefinition.update_from_cloudformation_json

* Implement Service.update_from_cloudformation_json
2016-12-20 10:37:18 -05:00
Steve Pulec
a20906ff15 Merge branch 'SectorNine50-mock-cloudwatch-events' 2016-12-03 19:40:49 -05:00
Steve Pulec
a39f30ad18 Fix merge conflicts. 2016-12-03 19:40:39 -05:00
Steve Pulec
2c6a967f45 Disable strict_slashes for Flask so that S3 works in server mode. 2016-12-03 18:59:28 -05:00
Rob Walker
ed0e81fc61 Fixup lambda for ResponseRequest (#781)
* Fixup lambda for ResponseRequest

* one day will get this right
2016-12-03 18:17:15 -05:00
mfranke
5dc8e59fab Fix s3bucket_path (#784)
* check HTTP header for IPv4 or IPv6 addresses and default to path based S3

* improved IPv4 and IPv6 checking with optional ports

* typo

* subdomain bucket creation with trailing '/' did not work

* Use regex for Host field check to determine IPv4/IPv6

* add testcases for trailing slash, IPv4 and IPv6
2016-12-03 18:15:24 -05:00
Tom V
c54985a39f Fix for #748. Turn on autoescape for S3 templates. (#779) 2016-12-03 18:13:24 -05:00
Paul Cieslar
ee8e72766a Support for ecs describe_task_definition (#777)
* describe_task_definition support

* Refactor fetch_task_definition

* Add ECS Descriptors  (#772)

* Add support for "DescribeServices" in ecs mock

* Add support for "DescribeTaskDefinition" in ecs

* Let ecs responses handle baseobject for services

* Update Cloudformation/parsing#load_parameters to split commadelimitedlists into lists (#774)

* Fix JSON dump error in ecs.update_service with task_definition (#775)

* Fix s3bucketpath handling for IP based requests (#765)

* check HTTP header for IPv4 or IPv6 addresses and default to path based S3

* improved IPv4 and IPv6 checking with optional ports

* typo

* Freezetime.

* Add S3 ACL for aws-exec-read. Closes #740.

* Fixed time formatting in ec2/models.py (#778)

* Fixed time formatting in ec2/models.py

* Used freezegun on test that was failing due to time progression causing timestamp differences.

* rename duplicate rds/models db_instance_identifier to physical_resource_id (#776)

* rename duplicate db_instance_identifier to physical_resource_id

* Update create_from_cloudformation_json to use db_source_identifier str

* Update code to be more conventional.

* describe_task_definition support

* Refactor fetch_task_definition
2016-12-03 18:12:22 -05:00
Justin Wiley
24fdf5b6fe Added myself as a contributor. :P 2016-12-01 20:02:54 -08:00
Justin Wiley
c7757f953c Can't iterate over dict values in Python 3.3+. Changed Rule.targets from a dict to an array, which is probably better anyway since the dict doesn't maintain order, making API calls with the Limit parameter specified unreliable. 2016-12-01 19:52:00 -08:00
Justin Wiley
5d7a102e4c Stoopid import was still hanging around. 2016-12-01 19:24:40 -08:00
Justin Wiley
6c85a85e0d Removed OrderedDicts for 2.6 and dict.iteritems() calls for 3.3+ compatibility. 2016-12-01 19:10:59 -08:00
Justin Wiley
db0b494b4f Completed the CloudWatch Events mocking module and tests. 2016-12-01 17:23:51 -08:00
Justin Wiley
d0def03c4c Events models first draft done, need to write tests, then get responses going. 2016-11-30 17:09:58 -08:00
Justin Wiley
d0a66f2dff Begin work on mocking CloudWatch Events. 2016-11-29 17:19:26 -08:00
David Wilcox
c3c6eaf281 rename duplicate rds/models db_instance_identifier to physical_resource_id (#776)
* rename duplicate db_instance_identifier to physical_resource_id

* Update create_from_cloudformation_json to use db_source_identifier str

* Update code to be more conventional.
2016-11-23 20:07:26 -06:00