Closed cergfix closed 1 year ago
Files identified in the description: None
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
Files identified in the description:
plugins/modules/ssm_parameter.py
](https://github.com/['ansible-collections/amazon.aws', 'ansible-collections/community.aws', 'ansible-collections/community.vmware']/blob/main/plugins/modules/ssm_parameter.py)If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @116davinder @jillr @markuman @mikedlr @nathanwebsterdotme @ozbillwang @s-hertel @tremble click here for bot help
Potential solution is probably to consider Description
an empty string if the Description element doesn't exist in the response: https://github.com/ansible-collections/community.aws/blob/3043bca5d3544a40b78f22e0ece084dde8324530/plugins/modules/ssm_parameter.py#L325
if 'Description' not in existing_parameter['Parameters'][0]:
existing_parameter['Parameters'][0]['Description'] = ''
@cergfix, It would be really nice if you can run above reproduce steps with -vvvv
and paste the output to pin-point error location.
The full traceback is:
Traceback (most recent call last):
...
File "/tmp/ansible_community.aws.ssm_parameter_payload_fmtkbrh6/ansible_community.aws.ssm_parameter_payload.zip/ansible_collections/community/aws/plugins/modules/ssm_parameter.py", line 483, in <module>
File "/tmp/ansible_community.aws.ssm_parameter_payload_fmtkbrh6/ansible_community.aws.ssm_parameter_payload.zip/ansible_collections/community/aws/plugins/modules/ssm_parameter.py", line 464, in main
File "/tmp/ansible_community.aws.ssm_parameter_payload_fmtkbrh6/ansible_community.aws.ssm_parameter_payload.zip/ansible_collections/community/aws/plugins/modules/ssm_parameter.py", line 386, in create_update_parameter
KeyError: 'Description'
I'm opening a PR now.
Summary
aws_ssm_parameter_store
update fails if no description element was defined before.If an SSM parameter has an empty description already in SSM, then the AWS API (I'm guessing
aws ssm describe-parameters
) doesn't include thedescription
element in the response JSON at all for such item, causing issues incommunity.aws. aws_ssm_parameter_store
handling of such reply (Description element no defined).Issue Type
Bug Report
Component Name
ssm_parameter
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
Ubuntu 22.04
Steps to Reproduce
Expected Results
Second command successfully adding the description element.
Actual Results
Second command fails due to description being empty in SSM.
Code of Conduct