amazon.aws icon indicating copy to clipboard operation
amazon.aws copied to clipboard

cloudwatch_metric_alarm: fix idempotency for alarm without dimensions

Open jmisset-cb opened this issue 1 year ago • 11 comments

SUMMARY

A metric alarm in Cloudwatch can optionally have Dimensions. When a metric alarm in Cloudwatch does not have any dimensions, it returns: "Dimensions": [] when queried via boto3.

When configuring a metric alarm without Dimensions in Cloudwatch using the cloudwatch_metric_alarm plugin, Dimensions must be absent from the parameters.

Because "Dimensions": [] does not match Dimensions: None, the result is always Changed.

This Pull Request fixes this by setting Dimensions from the returned alarm parameters to None when the field is empty.

Fixes #1750

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

cloudwatch_metric_alarm

ADDITIONAL INFORMATION

jmisset-cb avatar Nov 18 '23 15:11 jmisset-cb

Build succeeded. https://ansible.softwarefactory-project.io/zuul/buildset/11de4804995c49bb8a2e7851073d2fcc

:heavy_check_mark: ansible-galaxy-importer SUCCESS in 3m 53s :heavy_check_mark: build-ansible-collection SUCCESS in 14m 37s :heavy_check_mark: ansible-test-splitter SUCCESS in 5m 32s :heavy_check_mark: integration-amazon.aws-1 SUCCESS in 9m 54s Skipped 43 jobs

@gravesm Is there anything I can do to get someone to review this PR + the related issue it solves? Thanks in advance.

jmisset-cb avatar Dec 19 '23 08:12 jmisset-cb

Build failed. https://ansible.softwarefactory-project.io/zuul/buildset/975ec4cffb004ddeb7729fc193fcd3ed

:heavy_check_mark: ansible-galaxy-importer SUCCESS in 5m 17s :heavy_check_mark: build-ansible-collection SUCCESS in 15m 14s :heavy_check_mark: ansible-test-splitter SUCCESS in 5m 27s :x: integration-amazon.aws-1 FAILURE in 5m 20s Skipped 43 jobs

Build succeeded. https://ansible.softwarefactory-project.io/zuul/buildset/0e0287eed6ca4bf4923bdf4764a5af0f

:heavy_check_mark: ansible-galaxy-importer SUCCESS in 3m 45s :heavy_check_mark: build-ansible-collection SUCCESS in 14m 01s :heavy_check_mark: ansible-test-splitter SUCCESS in 5m 53s :heavy_check_mark: integration-amazon.aws-1 SUCCESS in 6m 46s Skipped 43 jobs

Hi @jmisset-cb Thank you for initiating this pull request. We are currently in the process of reviewing it. Kindly incorporate a changelog entry and perform a rebase of the PR.

GomathiselviS avatar Feb 13 '24 16:02 GomathiselviS

Build succeeded. https://ansible.softwarefactory-project.io/zuul/buildset/064c77a449524406866b2bbd3b1e72e2

:heavy_check_mark: ansible-galaxy-importer SUCCESS in 4m 25s :heavy_check_mark: build-ansible-collection SUCCESS in 14m 23s :heavy_check_mark: ansible-test-splitter SUCCESS in 5m 37s :heavy_check_mark: integration-amazon.aws-1 SUCCESS in 8m 45s Skipped 43 jobs

Hi @GomathiselviS thank you for taking the time to review my PR. I've added the assertion task and merge the latest main commits into the branch. Could you please assist me with the changelog? In which file/directory should I place this? Thanks in advance!

jmisset-cb avatar Feb 14 '24 11:02 jmisset-cb

Build succeeded. https://ansible.softwarefactory-project.io/zuul/buildset/a8fec7de4f0449959f9d0daa41727def

:heavy_check_mark: ansible-galaxy-importer SUCCESS in 5m 15s :heavy_check_mark: build-ansible-collection SUCCESS in 15m 06s :heavy_check_mark: ansible-test-splitter SUCCESS in 5m 31s :heavy_check_mark: integration-amazon.aws-1 SUCCESS in 10m 43s Skipped 43 jobs

Hi @GomathiselviS thank you for taking the time to review my PR. I've added the assertion task and merge the latest main commits into the branch. Could you please assist me with the changelog? In which file/directory should I place this? Thanks in advance!

This an example of a changelog fragment. You can create one for your fix. The category of your fix will be one of these

GomathiselviS avatar Feb 14 '24 17:02 GomathiselviS

Hi @GomathiselviS thank you for taking the time to review my PR. I've added the assertion task and merge the latest main commits into the branch. Could you please assist me with the changelog? In which file/directory should I place this? Thanks in advance!

This an example of a changelog fragment. You can create one for your fix. The category of your fix will be one of these

I've added the changelog entry! Thanks again.

jmisset-cb avatar Feb 16 '24 09:02 jmisset-cb

Build succeeded. https://ansible.softwarefactory-project.io/zuul/buildset/04ca17bc52b54c4ab1b23a4c22d3e422

:heavy_check_mark: ansible-galaxy-importer SUCCESS in 4m 21s :heavy_check_mark: build-ansible-collection SUCCESS in 14m 16s :heavy_check_mark: ansible-test-splitter SUCCESS in 5m 23s :heavy_check_mark: integration-amazon.aws-1 SUCCESS in 9m 49s Skipped 43 jobs