Skip to content

Commit

Permalink
Modified based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mandar242 committed Sep 22, 2022
1 parent 2acaeb5 commit d8e15ad
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions plugins/modules/cloudwatch_metric_alarm_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
alarm_name_prefix:
description:
- An alarm name prefix to retrieve information about alarms that have names that start with this prefix.
- Can not be used with alarm_names.
- Can not be used with I(alarm_names).
required: false
type: str
alarm_type:
Expand All @@ -51,7 +51,7 @@
- If specified returns information only about alarms that are currently in the particular state.
required: false
type: str
choices: ['ok', 'alarm', 'insufficient_data']
choices: ['OK', 'ALARM', 'INSUFFICIENT_DATA']
action_prefix:
description:
- This parameter can be used to filter the results of the operation to only those alarms that use a certain alarm action.
Expand All @@ -77,7 +77,7 @@
alarm_names:
- my-test-alarm-1
- my-test-alarm-2
state_value: ok
state_value: OK
- name: describe the metric alarm based alarm names prefix
amazon.aws.cloudwatch_metric_alarm_info:
Expand Down Expand Up @@ -281,8 +281,7 @@ def build_params(module):
params['ParentsOfAlarmName'] = module.params.get('parents_of_alarm_name')

if module.params.get('state_value'):
state_value_mapping = {'ok': 'OK', 'alarm': 'ALARM', 'insufficient_data': 'INSUFFICIENT_DATA'}
params['StateValue'] = state_value_mapping[module.params.get('state_value')]
params['StateValue'] = module.params.get('state_value')

if module.params.get('action_prefix'):
params['ActionPrefix'] = module.params.get('action_prefix')
Expand All @@ -298,7 +297,7 @@ def main():
alarm_type=dict(type='str', choices=['composite_alarm', 'metric_alarm'], default='metric_alarm', required=False),
children_of_alarm_name=dict(type='str', required=False),
parents_of_alarm_name=dict(type='str', required=False),
state_value=dict(type='str', choices=['ok', 'alarm', 'insufficient_data'], required=False),
state_value=dict(type='str', choices=['OK', 'ALARM', 'INSUFFICIENT_DATA'], required=False),
action_prefix=dict(type='str', required=False),
)

Expand Down

0 comments on commit d8e15ad

Please sign in to comment.