Skip to content
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

Rename cloudwatch metrics_alarm #1304

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Name | Description
[community.aws.cloudfront_origin_access_identity](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudfront_origin_access_identity_module.rst)|Create, update and delete origin access identities for a CloudFront distribution
[community.aws.cloudfront_response_headers_policy](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudfront_response_headers_policy_module.rst)|Create, update and delete response headers policies to be used in a Cloudfront distribution
[community.aws.cloudtrail](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudtrail_module.rst)|manage CloudTrail create, delete, update
[community.aws.cloudwatch_metric_alarm](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudwatch_metric_alarm_module.rst)|Create/update or delete AWS CloudWatch 'metric alarms'
[community.aws.cloudwatchevent_rule](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudwatchevent_rule_module.rst)|Manage CloudWatch Event rules and targets
[community.aws.cloudwatchlogs_log_group](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudwatchlogs_log_group_module.rst)|create or delete log_group in CloudWatchLogs
[community.aws.cloudwatchlogs_log_group_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.cloudwatchlogs_log_group_info_module.rst)|Get information about log_group in CloudWatchLogs
Expand All @@ -95,7 +96,6 @@ Name | Description
[community.aws.ec2_eip](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_eip_module.rst)|manages EC2 elastic IP (EIP) addresses.
[community.aws.ec2_eip_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_eip_info_module.rst)|List EC2 EIP details
[community.aws.ec2_launch_template](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_launch_template_module.rst)|Manage EC2 launch templates
[community.aws.ec2_metric_alarm](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_metric_alarm_module.rst)|Create/update or delete AWS Cloudwatch 'metric alarms'
[community.aws.ec2_placement_group](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_placement_group_module.rst)|Create or delete an EC2 Placement Group
[community.aws.ec2_placement_group_info](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_placement_group_info_module.rst)|List EC2 Placement Group(s) details
[community.aws.ec2_snapshot_copy](https://github.com/ansible-collections/community.aws/blob/main/docs/community.aws.ec2_snapshot_copy_module.rst)|Copies an EC2 snapshot and returns the new Snapshot ID
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/1304-rename_cloudwatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- ec2_metric_alarm - the ``ec2_metric_alarm`` module has been renamed to ``cloudwatch_metric_alarm``, ``ec2_metric_alarm`` remains as an alias (https://github.com/ansible-collections/community.aws/pull/1304).
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.. _community.aws.ec2_metric_alarm_module:
.. _community.aws.cloudwatch_metric_alarm_module:


******************************
community.aws.ec2_metric_alarm
******************************
*************************************
community.aws.cloudwatch_metric_alarm
*************************************

**Create/update or delete AWS Cloudwatch 'metric alarms'**
**Create/update or delete AWS CloudWatch 'metric alarms'**


Version added: 1.0.0
Expand All @@ -17,8 +17,9 @@ Version added: 1.0.0

Synopsis
--------
- Can create or delete AWS metric alarms.
- Can create or delete AWS CloudWatch metric alarms.
- Metrics you wish to alarm on must already exist.
- Prior to release 5.0.0 this module was called ``community.aws.ec2_metric_alarm``. The usage did not change.



Expand Down Expand Up @@ -287,7 +288,7 @@ Parameters
<td>
</td>
<td>
<div>Name of the appropriate namespace (<code>AWS/EC2</code>, <code>System/Linux</code>, etc.), which determines the category it will appear under in cloudwatch.</div>
<div>Name of the appropriate namespace (<code>AWS/EC2</code>, <code>System/Linux</code>, etc.), which determines the category it will appear under in CloudWatch.</div>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -532,7 +533,7 @@ Examples
.. code-block:: yaml

- name: create alarm
community.aws.ec2_metric_alarm:
community.aws.cloudwatch_metric_alarm:
state: present
region: ap-southeast-2
name: "cpu-low"
Expand All @@ -549,7 +550,7 @@ Examples
alarm_actions: ["action1","action2"]

- name: Create an alarm to recover a failed instance
community.aws.ec2_metric_alarm:
community.aws.cloudwatch_metric_alarm:
state: present
region: us-west-1
name: "recover-instance"
Expand Down
4 changes: 4 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ action_groups:
- cloudfront_origin_access_identity
- cloudfront_response_headers_policy
- cloudtrail
- cloudwatch_metric_alarm
- cloudwatchevent_rule
- cloudwatchlogs_log_group
- cloudwatchlogs_log_group_info
Expand Down Expand Up @@ -343,6 +344,9 @@ plugin_routing:
redirect: community.aws.autoscaling_scheduled_action
ec2_elb:
redirect: community.aws.elb_instance
ec2_metric_alarm:
# Deprecation for this alias should not *start* prior to 2024-09-01
redirect: community.aws.cloudwatch_metric_alarm
ec2_instance:
redirect: amazon.aws.ec2_instance
ec2_instance_info:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@


DOCUMENTATION = r'''
module: ec2_metric_alarm
short_description: "Create/update or delete AWS Cloudwatch 'metric alarms'"
module: cloudwatch_metric_alarm
short_description: "Create/update or delete AWS CloudWatch 'metric alarms'"
version_added: 1.0.0
description:
- Can create or delete AWS metric alarms.
- Can create or delete AWS CloudWatch metric alarms.
- Metrics you wish to alarm on must already exist.
author: "Zacharie Eakin (@Zeekin)"
- Prior to release 5.0.0 this module was called C(community.aws.ec2_metric_alarm).
The usage did not change.
author:
- "Zacharie Eakin (@Zeekin)"
options:
state:
description:
Expand All @@ -46,7 +49,7 @@
type: str
namespace:
description:
- Name of the appropriate namespace (C(AWS/EC2), C(System/Linux), etc.), which determines the category it will appear under in cloudwatch.
- Name of the appropriate namespace (C(AWS/EC2), C(System/Linux), etc.), which determines the category it will appear under in CloudWatch.
required: false
type: str
statistic:
Expand Down Expand Up @@ -156,14 +159,13 @@
- 'missing'
default: 'missing'
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2

- amazon.aws.aws
- amazon.aws.ec2
'''

EXAMPLES = r'''
- name: create alarm
community.aws.ec2_metric_alarm:
community.aws.cloudwatch_metric_alarm:
state: present
region: ap-southeast-2
name: "cpu-low"
Expand All @@ -180,7 +182,7 @@
alarm_actions: ["action1","action2"]

- name: Create an alarm to recover a failed instance
community.aws.ec2_metric_alarm:
community.aws.cloudwatch_metric_alarm:
state: present
region: us-west-1
name: "recover-instance"
Expand All @@ -195,7 +197,6 @@
description: "This will recover an instance when it fails"
dimensions: {"InstanceId":'i-XXX'}
alarm_actions: ["arn:aws:automate:us-west-1:ec2:recover"]

'''

try:
Expand Down