-
Notifications
You must be signed in to change notification settings - Fork 398
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
cloudwatchevent_rule doesn't support JSON input_templates #1348
Comments
Files identified in the description:
If these files are inaccurate, please update the |
#1355 has recently been added:
While I realise this breaks your playbook, please understand that while we'll avoid breaking changes once something's officially been released on Galaxy, we may occasionally rework things that are 'only' in the main branch. |
@tremble Thanks! Just successfully deployed this same event pattern using the new ansible configuration keys. |
Note that for this to work, the transformer input template MUST be valid JSON. So something like
will NOT work, because Fortunately, quoting this value does not prevent EventBridge from processing the input correctly. |
…llections#1348) Remove an unreachable code fragment in ec2_security_group In file: ec2_security_group.py, method: ensure_present, a logical expression uses the identity operator. A new object is created inside the identity check operation and then used for matching identity. Since this is a distinct, new object, it will not have identity and match with anything else. As a result, the identity check will have a logical short circuit and the program may have unintended behavior. I suggested that the logical operation should be done properly. Reviewed-by: Mark Chappell
Summary
AWS EventBridge supports JSON for their input templates. However, we are assuming a string is desired, and therefore wrap the input template in quotes, which is not parsed by AWS as a JSON template.
Issue Type
Bug Report
Component Name
cloudwatchevent_rule
Ansible Version
$ ansible --version
Collection Versions
This was pointing to master. From our Dockerfile:
RUN ansible-galaxy collection install git+https://github.com/ansible-collections/community.aws.git,main
AWS SDK versions
$ pip show boto boto3 botocore
Configuration
$ ansible-config dump --only-changed
OS / Environment
No response
Steps to Reproduce
Here is a working example using the AWS CLI:
Which can be executed with a
aws events put-targets --cli-input-json file://eventbridge_target.json
However, when parsing the target configuration, the input is wrapped in a string:
AWS will not route an event with an invalid transformer template. So the input for a JSON template must begin with a
{
, not a"
. My solution was to remove the string wrapping, AND prepend the template with a space, as recommended here. This results in:Expected Results
I expected the input template to be wrapped by
{ ... }
but was instead"{ ... }"
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: