Skip to content

cloudwatchevent_rule always reports Changed = True #1080

Closed

Description

@ichekaldin

Summary

cloudwatchevent_rule module always reports Changed = True.

I believe this is caused to ansible-collections/community.aws#1355.

Output of boto3 describe_rule method only includes previously specified parameters. Therefore AWS _rule_matches_aws method ends up comparing something like this:

[{'id': 'my-target-id', 'arn': 'arn:aws:lambda:us-east-1:123412341234:function:my-function', 'role_arn': None, 'input': None, 'input_path': None, 'input_transformer': None, 'ecs_parameters': None}]

with describe_rule output that looks like this:

[{'id': 'my-target-id', 'arn': 'arn:aws:lambda:us-east-1:123412341234:function:my-function'}]

Issue Type

Bug Report

Component Name

cloudwatchevent_rule

Ansible Version

ansible [core 2.12.7]
  configured module search path = ['/usr/share/ansible/plugins/modules']
  python version = 3.8.13 (default, May  8 2022, 17:48:02) [Clang 13.1.6 (clang-1316.0.21.2)]
  jinja version = 3.1.2
  libyaml = False

Collection Versions

amazon.aws            4.1.0  
community.aws         4.1.1  

AWS SDK versions

Name: boto3
Version: 1.24.43
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Requires: botocore, jmespath, s3transfer
Required-by: 
---
Name: botocore
Version: 1.27.43
Summary: Low-level, data-driven core of boto 3.
Home-page: https://github.com/boto/botocore
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Requires: jmespath, python-dateutil, urllib3
Required-by: boto3, s3transfer

Configuration

$ ansible-config dump --only-changed

OS / Environment

No response

Steps to Reproduce

- community.aws.cloudwatchevent_rule:
    name: my-rule
    schedule_expression: "rate(1 day)"
    targets:
      - id: my-target
        arn: "arn:aws:lambda:us-east-1:123412341234:function:my-function"
    state: present

Expected Results

Module should return Changed = True on the first execution, and Changed = False on all subsequent executions.

Actual Results

Module always returns Changed = True.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Activity

  1. ansibullbot commented on Aug 10, 2022

    @ansibullbot

    Files identified in the description:

    If these files are inaccurate, please update the component name section of the description or use the !component bot command.

    click here for bot help

  2. added
    bug
    module
    plugins
    on Aug 10, 2022
  3. added
    needs_verified
    and removed on Oct 11, 2022
  4. self-assigned this
    on Oct 11, 2022
  5. added a commit that references this issue on Jul 4, 2023
    614b792
  6. added 2 commits that reference this issue on Jul 4, 2023
    445162c
    a9906e7
  7. added 2 commits that reference this issue on Jul 4, 2023
    4adb1b6
    d0732c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugmoduleneeds_verifiedplugins

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions