Commit Graph

300 Commits

Author SHA1 Message Date
nom3ad
12bd6af540
fix(cloudformation): missing Parameters key in get_template_summary() response (#4466) 2021-10-23 11:40:41 +00: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
nom3ad
080e7eba84
cloudformation: fix get_template_summary() related error (#4425) 2021-10-18 09:13:27 +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
teddylear
8c2d0b0557
feat: Adding validation to Cloudformation to reject same template_body (#4351) 2021-09-28 20:35:46 +00:00
Paul Roberts
65c29e1f5e
Fix CloudFormation create_stack returning stack_id with wrong region (#4302) 2021-09-17 22:45:11 +00:00
Paul Roberts
45b2684eb6
Publish messages to SNS when CloudFormation NotifcationARNs is set (#4295)
Co-authored-by: Paul Roberts <paroberts@guidewire.com>
2021-09-16 09:26:50 +00:00
Bert Blommers
1a42b33781
IAM - Delete Role/InstanceProfile via CloudFormation (#3591) 2021-08-28 11:00:05 +01:00
Timothy Klopotoski
cbbeaff23e
Throw ValidationError on null outputs section (#4221) 2021-08-26 06:01:01 +01:00
Bert Blommers
7acdfe4feb
Introduce Pylint to check for duplicate test method names (#3684) 2021-08-21 16:33:15 +01:00
Timothy Klopotoski
bd5ab53241
Fix bugs. Cloudformation updates are complex! (#4200)
* **Fix bug.** If a cloudformation stack is updated with a new
    parameter, that parameter should be honored. Several unit tests
    had bugs where they were not providing parameters required by the template.
* **Fix bug.** Do not update stack parameters until after deleting removed
    resources, so that any references to removed parameters can be resolved.
* **Fix bug.** Per the API, creation of a change set should not modify
    a stack. The `diff` method, called in the creation of a
    FakeChangeSet, was mutating the resource map which was problematic
2021-08-19 17:36:11 +01:00
Timothy Klopotoski
8743f81e15
CF: Raise ValidationError on bad resource id (#4186) 2021-08-18 18:41:02 +01:00
Kai Xia
9af1a96174 make FakeChangeSet a subclass of BaseModel, not FakeStack.
This fixes #4141, and pave ways for future changes around changeset.

We had subclassed FakeChangeSet from FakeStack, not from BaseModel. This made
us easier to send the response for describe_change_set calls, but when we are
handling the details of change set, the old approach won't work at all.
For example, when we were creating a changeset, we were actually creating a
stack without registering it (self.stacks), and future update onto this stack
is not really possible.

Signed-off-by: Kai Xia <kaix+github@fastmail.com>
2021-08-07 17:02:22 +10:00
Bert Blommers
79f0cc9e9e
Tech debt - remove dead DynamoDB code and add RDS tests (#4136) 2021-08-04 17:24:26 +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
Bert Blommers
7693d77333
Remove Py2 support (#3915) 2021-07-26 07:40:39 +01:00
Sahil Shah
70a7a7e0a0
SSM parameters in cloudformation (AWS::SSM::Parameter::) are not recognized and resolved for default values (#4042)
* Add ssm parsing support for cloudformation stacks
2021-06-29 18:28:52 +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
Sahil Shah
24fa8f25a1
SSM parameters in cloudformation (AWS::SSM::Parameter::) are not recognized and resolved (#3929)
* 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

Co-authored-by: Bert Blommers <bblommers@users.noreply.github.com>
2021-05-19 08:30:25 +01:00
David Baumgold
3af87963d1
Py3: use unittest.mock instead of mock (#3481)
* Py3: use unittest.mock instead of mock

* noqa

* oops

* just pull in patch()

* ignore RuntimeError when stopping patch

* ignore RuntimeError from default_session_mock.stop()
2021-04-06 10:22:42 +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
Jakub Musko
c8c6b0bf58
Fix stackset describe/delete. Fix stackset update. (#3713)
* Fix stack set fetching and deleting.

* Also fix stackset update operation to accept previous values.

* Fix linting.

* Rename aliased test.
2021-02-21 09:47:10 +00:00
Jakub Musko
b6d7704b23
Update stackset create operation to correctly return the resource's ID. (#3709)
* Update stackset create operation to correctly return the resource's ID.

* Add test confirming create_stack_set response.
2021-02-18 18:04:12 +00:00
Anton Grübel
0211e9d78d
Add failures output to ecs.describe_services (#3641)
* Add failures output to ecs.describe_services

* Fix autoscaling tests
2021-02-01 12:19:46 +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
Modhaffer Rahmani
8fe5a680a5
Added explicit exception raise when no stack found. (#3559)
* Added explicit exception raise when no stack found.

Currently, any operation that uses 'get_stack' method from 'CloudFormationBackend' class
will fail with AttributeError or jinja2 exception if ran against non-existing stack(created/deleted)
To fix the issue I explicitly raised a 'ValidationError' exception.
Added tests for boto and boto3 responses.

* Moved non-existing stack tests to 'test_stack_events'

When using 'update_stack' to test raising an exception when the stack doesn't exist
test coverage dropped by 0.5%. I am using stack_events instead.

* Removed some unreachable paths

After adding the exception couple of paths in the code are unreachable as 'get_stack' doesn't return 'None' anymore.
This is the reason why coverall was reporting decreased coverage.

* Removed an unreachable path I missed

* Added couple of tests in cloudformation/models

* Added more assertions around raised exception

* Formatted document using black to fix issue with travis.
2021-01-16 14:42:51 +00:00
Bert Blommers
77dd35e3b8
Use known ImageID in internal tests (#3555) 2021-01-13 09:02:11 +00:00
usmangani1
d44beb0c9d
Fix:Cloudformation descibe stacks special chars (#3514)
* Fix:descibe stacks special chars

* removed debug statements

* Linting

Co-authored-by: usmanokc <usman@okcredit.in>
2020-12-06 08:11:52 +00:00
Brian Pandola
ae85c539fd Remove boto package dependency
The `boto` library (long ago superseded by `boto3`) has not had an official
release in over two years or even a commit in the last 18 months.  Importing
the package (or indirectly importing it by via `moto`) generates a deprecation
warning.  Additionally, an ever-increasing number of `moto` users who have
left `boto` behind for `boto3` are still being forced to install `boto`.

This commit vendors a very small subset of the `boto` library--only the code
required by `moto` to run--into the /packages subdirectory.  A README file
is included explaining the origin of the files and a recommendation for how
they can be removed entirely in a future release.

NOTE: Users of `boto` will still be able to use `moto` after this is merged.

closes #2978
closes #3013
closes #3170
closes #3418

relates to #2950
2020-11-26 23:59:15 -08:00
Bert Blommers
273ca63d59 Linting 2020-11-11 15:55:37 +00:00
Matěj Cepl
5697ff87a8 Back to Black 2020-11-10 14:12:38 +01:00
Matěj Cepl
ea489bce6c Finish porting from nose to pytest. 2020-11-10 08:25:05 +01:00
Matěj Cepl
77dc60ea97 Port test suite from nose to pytest.
This just eliminates all errors on the tests collection. Elimination of
failures is left to the next commit.
2020-11-10 08:23:44 +01: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
jweite
49d92861c0
Iam cloudformation update, singificant cloudformation refactoring (#3218)
* IAM User Cloudformation Enhancements: update, delete, getatt.

* AWS::IAM::Policy Support

* Added unit tests for AWS:IAM:Policy for roles and groups.  Fixed bug related to groups.

* AWS:IAM:AccessKey CloudFormation support.

* Refactor of CloudFormation parsing.py methods to simplify and standardize how they call to the models.  Adjusted some models accordingly.

* Further model CloudFormation support changes to align with revised CloudFormation logic.  Mostly avoidance of getting resoure name from properties.

* Support for Kinesis Stream RetentionPeriodHours param.

* Kinesis Stream Cloudformation Tag Support.

* Added omitted 'region' param to boto3.client() calls in new tests.

Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
2020-08-27 10:11:47 +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
jweite
736c8b77ce
Fixed Failures in CloudFormation Provisioning of S3 Buckets When Stack has Long Name... (#3169)
* Fixed defect with CloudFormation provisioning of S3 buckets occuring when stack has a long name, resulting in the default S3 bucket name's length exceeding its 63 char limit.

* PR 3169 July 23, 2020 2:57a ET comment: added additional asserts to assure provisioned bucket's name complies.  Fixed bug in my earlier change that could produce default bucket names with illegal upper-case characters in it.

Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
2020-07-29 07:47:18 +01:00
usmangani1
bc1674cb19
CF : Added support for get template summary (#3179)
* CF : Added support for get template summary

* Linting

Co-authored-by: Bert Blommers <info@bertblommers.nl>
2020-07-27 14:08:01 +01:00
Steve Pulec
7481d07a3d
Merge pull request #3119 from bblommers/bugfix/dynamodb_table_cfn_output
CFN - Allow DynamoDB table as an Output
2020-07-26 15:30:29 -05:00
usmangani1
a123a22eeb
Fix : cloudFormation dynamodb : delete resource on delete stack (#3120)
* Fix :  cloudFormation dynamodb : delete resource on delete stack

* Delete function for dynamodb

* Added tests for delete stack using dynamodb.

* Added tests for non decorator

* Linting

Co-authored-by: Bert Blommers <info@bertblommers.nl>
2020-07-19 11:59:19 +01:00
usmangani1
c5de56ce70
Fix: CloudFormation support status filter in list stacks (#3115)
* Fix: CloudFormation support status filter in list stacks

* Added test for non decorator

Co-authored-by: usmankb <usman@krazybee.com>
2020-07-12 13:39:42 +01:00
Bert Blommers
80761ebb3b #3114 - Allow DynamoDB table as CFN output 2020-07-11 09:46:03 +01:00
Adam Richie-Halford
766f527d37
Add NUMBER and LIST<NUMBER> parsing to cloudformation/parsing.py (#3118)
* Add NUMBER and LIST<NUMBER> parsing to cloudformation/parsing.py

* Fix black formatting error in test_stack_parsing.py
2020-07-11 08:43:45 +01:00
Shane
0f062f68ff
Cloudformation: Fix - validate template yml fixes
This change fixes:
* Replace call to non-existent exception yaml.ParserError
* Catches yaml scanner error for valid json with tabs
* Supply yaml loader to ensure yaml loading throws exception validly for json with tabs and doesn't try to load the json incorrectly
2020-06-30 22:35:47 +01:00
Shane Dowling
80c53d8b5a
Add support for template urls in cfn validation (#3089)
Added as boto supports both TemplateBody and TemplateUrl

* Adds TemplateURL as a validate_template option
* Adds a test to validate this
2020-06-26 14:01:57 +01:00
Shane Dowling
6305f707d2
fix to capture yaml scanner error (#3077) 2020-06-18 09:50:58 +01:00
Steve Pulec
09c061e8a8
Merge pull request #3072 from bblommers/cloudformation-check-name-in-use
CloudFormation - Check stack name in use
2020-06-14 14:01:48 -05:00
Guilherme Martins Crocetti
0dd41d4c32
Cloudformation support for EventSourceMapping (#3045)
* change line position for uuid and last_modified because they're not input parameters

* add event_source_arn validator and setter

* refactor batch_size as setter

* add helper function to parse arn and return source service

* fix for EventSource's create_from_cfn, there was no reference in the lambda object for the esm if created by cfn

* add esm deletion by cloudformation

* remove unused variable in test

* add cfn's update

* add complete implementation of delete_from_cfn

* blacked changed files

* fix test with invalid batchsize for sqs

* Dynamodb2 Table - Bugfix for localindex and implemented get_cfn_attributes

* Dynamodb2 eventsource - fix test to use StreamArn attribute

* Lambda Test - fix test_update_event_source_mapping
2020-06-14 16:03:00 +01:00
Bert Blommers
4556a2f96f #1954 - CF - Check stack name in use 2020-06-14 11:31:44 +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
Jeremie Tharaud
8fa625c3de
Cfn change set fix outputs (#3033)
* set creation time of the change set

* fix status, execution status, stak id, creation time and update tests
2020-05-29 07:33:24 +01:00
Jeremie Tharaud
162a38bb10
fix missing sure package and region_name (#3031) 2020-05-28 14:14:09 +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
Steve Pulec
59c71760ff
Keep order in request body to ensure auth signing works. (#3024)
* Keep order in request body to ensure auth signing works.

* Lint.

* More OrderedDict to ensure data parameter order.

* Lint.

* Improve CF test assertions.

* Fix syntax error.

* Cleanup CF test.
2020-05-24 08:51:45 +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
Steve Pulec
229b3ec196
Merge pull request #2838 from bblommers/feature/2388
CloudFormation - CreateChangeSet should not create resources
2020-04-25 18:44:18 -05: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
Bert Blommers
04f488da62 #2388 - CloudFormation - CreateChangeSet does not create resources, as per spec 2020-03-24 10:22:08 +00: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
Guilherme Martins Crocetti
7318523b50 Add cloudformation support for EventBridge 2020-03-22 16:56:58 -03:00
Steve Pulec
94f85902bc
Merge pull request #2821 from bblommers/feature/2255
CloudFormation - Add Support for FN:Transform and AWS:Include
2020-03-19 19:40:46 -05:00
Bert Blommers
cbf0397953 #2255 - CF - Implement FN::Transform and AWS::Include 2020-03-18 13:02:07 +00:00
Bert Blommers
3fab3f572f #2773 - CloudFormation - Set CreationDate 2020-03-17 16:09:42 +00:00
Bert Blommers
9163f04292 Linting 2020-03-11 13:19:40 +00:00
Luis Pollo
20364b177a Fix IAM role name when parsed from CloudFormation JSON. 2020-03-11 13:17:35 +00:00
Steve Pulec
b252ab6675
Merge pull request #2173 from sthuber90/master
Extending IoT Policy and Jobs functionality
2020-02-17 17:55:03 -06:00
Steve Pulec
e40d75359a
Merge pull request #2717 from bblommers/feature/s3_illegallocationconstraint
S3 Feature: Add IllegalLocationConstraintException
2020-02-15 10:41:00 -06:00
Bert Blommers
d5a36752d7 Add S3 LocationConstraint to CF tests 2020-02-02 12:44:26 +00:00
Brandon Bradley
8b3c2b6654
fix test 2020-01-30 17:50:21 -06:00
Brandon Bradley
b7795b7111 test for ListStackResources 2020-01-30 16:35:19 -06:00
Stephan Huber
20020c5170 Change whitespaces back to the way they were and fix typos 2020-01-23 15:46:50 +01:00
Stephan Huber
0527e88d46 Merge remote-tracking branch 'upstream/master' 2019-12-23 08:38:53 +01:00
Fabio Dias
743dd46399 black linting 2019-12-16 21:25:20 -05:00
Fabio Dias
fd9ac4b9a5 ACCOUNT_ID moved to moto.core, MOTO_ACCOUNT_ID env var override 2019-12-16 21:05:29 -05:00
Fabio Dias
b83a750630 Added references to moto.iam.models.ACCOUNT_ID instead of hardcoded id 2019-12-16 19:56:11 -05:00
Bert Blommers
8362179f70 Use deprecated IAM, only plays nice with deprecated CF 2019-11-23 10:18:56 +00:00
Bert Blommers
d759f16331 Specify region name when creating Lambda roles 2019-11-22 08:12:47 +00:00
Bert Blommers
c6dd3c96ea AWSLambda - refactor exception handling 2019-11-17 10:59:20 +00:00
Bert Blommers
ad23b65784 Implement CloudFormations IAMRole::GetArn 2019-11-07 11:35:07 -08:00
Bert Blommers
40aa73a12b #2546 - AWS Lambda: Add Role validation when creating functions 2019-11-07 17:11:13 +00:00
Asher Foa
96e5b1993d Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
Stephan Huber
5a9c921d97 Merge remote-tracking branch 'upstream/master' 2019-08-30 14:39:29 +02:00
Randy Westergren
ccceb70397
And event source mapping endpoints and SQS trigger support 2019-08-20 21:54:57 -04:00
Stephan
d0de38601d Merge remote-tracking branch 'upstream/master' 2019-05-28 08:55:50 +02: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