Commit Graph

3728 Commits

Author SHA1 Message Date
acsbendi
55f9040296 Fixed old unit tests in test_iam that didn't use valid IAM policies. 2019-06-30 17:57:50 +02:00
acsbendi
4748c6b073 Enabled validating policies for all operations similar to CreatePolicy. 2019-06-30 17:35:26 +02:00
acsbendi
ef20b47f97 Implemented checking policy documents for syntax errors. 2019-06-30 17:09:55 +02:00
acsbendi
99336cbe6a Reorganized tests using a generator method and fixed error messages. 2019-06-30 17:04:02 +02:00
acsbendi
896f7b6eb2 Added more tests. 2019-06-30 16:36:49 +02:00
acsbendi
a4b850aab9 Added test cases for mutually exclusive elements. 2019-06-30 14:03:18 +02:00
acsbendi
f0e9ea4e72 Created tests for policy documents. 2019-06-30 13:47:17 +02:00
Don Kuntz
df493ea18d Add glue.batch_delete_table, and fix glue.batch_create_partition to respond correctly (#2233)
* Fix glue.batch_create_partition to only respond with Errors if Errors occurred

* Add glue.batch_delete_table endpoint

* Remove unused variable
2019-06-10 20:14:30 +01:00
Bendegúz Ács
ab8a189bbf Fixed policy version's Document type for AWS managed policies (#2234)
* Added checking Document's type in AWS managed policy version response.

* Fixed policy version's Document type for AWS managed policies.
2019-06-10 20:00:37 +01:00
Don Kuntz
3833449b36 Add batch_create_partition endpoint to Glue client (#2232)
* Add batch_create_partition endpoint to Glue client

* Remove exception as e from glue batch_create_partition, because it's unused
2019-06-07 09:28:10 +01:00
Bendegúz Ács
97ab7fd307 Fixes for get_policy and get_policy_version with AWS managed policies (#2231)
* Created test for get_policy with AWS managed policy.

* Created failing test for get_policy_version with AWS managed policy.

* Updated AWS managed policies.

* Fixed failing tests.

* Fixed trying to compare datetime with string in test case.

* Fixed CreateDate of AWS managed policies overwritten by their version's CreateDate.

* Fixed and improved tests for managed AWS policies.

* Added test for AWS managed policy with v4 default version.

* Fixed not correctly returning dates for AWS managed policies.
2019-06-06 13:36:39 +01:00
Juan Martinez
ed93821621 Set ECR imagePushedAt to current date and time (#2229) 2019-06-06 13:34:10 +01:00
Pall Valmundsson
d25a7ff936 Uniform IAM datetime ISO 8601 handling (#2169)
`str(datetime.utcnow())` returns a timestamp that's not of the same
format as the AWS SDK uses, in short it's missing the `T` between the
date and the time.

This causes issues for e.g. Terraform and probably other AWS Go SDK
users. There seems to be some differences between endpoints whether they
return milliseconds or not, the AWS API docs were reviewed and the
decision whether to return timestamps with milliseconds or not based on
the example response documented.

As the timstamps are generated for uniqueness rather than being
hardcoded and then directly cast to a UTC (Z) formed timestamp pytz was
removed as timezone correctness is probably not important.
2019-06-02 19:18:50 +01:00
Juan Martinez
664b27d8e7 Implement ECR batch_delete_image (#2225)
This implements the endpoint in spulec #2224
2019-05-30 18:16:19 +01:00
Bendegúz Ács
8f53b16b9a Updates to create_subnet and describe_subnets responses (#2053)
* Removed Tags field from create_subnet response.

* Added DefaultForAz to create_subnet response.

* Added MapPublicIpOnLaunch to create_subnet response.

* Added OwnerId to create_subnet response.

* Added AssignIpv6AddressOnCreation field for create_subnet and describe_subnet and implemented setting it in modify_subnet_attribute.

* Added SubnetArn to create_subnet response.

* Added AvailabilityZoneId to create_subnet and describe_subnet responses, and error for invalid availability zone.

* Added Ipv6CidrBlockAssociationSet to create_subnet response.

* Added missing fields to describe_subnets response.

* Added myself to list of contributors and marked describe_subnet as implemented.

* Fixed linting errors.

* Fixed blank line containing a tab.

* Fixed accidentally deleted ).

* Fixed broken tests.
2019-05-28 16:33:25 +01:00
A
2386d47fe3 SecretsManager secret value binary support (#2222) 2019-05-28 16:32:43 +01:00
Bendegúz Ács
21917c4b93 Bug fix for default network ACL entries (#2056)
* Fixed a bug where default network ACL entries could not be deleted.

* Implemented throwing error when a network entry with the same rule number and egress value already exists.

* Fixed syntax errors.

* Added socket.timeout to possibly raised exceptions in wait_for for Python 3.
2019-05-26 02:02:14 +01:00
Alexander Mohr
7271fb9391 Fix S3 backend operations with VersionId (#2055)
* fix s3 issues

* fix merge conflict

* fix and add test cases
2019-05-25 20:19:33 +01:00
Bendegúz Ács
f408709ef9 VPC IPv4 validation (#2026)
* Implemented throwing invalid subnet range error and fixed breaking tests.

* Implemented throwing invalid CIDR block parameter error for vpcs and subnets.

* Implemented throwing invalid destination CIDR block error.

* IPv6 addresses not accepted, strict checking disabled.

* Implemented throwing invalid subnet conflict error and fixed breaking tests.

* Implemented throwing invalid VPC range error and fixed breaking tests.

* Fixed accidentally removed ).

* Fixed test case trying to create two subnets with the same CIDR range.
2019-05-25 18:35:07 +01:00
Garrett
c739c5331e Handle UnicodeEncodeError when parsing querystring (#2170) 2019-05-25 18:34:47 +01:00
Bendegúz Ács
6fb85ac430 Updated implementation coverage for cloudformation (#2139)
* Updated implementation coverage for cloudformation

* Updated cloudformation coverage with recently implemented endpoints
2019-05-25 18:34:29 +01:00
jorge jardines
2d8245d49c Fix small issue in README example (#1804) 2019-05-25 18:32:52 +01:00
Adam Hodges
71f83d7e4f Add support for IoT register_certificate (#1827) 2019-05-25 18:30:23 +01:00
Jordan Sanders
4cce4defac Support CustomAmiId in EMR (#2037) 2019-05-25 11:19:26 +01:00
Gregory Bataille
d952410965 1987 support transfer acceleration (#2018)
* chore(): remove executable flag on moto/s3/response.py

* chore(): ignore .eggs temp file

* feat(#1987): get bucket acceleration support

* feat(#1987): put bucket acceleration support

* feat(#1987): suspend undefined bucket is a no-op

* feat(#1987): validate accelerate_configuration status

* feat(#1987): bucket containing dots do not support acceleration

* doc(#1987): update implementation coverage
2019-05-25 11:19:00 +01:00
William Richard
1b91534165 Add support for redirect actions on ELBv2 listeners (#2029) 2019-05-25 11:18:39 +01:00
David
868d0107bf Autoscaling instance azs (#2030)
* Add instance AZ support in autoscaling

* Resolve py36-py27 format string error in test_autoscaling
2019-05-25 11:18:16 +01:00
Daniel Miranda
fb2a76fd66 ec2: add support for creation and importing of real SSH keys (#2108)
* ec2: add support for creation and importing of real SSH keys

* setup: lock PyYAML version to avoid incompatibilities
2019-05-25 11:17:52 +01:00
Mark Challoner
d8ff67197b Add resource-groups. (#1953) 2019-05-25 11:10:34 +01:00
Don Kuntz
238d1c7c39 Add glue.delete_table endpoint, for allowing tables to be deleted (#2112)
* Add glue.delete_table endpoint, for allowing tables to be deleted

* remove extra whitespace
2019-05-25 10:58:41 +01:00
Jeffery Smith
4a99dcddb2 Issue #2141 Adding owner-id to the filter for Snapshot (#2142)
* Adding owner-id to the filter for Snapshot
2019-05-25 10:34:59 +01:00
Brian Engen
6838d7964f handles empty string in SNS next token (#2177) 2019-05-25 10:24:46 +01:00
Hans
9b12ce6809 Fix #1842 Create cross region VPC peering connection in both region (#2195)
Add a class level store in models/VPCPeeringConnectionBackend of ec2
for saving vpc peering connection.
Any instance can correctly save VPC peering connection info
on both region when it create vpc peering connection.

Update vpc_peering_connections in ec2/responses to meet new version:
DESCRIBE_VPC_PEERING_CONNECTIONS_RESPONSE,
ACCEPT_VPC_PEERING_CONNECTION_RESPONSE,

Previous code only create one region VPC peering connection but
doesn't create the other region VPC peering connection
when create cross region VPC peering connection.

Tested in real AWS environment at first
and create unit test case according to real AWS environment response.

Add 5 test cases
VPC cross region delete case
VPC cross region accept case
VPC cross region accept wrong region case
VPC cross region reject case
VPC cross region reject wrong region case

Related: #1842, #1830
2019-05-25 10:21:57 +01:00
Ashley Gould
a3f6d2c110 [Resolves #2196] - endpoints for querying organizations SC policies (#2197)
adding support for organizations service control policies

* [Resolves #2196] - endpoints for querying organizations SC policies

I have added the following mock endpoints to the Organizations service:

- create_policy
- list_policies
- describe_policy
- attach_policy
- list_policies_for_target
- list_targets_for_policy
2019-05-25 10:20:19 +01:00
Koudai Aono
a61124f774 support to create dynamodb resource by cloudformation (#2219)
* support to create dynamodb resource by cloudformation
2019-05-25 10:16:33 +01:00
Jon Beilke
cb72d1d00e Feature cloudwatch log retention (#2199)
* add proper retentionInDays to describe_log_groups response and add support for delete_retention_policy() and put_retention_policy() to log groups

* fix for inline comment formatting

* include check for retentionInDays to verify no retention by default in  test_log_group_create
2019-05-25 10:14:23 +01:00
Dan Chan
2a5f7e15a7 Updating redshift.describe_cluster_snapshots to return multiple snapshots for cluster_identifier (#2216) 2019-05-23 09:01:47 +01:00
Terry Cain
a6d9cadac3
Change docker library version check (#2214) 2019-05-22 22:01:28 +01:00
Ber Zoidberg
1088c421d2 #2212 add support for delete on update_with_attribute_updates (#2213)
* add support for delete on update_with_attribute_updates
2019-05-22 10:47:02 +01:00
Justin Kieber-King
bbd7fefb37 Feature: Secrets Manager put_secret_value and list_secret_version_ids (#2116)
* initial work

- adding put_secret_value and list_secret_versions

* Added support for versions in all functions except rotate_secret

* more work

- refactor rotate_secret method
  - now, adds a new version of the secret and points default version id to it
- updated implementation coverage readme
- element in list check to fix unit test
- fixed linting errors
- added tests, fixed exception, failing tests still
- secrets_manager/test_server fails when running whole suite,
  but not when running that individual test file

* fixed failing test_get_secret_value

* Removed test.py. Fixed condition statement.

* fixed default stages + adding AWSPREVIOUS

* remove old AWSPREVIOUS stages
2019-05-22 10:45:22 +01:00
cm-iwata
8f4c273095 fix #2190 (#2194)
lambda list_versions_by_function return $LATEST version and published version
2019-05-21 17:49:56 +01:00
sergejs-katusenoks
6628567cbc Fix base64 deprecated methods in kinesis.utils (#2209)
* Fix base64 deprecated methods

Using right encode and decode methods according to python version.

* moved imports on top

E402 module level import not at top of file
2019-05-21 17:47:35 +01:00
James Bungard
796dd71c0c Platform independent KMS timestamp generation (#2193)
* Platform independent KMS timestamp generation

Fixes #2192

* Switch to moto.core.unix_time

Fixes #2192
2019-05-21 17:46:22 +01:00
cm-iwata
9bf8fd3417 fix #2011 (#2012)
add support for Scan method using LSI or GSI
2019-05-21 17:45:30 +01:00
Travis Truman
b8ba7980a0 Adding support for specifying a PermissionsBoundary ARN in calls to i… (#2182)
* Adding support for specifying a PermissionsBoundary ARN in calls to iam.create_role

Closes #2181

* Correcting whitespace error

* Adding support for Role PermissionsBoundary to be returned from
calls to list_roles

* Raise ClientError when a bad permissions boundary ARN is supplied
2019-05-21 17:44:05 +01:00
Craig Anderson
33efe07b43 Hide CloudFormation pararamters with NoEcho. Fixes #2021 (#2024) 2019-05-21 00:05:02 +01:00
Alexey Firsov
f13e4e41cd add implemented kinesis method describe_stream_summary (#2023) 2019-05-21 00:02:36 +01:00
Eliot Alter
e504226386 Fix a warning which was missing a space after the preiod. (#2022) 2019-05-21 00:01:06 +01:00
Jordan
1de9acb7ad Add cognito-idp admin_update_user_attributes #2184 (#2185) 2019-05-20 23:58:10 +01:00
redspart
1fd71fd45a Updated delete_cluster() for redshift (#2186)
* Updated the deprecated decorator to allow the "SkipFinalClusterSnapshot" option that aws supports.

* FIxed logical mistake on the delete_cluster

* Removed an unused exception I put in
2019-05-20 23:56:23 +01:00