Commit Graph

125 Commits

Author SHA1 Message Date
tungol
55c589072f
Admin: sorting imports with ruff (#7075) 2023-11-30 14:55:51 -01:00
Bert Blommers
8aafbdb58f
Techdebt: Streamline AWSLambda/Docker tests (#6735) 2023-08-31 06:47:49 +00:00
Bert Blommers
d98d8cf0d5
Techdebt: Replace sure with regular asserts in CF (#6481) 2023-07-04 15:53:58 +00:00
jeremyrobertson
5de95f4d02
Identitystore - Partial implementation (#6411) 2023-06-21 09:49:49 +00:00
Jonathan Bell
491f26f37a
SSM: Implement physical_resource_id property (#6370) 2023-06-07 09:48:06 +00:00
Jordan Sanders
e3244a9678
CloudFormation: Support Retain DeletionPolicy in stacks (#6115) 2023-03-24 10:39:02 -01:00
Hans Donner
18ec0c5467
Techdebt: skip tests when docker is not running (#6026) 2023-03-12 15:54:50 -01:00
Bert Blommers
1a8ddc0f2b
Techdebt: Replace string-format with f-strings (for tests dirs) (#5678) 2022-11-17 21:41:08 -01:00
Ninh Khong
37a127acd5
CloudFormation: Add actions for ssm parameter (#3256) 2022-11-05 10:06:12 -01:00
Bert Blommers
3d913f8f15
MultiAccount support (#5192) 2022-08-13 09:49:43 +00:00
Sahil Shah
40eefb92d7
Add AWS::AutoScaling::ScheduledAction action cloudformation support (#5289) 2022-07-25 19:37:22 -03:00
Bert Blommers
5d84eec79e
Enable more TF tests (#5148) 2022-05-19 11:08:02 +00:00
Bert Blommers
47ce689cb7
ELB/ELBv2 improvements (#4956) 2022-03-21 19:55:19 -01:00
Bert Blommers
382ff2b1a9
Remove more DynamoDB2 references (#4933) 2022-03-11 21:29:16 -01:00
Bert Blommers
29d01c35bc
Update Black + formatting (#4926) 2022-03-10 13:39:59 -01:00
Bert Blommers
aa70ee254d
Remove deprecated decorators + boto dependency (#4378) 2022-01-18 14:18:57 -01:00
Bert Blommers
f923d0d1e0
Feature: Custom cloudformation resources (#4512) 2021-11-03 20:00:42 -01:00
Bert Blommers
14a69c7524
Techdebt: Enable pylint rules (#4432) 2021-10-18 19:44:29 +00:00
nom3ad
0953c11b92
feat(cloudformation): support logs resource policy (#4427) 2021-10-18 09:17:31 +00:00
Bert Blommers
dac33becbf
SNS:Topic: Add option to update/delete via CF (#4392) 2021-10-11 21:56:39 +00:00
Bert Blommers
e9a4100324
Rewrite deprecated CloudFormation tests (#3842) 2021-10-04 13:47:40 +00:00
Bert Blommers
1a42b33781
IAM - Delete Role/InstanceProfile via CloudFormation (#3591) 2021-08-28 11:00:05 +01:00
Waldemar Hummer
f4f8527955
Merge LocalStack changes into upstream moto (#4082)
* fix OPTIONS requests on non-existing API GW integrations

* add cloudformation models for API Gateway deployments

* bump version

* add backdoor to return CloudWatch metrics

* Updating implementation coverage

* Updating implementation coverage

* add cloudformation models for API Gateway deployments

* Updating implementation coverage

* Updating implementation coverage

* Implemented get-caller-identity returning real data depending on the access key used.

* bump version

* minor fixes

* fix Number data_type for SQS message attribute

* fix handling of encoding errors

* bump version

* make CF stack queryable before starting to initialize its resources

* bump version

* fix integration_method for API GW method integrations

* fix undefined status in CF FakeStack

* Fix apigateway issues with terraform v0.12.21
* resource_methods -> add handle for "DELETE" method
* integrations -> fix issue that "httpMethod" wasn't included in body request (this value was set as the value from refer method resource)

* bump version

* Fix setting http method for API gateway integrations (#6)

* bump version

* remove duplicate methods

* add storage class to S3 Key when completing multipart upload (#7)

* fix SQS performance issues; bump version

* add pagination to SecretsManager list-secrets (#9)

* fix default parameter groups in RDS

* fix adding S3 metadata headers with names containing dots (#13)

* Updating implementation coverage

* Updating implementation coverage

* add cloudformation models for API Gateway deployments

* Updating implementation coverage

* Updating implementation coverage

* Implemented get-caller-identity returning real data depending on the access key used.

* make CF stack queryable before starting to initialize its resources

* bump version

* remove duplicate methods

* fix adding S3 metadata headers with names containing dots (#13)

* Update amis.json to support EKS AMI mocks (#15)

* fix PascalCase for boolean value in ListMultipartUploads response (#17); fix _get_multi_param to parse nested list/dict query params

* determine non-zero container exit code in Batch API

* support filtering by dimensions in CW get_metric_statistics

* fix storing attributes for ELBv2 Route entities; API GW refactorings for TF tests

* add missing fields for API GW resources

* fix error messages for Route53 (TF-compat)

* various fixes for IAM resources (tf-compat)

* minor fixes for API GW models (tf-compat)

* minor fixes for API GW responses (tf-compat)

* add s3 exception for bucket notification filter rule validation

* change the way RESTErrors generate the response body and content-type header

* fix lint errors and disable "black" syntax enforcement

* remove return type hint in RESTError.get_body

* add RESTError XML template for IAM exceptions

* add support for API GW minimumCompressionSize

* fix casing getting PrivateDnsEnabled API GW attribute

* minor fixes for error responses

* fix escaping special chars for IAM role descriptions (tf-compat)

* minor fixes and tagging support for API GW and ELB v2 (tf-compat)

* Merge branch 'master' into localstack

* add "AlarmRule" attribute to enable support for composite CloudWatch metrics

* fix recursive parsing of complex/nested query params

* bump version

* add API to delete S3 website configurations (#18)

* use dict copy to allow parallelism and avoid concurrent modification exceptions in S3

* fix precondition check for etags in S3 (#19)

* minor fix for user filtering in Cognito

* fix API Gateway error response; avoid returning empty response templates (tf-compat)

* support tags and tracingEnabled attribute for API GW stages

* fix boolean value in S3 encryption response (#20)

* fix connection arn structure

* fix api destination arn structure

* black format

* release 2.0.3.37

* fix s3 exception tests

see botocore/parsers.py:1002 where RequestId is removed from parsed

* remove python 2 from build action

* add test failure annotations in build action

* fix events test arn comparisons

* fix s3 encryption response test

* return default value "0" if EC2 availableIpAddressCount is empty

* fix extracting SecurityGroupIds for EC2 VPC endpoints

* support deleting/updating API Gateway DomainNames

* fix(events): Return empty string instead of null when no pattern is specified in EventPattern (tf-compat) (#22)

* fix logic and revert CF changes to get tests running again (#21)

* add support for EC2 customer gateway API (#25)

* add support for EC2 Transit Gateway APIs (#24)

* feat(logs): add `kmsKeyId` into `LogGroup` entity (#23)

* minor change in ELBv2 logic to fix tests

* feat(events): add APIs to describe and delete CloudWatch Events connections (#26)

* add support for EC2 transit gateway route tables (#27)

* pass transit gateway route table ID in Describe API, minor refactoring (#29)

* add support for EC2 Transit Gateway Routes (#28)

* fix region on ACM certificate import (#31)

* add support for EC2 transit gateway attachments (#30)

* add support for EC2 Transit Gateway VPN attachments (#32)

* fix account ID for logs API

* add support for DeleteOrganization API

* feat(events): store raw filter representation for CloudWatch events patterns (tf-compat) (#36)

* feat(events): add support to describe/update/delete CloudWatch API destinations (#35)

* add Cognito UpdateIdentityPool, CW Logs PutResourcePolicy

* feat(events): add support for tags in EventBus API (#38)

* fix parameter validation for Batch compute environments (tf-compat)

* revert merge conflicts in IMPLEMENTATION_COVERAGE.md

* format code using black

* restore original README; re-enable and fix CloudFormation tests

* restore tests and old logic for CF stack parameters from SSM

* parameterize RequestId/RequestID in response messages and revert related test changes

* undo LocalStack-specific adaptations

* minor fix

* Update CodeCov config to reflect removal of Py2

* undo change related to CW metric filtering; add additional test for CW metric statistics with dimensions

* Terraform - Extend whitelist of running tests

Co-authored-by: acsbendi <acsbendi28@gmail.com>
Co-authored-by: Phan Duong <duongpv@outlook.com>
Co-authored-by: Thomas Rausch <thomas@thrau.at>
Co-authored-by: Macwan Nevil <macnev2013@gmail.com>
Co-authored-by: Dominik Schubert <dominik.schubert91@gmail.com>
Co-authored-by: Gonzalo Saad <saad.gonzalo.ale@gmail.com>
Co-authored-by: Mohit Alonja <monty16597@users.noreply.github.com>
Co-authored-by: Miguel Gagliardo <migag9@gmail.com>
Co-authored-by: Bert Blommers <info@bertblommers.nl>
2021-07-26 15:21:17 +01:00
Sahil Shah
6977bba3e1
Add capability to update AWS::ElasticLoadBalancingV2(Listener and ListenerRule) resource (#4005)
* Add ssm parsing support for cloudformation stacks

* Start adding unit tests for ssm parameter parsing

* Add tests for code update

* Add tests to parse ssm parameters code

* Fix black lint errors

* Fix bug.

* Need to specify region_name

* region needs to be same

* Use ssm_backends[region] instead of ssm_backend

* StringList -> string

* Linting

* check if servermode tests are on

* Typo

* Added support for ListenerRule. Will remove cruft

* Pushing latest

* Something works

* Put back ripped out code

* Save point. Incase I need more validations

* Revert "Save point. Incase I need more validations"

This reverts commit dac4953335dd9335eddb7a91a63667bc3c17104c.

* Fixed validations and some refactor

* Fix formatting

* Linting

* Cannot refactor if I have to fix all tests

* Remove exceptions for now. Will do in another PR

* Remove validations. Will add in next PR

* Fix broken tests. Almost.:

* Fix all tests. Some sneaky for now.

* Python2 making me write bad code

* OrderedDict.move_to_end() does not work in python2

* Linting

* Add more checks to field in conditions later.

* Unwnated change in FakeListener

* Revert "Unwnated change in FakeListener"

This reverts commit 962c2fdfd76fce999de9feccf1dd1c3ec48c459f.

* Add back default listener rule

* Linting fix

* Fix priority sorting

* Add cloudformation test for edge case

* Add validation for ForwardConfig in Action of ListernRule CF

* use not in

* set the priority template correctly

* Check for boolean in condition

* One more check

* Implement update_from_cloudformation_json for Listener and ListenerRule

* Unwanted spaces

* Linting issues

* Add tests for code coverage

Co-authored-by: Bert Blommers <bblommers@users.noreply.github.com>
2021-06-11 21:56:28 +01:00
Sahil Shah
3f5408c9d0
Adding support for ForwardConfig property in ListernRule in CloudFormation (#3993)
* Add ssm parsing support for cloudformation stacks

* Start adding unit tests for ssm parameter parsing

* Add tests for code update

* Add tests to parse ssm parameters code

* Fix black lint errors

* Fix bug.

* Need to specify region_name

* region needs to be same

* Use ssm_backends[region] instead of ssm_backend

* StringList -> string

* Linting

* check if servermode tests are on

* Typo

* Added support for ListenerRule. Will remove cruft

* Pushing latest

* Something works

* Put back ripped out code

* Save point. Incase I need more validations

* Revert "Save point. Incase I need more validations"

This reverts commit dac4953335dd9335eddb7a91a63667bc3c17104c.

* Fixed validations and some refactor

* Fix formatting

* Linting

* Cannot refactor if I have to fix all tests

* Remove exceptions for now. Will do in another PR

* Remove validations. Will add in next PR

* Fix broken tests. Almost.:

* Fix all tests. Some sneaky for now.

* Python2 making me write bad code

* OrderedDict.move_to_end() does not work in python2

* Linting

* Add more checks to field in conditions later.

* Unwnated change in FakeListener

* Revert "Unwnated change in FakeListener"

This reverts commit 962c2fdfd76fce999de9feccf1dd1c3ec48c459f.

* Add back default listener rule

* Linting fix

* Fix priority sorting

* Add cloudformation test for edge case

* Add validation for ForwardConfig in Action of ListernRule CF

* use not in

* set the priority template correctly

* Check for boolean in condition

* One more check

Co-authored-by: Bert Blommers <bblommers@users.noreply.github.com>
2021-06-09 18:41:18 +01:00
Sahil Shah
b82096ba37
Add support for AWS::ElasticLoadBalancingV2::ListenerRule (#3969)
* Add ssm parsing support for cloudformation stacks

* Start adding unit tests for ssm parameter parsing

* Add tests for code update

* Add tests to parse ssm parameters code

* Fix black lint errors

* Fix bug.

* Need to specify region_name

* region needs to be same

* Use ssm_backends[region] instead of ssm_backend

* StringList -> string

* Linting

* check if servermode tests are on

* Typo

* Added support for ListenerRule. Will remove cruft

* Pushing latest

* Something works

* Put back ripped out code

* Save point. Incase I need more validations

* Revert "Save point. Incase I need more validations"

This reverts commit dac4953335dd9335eddb7a91a63667bc3c17104c.

* Fixed validations and some refactor

* Fix formatting

* Linting

* Cannot refactor if I have to fix all tests

* Remove exceptions for now. Will do in another PR

* Remove validations. Will add in next PR

* Fix broken tests. Almost.:

* Fix all tests. Some sneaky for now.

* Python2 making me write bad code

* OrderedDict.move_to_end() does not work in python2

* Linting

* Add more checks to field in conditions later.

* Unwnated change in FakeListener

* Revert "Unwnated change in FakeListener"

This reverts commit 962c2fdfd76fce999de9feccf1dd1c3ec48c459f.

* Add back default listener rule

* Linting fix

* Fix priority sorting

* Add cloudformation test for edge case

Co-authored-by: Bert Blommers <bblommers@users.noreply.github.com>
2021-06-05 10:04:04 +01:00
Ismael Fernandez Molina
04cbd1fa1a
adding physical_resource_id in SubnetRouteTableAssociation, Route and NatGW classes (#3789)
* adding physical_resource_id in SubnetRouteTableAssociation, Route and NatGW classes

* adding tests

* passing litern at test

* passsing black==19.10b0 as lintern

* passing test to python 2.7
2021-03-20 08:57:53 +00:00
Brian Pandola
f4b81e69b8
Address pytest warnings (#3629)
* Address `boto` deprecation warnings

This commit eliminates the following warning:

../boto/ec2/connection.py:582:
  PendingDeprecationWarning: The current get_all_instances implementation will be replaced with get_all_reservations.

`boto` isn't likely to ever make good on this warning, but doing the replacement will
declutter the `moto` test output.

* Remove `invoke_lambda` tracebacks from unit test logging

If an exception is encountered, the details are returned in the response payload.
Printing the traceback was just adding noise to the pytest output.

* Use known AMIs in unit tests

This commit eliminates the following warning in the pytest output:

`PendingDeprecationWarning: Could not find AMI with image-id:ami-123456, in the near future this will cause an error.`

Known, pre-loaded AMI image ids are used instead of random ids that don't actually
exist in the moto backend.  The integrity of the tests is unaffected by this change.

A test has been added to provide explicit coverage of the PendingDeprecationWarning
raised when an invalid AMI image id is passed to moto.
2021-01-29 11:31:56 +00:00
Brian Pandola
9e1fcac9d4
Use known AMI in internal tests (#3620)
Moto's implementation of autoscaling:CreateLaunchConfiguration is a little too loose,
allowing the ImageId parameter to be omitted and defaulting it to None, which results
in dozens of deprecation warnings:

`PendingDeprecationWarning: Could not find AMI with image-id:ami-123456, in the near future this will cause an error.`

This commit refactors calls to CreateLaunchConfiguration to explicitly pass in a known
AMI ImageId in order to avoid these warnings.

The integrity of the tests is unaffected by this change.
2021-01-27 19:49:33 +00:00
Erez Freiberger
9784e1b487
adding layers support for lambda backend (#3563)
* adding layers support for lambda backend

* improving lambda layer tests

* adding lambda list_layers and fixing tests

* make format
2021-01-17 15:28:49 +00:00
Bert Blommers
77dd35e3b8
Use known ImageID in internal tests (#3555) 2021-01-13 09:02:11 +00:00
waynemetcalfe
0a938f7bb4
issue-3379 iam list_roles: implement PathPrefix, MaxItems and Marker (#3380)
* issue-3379 iam list_roles: implement PathPrefix, MaxItems and Marker

* issue-3379 fix cloudformation test
2020-10-12 12:13:20 +01:00
Guilherme Martins Crocetti
f744356da7
Lambda reserved concurrency (#3215)
* lambda-responses: add method to dispatch concurrency calls

* lambda-resources: add route to handle concurrency requests

* lambda-model: implement put_function_concurrency and concurrency attribute

* put-concurrency-tests: add one simple test

* get_function: add concurrency entry - with test

* lambda-reserved-concurrency: cloudformation support

* lambda-concurrency: implement delete_reserved with tests

* lambda-concurrency: implement get_reserved with tests

* lint

* implementation-cov: mark delete_function_concurrency, put_function_concurrency and get_function_concurrency

* botocore doesn't display concurrency entry for lambdas without it

* lambda(refactor): improvements on response's handler
2020-08-26 11:06:53 +01:00
Bert Blommers
80761ebb3b #3114 - Allow DynamoDB table as CFN output 2020-07-11 09:46:03 +01:00
Steve Pulec
ee0328b0a3
Merge pull request #3050 from bblommers/cloudformation-support-dynamodb-streams
CloudFormation - Support DynamoDB Streams
2020-06-11 20:58:19 -05:00
Guilherme Martins Crocetti
e32a60185f
Cloudformation - EventBus support (#3052)
* add EventBus to model's map

* add support for creation of EventBus through cloudformation's api

* add cloudformation's delete

* add cloudformation's update

* add cloudformation's attribute
2020-06-06 11:31:14 +01:00
Bert Blommers
a66b0e5b1a CloudFormation - Support DynamoDB Streams 2020-06-04 07:45:00 +01:00
Guilherme Martins Crocetti
149e307bc9
Rule's cloudformation support for updates (#3043)
* add support to update stack using cloudformation

* blacked test file
2020-06-03 06:54:01 +01:00
Jeremie Tharaud
90e200f0f6
Add missing changes when creating a change set (#3039)
* Display changes when creating a change set

* add change set id and description when describing stack

* fix lint with flake8 and black
2020-06-03 06:08:35 +01:00
Zach Brookler
31ce74a842
Fix autoscaling tags (#3010)
* ENH: Add unit test for propagation tags

* BUG: Add missing translation of boolean PropagateAtLaunch tag values to strings

* BUG: Should really be checking for "true" and not True

* CLN: Black formatting
2020-05-24 12:21:29 +01:00
Zach Brookler
80b64f9b3f
Cloud formation "depends_on" #2845 Add depends on and update name type mapping (#2994)
* ENH: Add unit test for cloudformation DependsOn

* ENH: Add implementation of retrieving list of resources that account for dependencies

* ENH: Update the name mappings so that they are consistent with the latest cloudformation names

* ENH: Add launch configuration to type names

* ENH: Create subnet for test and test creation with dependencies

* CLN: Code reformatting

* CLN: Remove print statements

* BUG: Fix error resulting in possible infinite loop

* CLN: Remove commented out fixture decorator

* BUG: Remove subnet creation

* CLN: Remove main and ec2 dependencies

* BUG: Add back in instance profile name type

* CLN: Remove print

* BUG: Fix broken unit test

* CLN: Code reformatting

* CLN: Remove main

* ENH: Add autoscaling group name to type names

* ENH: Add unit test for string only dependency and add assertions to unit tests

* ENH: Add unit test for chained depends_on in cloudformation stack

* BUG: Remove f strings for python 2.7 compatibility

* BUG: List needs to be sorted for python2.7

* CLN: Fix code formatting
2020-05-18 09:47:18 +01:00
Mike Grima
bdeeeb701a
Merge pull request #2880 from bblommers/bugfix/2877
EC2 - Ensure NCI always has a Subnet
2020-04-16 15:02:45 -07:00
Bert Blommers
414fcf7bbd Fix AvailibilityZones in CF tests 2020-04-08 15:14:39 +01:00
Guilherme Martins Crocetti
503eeb51ae style with black 2020-04-01 22:48:40 -03:00
Guilherme Martins Crocetti
c15ca133b8 add support for Fn::GetAtt in event's cloudformation 2020-04-01 22:14:51 -03:00
Guilherme Martins Crocetti
af08d71310 add support for RetentionInDays for LogGroup 2020-04-01 22:14:41 -03:00
Guilherme Martins Crocetti
788b8fb6e1 Add tests for Events::Rule integration with cf 2020-03-23 22:17:02 -03:00
Guilherme Martins Crocetti
98a17dfc46 Add test for boto3 integration 2020-03-22 18:03:42 -03:00
Bert Blommers
cbf0397953 #2255 - CF - Implement FN::Transform and AWS::Include 2020-03-18 13:02:07 +00:00
Bert Blommers
9163f04292 Linting 2020-03-11 13:19:40 +00:00