New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[aws] Add suboptions to aws_application_scaling_policy #43042
[aws] Add suboptions to aws_application_scaling_policy #43042
Conversation
target_tracking_scaling_policy_configuration=dict( | ||
required=False, | ||
type='dict', | ||
options=dict( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes problem for me but could maybe use checking that these options are not None now that the argspec may set unwanted defaults.
The full traceback is:
Traceback (most recent call last):
File "/var/folders/by/k8_fbl593dlctgqmwq5wzl2c0000gn/T/ansible_XpZlS8/ansible_module_aws_application_scaling_policy.py", line 423, in create_scaling_policy
TargetTrackingScalingPolicyConfiguration=scaling_policy['TargetTrackingScalingPolicyConfiguration']
File "/Users/shertel/Workspace/ansible/venv/python2.7.13/lib/python2.7/site-packages/botocore/client.py", line 314, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Users/shertel/Workspace/ansible/venv/python2.7.13/lib/python2.7/site-packages/botocore/client.py", line 586, in _make_api_call
api_params, operation_model, context=request_context)
File "/Users/shertel/Workspace/ansible/venv/python2.7.13/lib/python2.7/site-packages/botocore/client.py", line 621, in _convert_to_request_dict
api_params, operation_model)
File "/Users/shertel/Workspace/ansible/venv/python2.7.13/lib/python2.7/site-packages/botocore/validate.py", line 291, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
ParamValidationError: Parameter validation failed:
Invalid type for parameter TargetTrackingScalingPolicyConfiguration.CustomizedMetricSpecification, value: None, type: <type 'NoneType'>, valid types: <type 'dict'>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I'll take another crack at this.
* [aws] Add suboptions to aws_application_scaling_policy Fixes ansible#42917 * Remove any suboptions that are None (cherry picked from commit 9d1bf32)
SUMMARY
For target policy, options filled in by jinja2 were loaded as strings and not converted to integers before being passed to the scaling policy API. This change adds suboptions to enforce int types on API params requiring integers.
Fixes #42917
ISSUE TYPE
COMPONENT NAME
aws_application_scaling_policy
ANSIBLE VERSION
ADDITIONAL INFORMATION