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

[DNM] test replace aws cli calls with cloudwatch_metric_alarm_info tasks #1440

Conversation

mandar242
Copy link
Contributor

SUMMARY

Depends-On: ansible-collections/amazon.aws#988
Testing cloudwatch_metric_alarm_info module to use in cloud_metric_alarm integration tests.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

cloudwatch_metric_alarm

ADDITIONAL INFORMATION

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review integration tests/integration needs_triage plugins plugin (any type) tests tests labels Sep 8, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 5m 13s
✔️ build-ansible-collection SUCCESS in 8m 02s
✔️ ansible-test-sanity-docker-devel SUCCESS in 11m 25s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 00s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 20s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 10m 41s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 8m 18s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 7m 37s
✔️ ansible-test-splitter SUCCESS in 5m 33s
✔️ integration-community.aws-1 SUCCESS in 9m 36s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

softwarefactory-project-zuul bot pushed a commit to ansible-collections/amazon.aws that referenced this pull request Sep 27, 2022
new module: cloudwatch_metric_alarm_info

SUMMARY
Depends-On: #1066
Should be merged only after #1028 is merged.

Adding a new module for retrieving cloudwatch metric alarms info.

Currently supports following boto API(s)
describe_alarms()
ISSUE TYPE


New Module Pull Request

COMPONENT NAME

cloudwatch_metric_alarm_info
ADDITIONAL INFORMATION


Will be useful in moving these tasks from aws cli commands to amazon.aws module.
https://github.com/ansible-collections/community.aws/blob/main/tests/integration/targets/cloudwatch_metric_alarm/tasks/main.yml#L63-L70
ansible-collections/community.aws#1440
The integration tests for this info module will be added to above tests, after the cloudwatch_metric_alarm module is migrated from community.aws to amazon.aws.

Sample playbook
---
- name: Create a metric alarm & get info
  hosts: localhost
  gather_facts: false
  tasks:
    - name: create alarm
      community.aws.cloudwatch_metric_alarm:
        state: present
        region: us-east-2
        name: "cpu-low-test-metric-alarm-1234"
        metric: "CPUUtilization"
        namespace: "AWS/EC2"
        statistic: Average
        comparison: "LessThanOrEqualToThreshold"
        threshold: 50.0
        period: 180
        evaluation_periods: 3
        unit: "Percent"
        description: "This will alarm when a instance's CPU usage average is lower than 50%"
        dimensions: {'InstanceId':'i-00a8b34xxxxxxxxxx'}

    - name: describe the metric alarm based on metric name and namespace
      amazon.aws.cloudwatch_metric_alarm_info:
        alarm_names:
          - cpu-low-test-metric-alarm-1234
      register: alarm_info

    - debug:
        var: alarm_info

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mandar Kulkarni <[email protected]>
Reviewed-by: Jill R <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: Gonéri Le Bouder <[email protected]>
@mandar242 mandar242 closed this Oct 11, 2022
@mandar242
Copy link
Contributor Author

closed as ansible-collections/amazon.aws#988 is merged.

abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
…nsible-collections#1440)

Don't consider prop 'StateTransitionedTimestamp' in change detection

SUMMARY

Remove property 'StateTransitionedTimestamp' from the list of props when determining if an alarm has changed and needs to be create/updated.

Fixes ansible-collections#1439
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
cloudwatch-metric-alarm
ADDITIONAL INFORMATION
See issue ansible-collections#1439 for additional details.

Reviewed-by: Mark Chappell
Reviewed-by: Alina Buzachis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review integration tests/integration needs_triage plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants