Commit Graph

51 Commits

Author SHA1 Message Date
Bert Blommers
e9a4100324
Rewrite deprecated CloudFormation tests (#3842) 2021-10-04 13:47:40 +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
7acdfe4feb
Introduce Pylint to check for duplicate test method names (#3684) 2021-08-21 16:33:15 +01: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
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
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
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
Bert Blommers
d5a36752d7 Add S3 LocationConstraint to CF tests 2020-02-02 12:44:26 +00: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
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
Randy Westergren
ccceb70397
And event source mapping endpoints and SQS trigger support 2019-08-20 21:54:57 -04:00
grahamlyons
4de92accab
Fix existing tests which use list_stacks
The tests are expecting that deleted stacks are not listed when in
fact they should be.
2018-11-27 11:11:13 +00:00
Waldemar Hummer
115b9cee3e add CloudFormation model for Kinesis streams 2017-07-20 14:37:53 +10:00
Waldemar Hummer
da7106cfd6 extended CloudFormation models for Lambda and DynamoDB 2017-06-01 22:43:23 +02:00
Andrew Garrett
6f4cb512ac Allow CloudFormation stack tags to be updated
Limitations:

* does not update the tags of the resources in the stack. that can be
implemented later.
* does not support the supposed feature of clearing tags by passing an
empty value that boto3 mentions in its documentation. I could not find
anything in the request body to indicate when an empty value was passed.
2017-03-17 23:57:57 +00:00
Steve Pulec
3b4ef2cf15 Merge in master. 2017-03-05 09:58:39 -05:00
Andrew Garrett
e7735c3ee1 Add event IDs to CF Stack events (#852)
So that events can be uniquely identified.

I tried to match the format documented here:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-listing-event-history.html
2017-03-04 23:12:55 -05:00
Andrew Garrett
f6465df630 Return CF Stack events in reverse chronological order (#853)
This is how the AWS API works:
http://boto3.readthedocs.io/en/latest/reference/services/cloudformation.html#CloudFormation.Client.describe_stack_events
2017-03-04 23:00:25 -05:00
David Wilcox
a9554924df make cloudformation update stack use parameters provided (#843) 2017-03-04 22:48:51 -05:00
David Wilcox
8d737eb59d Route53: allow hosted zone id as well when creating record sets (#833)
* add test that creates r53 record set from hosted zone id (not name)

* pass test to enable creating record sets by hosted zone ids
2017-03-04 22:31:45 -05:00
David Wilcox
bcc3e57949 Cloudformation ResourceMaps incorrectly share namespaces for Conditions and Resources (#828)
* add tests to check CF's conditions and resources have distinct namespace

* separate the resource and condition namespaces for CF
2017-03-04 22:26:23 -05:00
Steve Pulec
f37bad0e00 Lints. 2017-02-23 21:37:43 -05:00
Steve Pulec
fde721bed7 Testing new version of decorator. 2017-02-15 22:35:45 -05:00
Andrew Garrett
542248158f Implement the meat for DescribeStackEvents
Right now this just adds events for the stack itself via the lifecycle
methods of the FakeStack object, but it is possible to add other kinds
of events (I left a method for that should someone need inspiration
later.)
2016-06-29 21:56:39 +00:00
Hitesh Ghia
d8baa957e9 Fix cfn delete stack functionality 2016-06-09 16:23:55 -07:00
Jesse Szwedko
6928501973 Throw exception if an update is attempted on a stack in ROLLBACK_COMPLETE
If a stack has a status of ROLLBACK_COMPLETE and you attempt to update
it, the AWS API throws a validation error. This updates moto to have the
same behvaior. We also uncommented a test which tests updating a stack
which passed without any additional modification -- it is unclear why
this test was commented.

Signed-off-by: Jack Lund <jack.lund@getbraintree.com>
2016-04-28 09:30:42 -04:00
Steve Pulec
a600deb96a Fix merge conflicts and add EC2 Instance delete. Closes #576. 2016-04-28 09:22:31 -04:00
Lawrence Aiello
3017181862 Fixes issue #575: cloudformation update_stack response ResponseParserError. 2016-04-18 14:37:12 -04:00
Hugo Lopes Tavares
e5675e9533 Change CloudFormationResponse.get_template() to return GetTemplateResponse/GetTemplateResult/TemplateBody 2015-10-05 15:21:30 -04:00
Steve Pulec
1dcfcbca57 Add cloudformation tags. 2015-08-31 16:48:36 -04:00
Steve Pulec
1e4df18c42 Allow actual use of cloudformation input parameters. 2014-12-31 14:21:47 -05:00
Steve Pulec
186ee6a5a4 Add cloudformation stack parsing for S3 keys. 2014-12-29 22:12:23 -05:00
Steve Pulec
bd847bd941 Cleanup multi-region support for ELB, SQS, Cloudformation, EC2, Autoscaling. 2014-11-15 13:34:52 -05:00
Joseph Lawson
1152939ecd add notification arns to cloudformation 2014-10-29 11:59:41 -04:00
Joseph Lawson
04d22082c4 remove some test details for 2.6 2014-10-23 22:32:20 -04:00
Joseph Lawson
3015fd0216 python 2.6 assert_raises 2014-10-23 22:21:00 -04:00
Joseph Lawson
08b1c3bc0c test delete stack 2014-10-23 14:57:46 -04:00
Joseph Lawson
04b5389e31 Add test for bad describe stack request 2014-10-23 14:46:54 -04:00
Joseph Lawson
94e969fed5 Enhance DescribeStacks. Keep track of deleted stacks. Stack status.
Made describe_stacks more in line with http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResource.html
2014-10-22 23:58:42 -04:00
David Baumgold
4201e6b430 from __future__ import unicode_literals 2014-08-27 11:33:55 -04:00