Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Aws ssm version support #61045
AWS parameter store supports parameter versioning. The api allows for this with the syntax 'parameterName:versionNumber'. Currently, the aws_ssm module performs a string comparison on input parameters vs returned parameter names. When a version number is included, said string comparison fails as the name of the parameter returned by the api does not include the ':versionNumber'.
This is a simple change to remove the ':versionNumber' from the parameterName before the string comparison is performed.
I chose not to include version as an additional parameter both to capitalize on boto3's native functionality and to avoid weird collisions when using the bypath option of the module.
Given this example, looking for version 10 of a parameter the boto3 response body looks like this
When given a version number that doesnt exist, the behavior is as such:
Because in this case the version number is included in the response, we do not want to remove it when performing the string comparison. If something that is not a number is passed after the colon, the behavior is the same.
Since aws does not allow colons in parameter names this should not cause any issues.
@gundalow for full disclosure I am not a contributor to this repo (as you might be able to tell by me incorrectly suggesting that @dangothemango should squash his commits), so reviewing/confirming this fix is beyond my ability. He originally pinged me about this PR, and in the spirit of good open-source I simply tried to bring it to the attention of more qualified maintainers such as yourself.
I would confirm with @dangothemango that he has tested this and merge at your discretion
@gundalow I partially tested the change. Due to the simplicity of it and it being my first time committing to the project, rather than set up an entire development environment I simply extracted the changed part and verified that the loop behaved as expected with the responses I could see from boto3 in the current version of ansible