Commit Graph

77 Commits

Author SHA1 Message Date
Bert Blommers
db0738025a
SSM - Maintenance Windows (#4549) 2021-11-09 21:28:24 -01:00
Dominik Schubert
78709ce22c
feat(SSM): add support for Label filter in get_parameters_by_path (#4542) 2021-11-08 21:58:11 -01:00
Bert Blommers
14a69c7524
Techdebt: Enable pylint rules (#4432) 2021-10-18 19:44:29 +00:00
Jim King
33e60a2d16
[issue-4360] Fix InvalidResource Id,Type responses for ssm tagging methods (#4361) 2021-09-30 11:47:11 +00:00
Jim King
f50cf51de7
[issue-4283] ssm put_parameter with tags and overwrite should error (#4362) 2021-09-30 10:58:04 +00:00
Gonzalo Saad
e6c6ce5942
refactor(ssm): Refactor document permisisons and conditions (#4243) 2021-09-08 06:56:20 +01:00
Julian
58da62cc71
enhancement(SSM): Add DataType attribute to SSM Parameters (#4232) 2021-08-29 17:28:51 +01:00
Bert Blommers
020257904e
Tech Debt - improve test coverage (#4229) 2021-08-27 11:28:10 +01:00
Gonzalo Saad
29b0122fac
feat(ssm): Add ssm documents permissions (#4217)
* refactor(ssm): Add Documents class to avoid dictionary handling
This also solves the datetime format issue in TestAccAWSCloudWatchEventTarget_ssmDocument
2021-08-25 15:16:14 +01:00
Bert Blommers
76094f012b
Remove pkg_resources module (#4142) 2021-08-05 17:59:25 +01:00
Bert Blommers
5e4bccc22d
Use centralized ACCOUNT_ID (#4029) 2021-06-23 18:03:11 +01:00
Kyle Decot
8d4007f2b6
Escape Hyphen in Regular Expression (#4006)
* Escape Hyphen in Regular Expression

* Add Test

* Fix Linting Errors

* Use Pytest Parameterize Marker

* Fix Black Formatting Errors

* Interpolate / Use Raw String

* fixes string formatting

Co-authored-by: Correna Sprowls <correna.sprowls@joinroot.com>
2021-06-11 21:54:43 +01:00
Austin Hendrix
5602c4e73e
SSM Parameter Store improvements in GetParameterHistory & GetParameters (#3984)
* Including labels and versions in SSM Get Parameters

* implementing NextToken and MaxResults into the SSM Get Parameter History functionality

* Implementing unit tests and some lint refactoring for NextToken implementation in get_parameter_history
2021-06-04 11:12:35 +01:00
Austin Hendrix
b670962c5e
SSM Parameter Store Error Message When Requesting Invalid Version (#3977)
* Implement correct error when requesting specific version of a parameter which exists but does not have this version

* removing trailing whitespace causing lint failure

* Adding unit tests and fixing linting for new error handling

* Fixing small bug in response message

* Revert change in get_parameters as versioning is not currently implemented in this method. Will fix as a separate PR
2021-06-02 16:27:23 +01:00
Brian Pandola
7947b1e001
Enforce SSM Parameter Version Limit (#3967)
Behavior verified against a real AWS backend.
2021-05-28 08:32:39 +01:00
usmangani1
58fd4aeaae
Fix tags for resource in ListTagsForResource (#3931)
* Fix tags for resource in ListTagsForResource

* Fix review comments

* Fix tests
2021-05-14 20:05:40 +01:00
Tom Noble
a001c59f7e
Modify SSM put_parameter() to raise ValidationException if value is empty string (#3806)
* Modify put_parameter() to raise ValidationError when value is empty string

* Simplify empty string check

Co-authored-by: Tom Noble <tom.noble@bjss.com>
2021-03-28 14:45:57 +01:00
Joakim Saario
457402fbe2
Support SSM Parameter tags (#3739) 2021-03-02 09:00:26 +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
cd25ab7a16
Fix: broken build with release of botocore 1.19.62 (#3628)
The latest release of `botocore` (1.19.62) makes changes to the parameter
validation code, which for some reason was also covered by a couple of
`moto` tests.

These tests, when run, do not execute any `moto` code.  They fail the
parameter validation check in `botocore`, which raises an exception
before ever sending a request.  These tests do not cover or verify
any `moto` behavior and have been removed.

Ref: ff8ae76ecc

Closes #3627
2021-01-29 09:06:25 +00:00
Bert Blommers
8591eda9d6
Introduce Github Actions to replace TravisCI (#3610) 2021-01-26 12:37:03 +00: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
Brian Pandola
3b9635b3c7 Add ssm:SendCommand support for instance tag Targets
Replace the special-case code to handle Cloud Formation tags with a more
generic implementation that covers all instance tags.

Supersedes #2863
Closes #2862
2020-11-08 00:06:35 -08:00
Bert Blommers
db1d7123f6 List dependencies for services - add integration test to verify 2020-09-13 16:08:23 +01:00
Ninh Khong
ff1f565142
Enhance function get_parameter by parameter name, version or labels (#3191)
Co-authored-by: Ninh Khong <ninh@1on1english.vn>
2020-07-28 16:59:22 +01:00
Jordan Reiter
28d1d762af
Enforce parameter naming (#3190)
* Enforce parameter naming

Parameters are not allowed to start with `ssm` or `aws`. This commit adds error messages which
correspond exactly to the error messages returned by boto3.

* Fix for Python 2 compatibility

f-strings not supported in Python 2.7
2020-07-28 15:26:59 +01:00
Jordan Reiter
126f5a5155
Implement Filter: Contains functionality for describe_params (#3189)
* Implement Filter: Contains functionality for describe_params

This commit adds the Contains functionality. Tests were created
to mimic behavior in AWS/boto3, including that filters with values
in the form of `/name` will match parameters named `/name/match` but
not parameters named `match/with/other-name`. In the test example, a
Contains filter with the value `/tan` would match: `/tangent-3` and
`tangram-4` but not `standby-5`.

* Enforce parameter filter restrictions on get_parameters_by_path

According to the boto3 documentation [1], `Name`, `Path`, and `Tier` are not
allowed values for `Key` in a parameter filter for `get_parameters_by_path`.

This commit enforces this by calling `_validate_parameter_filters` from the
`get_parameters_by_path` method, and adding a check to `_validate_parameter_filters`.

I added 3 test cases to `test_get_parameters_by_path` which check for the correct
exception when calling with a parameter filter using any of these keys.

* Code formatted to match style

* Refactored logic
2020-07-28 10:17:35 +01:00
Alex Bainbridge
c1326ed8cc removed done comments 2020-07-03 13:25:03 -04:00
Alex Bainbridge
487829810f passes python3 and 2.7. added additional few tests for coverage bump 2020-07-02 13:43:14 -04:00
Alex Bainbridge
c9b38e25b8 black linting 2020-06-30 12:43:42 -04:00
Alex Bainbridge
82825787db all tests passing 2020-06-30 12:39:52 -04:00
Alex Bainbridge
bdc1e93a4f most of testing is done 2020-06-29 18:20:57 -04:00
Alex Bainbridge
e2f6544228 ssm document code done, testing now 2020-06-26 10:47:28 -04:00
Anton Grübel
65e790c4eb
Add dynamodb continuous backups (#2976)
* remove print statement

* Add dynamodb.describe_continuous_backups

* Add dynamodb.update_continuous_backups

* Fix Python 2 timestamp error
2020-05-08 15:57:48 +01:00
gruebel
3b8c8fafe2 Fix ssm.get_parameters missing validation 2020-05-06 14:38:25 +02:00
Brent Driskill
e3e4b741d8 SSM: Fix the formatting associated with label_parameter_version/get_parameter_history updates 2020-03-11 11:57:04 -04:00
Brent Driskill
5705695495 SSM: Added support for label_parameter_version and getting labels on get_parameter_history 2020-03-11 10:43:18 -04:00
Olabode Anise
9227845121 using assert_raises 2020-02-27 07:29:13 -05:00
Olabode Anise
607e0a8452 ENH: changes the behavior of delete_parameter to respond with a 400 error when the parameter does not exist.
Currently, the delete_parameter function for the ssm client will respond with a dict containing a key of Invalid Parameter which has a value of a list containing the parameter name that was requested to be deleted when a parameter with said name doesn't exist which doesn't match the behavior of boto3.
2020-02-26 07:13:32 -05:00
Mike Grima
65b17e740d
Merge pull request #2611 from Sytten/fix/ssm-parameter
Add missing information in SSM parameters
2019-12-16 11:59:42 -08:00
Emile Fugulin
b52fa636b6 Add missing information in SSM parameters 2019-11-30 20:05:01 -05:00
Adam Smith
051193e1bf Add Pagination to ssm:get_parameters_by_path. Closes #1864 2019-11-27 22:12:31 +00:00
William Richard
715ff0f7af
Return a sensible error when the parameter is not found 2019-11-04 15:31:15 -05:00
William Richard
3816eba58f
Fix linting 2019-11-04 13:04:10 -05:00
William Richard
aeb7974549
Add get_parameter_history implementation and tests 2019-11-04 12:49:09 -05:00
Asher Foa
96e5b1993d Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
gruebel
2cfd3398f6 Add ParameterFilters to SSM describe_parameters 2019-10-05 14:05:47 +02:00