-
Notifications
You must be signed in to change notification settings - Fork 397
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
Added support for InputTransformer attribute of cloudwatchevent_rule #623
Added support for InputTransformer attribute of cloudwatchevent_rule #623
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Unfortunately we still have no integrationtests for cloudwatchevent_rule
.
Do you find some time to add them?
Sure, do you want me to do it in the context of this PR or on another PR? |
the same is fine. |
@markuman I added integration tests, please review. The automated tests are failing for authorization and timeouts, things I cannot really control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@avishayil Thank you very much for taking the time to work on this. Overall this looks good to me. For the authorization errors, there is required a policy for DescribeRule
to be added in the terminator https://github.com/mattclay/aws-terminator. Would you be willing to open a PR in the terminator https://github.com/mattclay/aws-terminator to add this policy? Let me know if you need any help, otherwise I can add it for you.
Hi @alinabuzachis, I wasn't sure under what Regarding the Regarding the timeout, any idea? |
tests/integration/targets/cloudwatchevent_rule/defaults/main.yml
Outdated
Show resolved
Hide resolved
@avishayil this PR contains the following merge commits: Please rebase your branch to remove these commits. |
rebased |
recheck |
I think the docs error in zuul is unrelated to this PR? |
Any progress? |
recheck |
Build succeeded.
|
Hi @alinabuzachis happy to see we're back on track! |
recheck |
recheck |
EventBridge has the InputTransformer attribute on target to allow providing custom input to a target based on certain event data. This PR adds this functionality and includes an example usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the minimal integration tests.
I'm sorry this has taken so long, assuming the tests pass I think this is ready to merge.
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
Thanks, it's been over a year 🙏 |
Backport to stable-4: 💚 backport PR created✅ Backport PR branch: Backported as #1357 🤖 @patchback |
…623) Added support for InputTransformer attribute of cloudwatchevent_rule SUMMARY EventBridge has the InputTransformer attribute on target to allow providing custom input to a target based on certain event data. This PR adds this functionality and includes an example usage. ISSUE TYPE Feature Pull Request COMPONENT NAME aws.cloudwatchevent_rule ADDITIONAL INFORMATION ... "targets": [ { "arn": "arn:aws:sns:us-east-1:123456789012:MySNSTopic", "id": "MySNSTopic", "input_transformer": { "input_paths_map": { "instance": "$.detail.instance-id", "state": "$.detail.state" }, "input_template": "\"<instance> is in state <state>\"" } } ] Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: Avishay Bar <[email protected]> Reviewed-by: Jill R <None> Reviewed-by: Mark Chappell <None> (cherry picked from commit bd097b5)
…623) (#1357) [PR #623/bd097b5e backport][stable-4] Added support for InputTransformer attribute of cloudwatchevent_rule This is a backport of PR #623 as merged into main (bd097b5). SUMMARY EventBridge has the InputTransformer attribute on target to allow providing custom input to a target based on certain event data. This PR adds this functionality and includes an example usage. ISSUE TYPE Feature Pull Request COMPONENT NAME aws.cloudwatchevent_rule ADDITIONAL INFORMATION ... "targets": [ { "arn": "arn:aws:sns:us-east-1:123456789012:MySNSTopic", "id": "MySNSTopic", "input_transformer": { "input_paths_map": { "instance": "$.detail.instance-id", "state": "$.detail.state" }, "input_template": "\"<instance> is in state <state>\"" } } ] Reviewed-by: Mark Chappell <None>
Fix support envvars for lookup aws ssm SUMMARY Took over from ansible-collections#623 to apply reviewer's comments and add a changelog fragment. Working on support in lookup plugin amazon.aws.aws_ssm for endpoint parameters, as well of tradional environment variable for client configuration (AWS_PROFILE, AWS_ACCESS_KEY_ID, ...). This should fixes ansible-collections#519 Depends-On: ansible-collections#728 ISSUE TYPE Feature Pull Request COMPONENT NAME aws_ssm ADDITIONAL INFORMATION It seems LookupModule cannot benefit from AnsibleAWSModule (it expect several methods/params, I am not familiar enough with Python and Ansible to sort it out) ; so this PR uses boto3_conn and get_aws_connection_info defined in utils.ec2. This is a simple snippet how it can be used: - name: Load env collections: - amazon.aws gather_facts: no hosts: localhost connection: local vars: my_env: "{{ lookup('amazon.aws.aws_ssm', 'status', endpoint='http://localhost:4566') }}" tasks: - name: show the env debug: msg: "{{ my_env }}" Command line test: ANSIBLE_COLLECTIONS_PATHS=${ANSIBLE_HOME}/collections ansible-playbook test.yml Output: PLAY [Load env] ************************************************************************************************************************************************************************************************************************************************************* TASK [show the env] ********************************************************************************************************************************************************************************************************************************************************* ok: [localhost] => { "msg": "INIT" } PLAY RECAP ****************************************************************************************************************************************************************************************************************************************************************** localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Another test with envars: AWS_ACCESS_KEY_ID='foo' AWS_ACCESS_SECRET_KEY='bar' AWS_URL='http://localhost:4566' ANSIBLE_COLLECTIONS_PATHS=${ANSIBLE_HOME}/collections ansible-playbook test.yml where we remove the endpoint from lookup: - name: Load env collections: - amazon.aws gather_facts: no hosts: localhost connection: local vars: my_env: "{{ lookup('amazon.aws.aws_ssm', 'status') }}" tasks: - name: show the env debug: msg: "{{ my_env }}" (provides same output) Reviewed-by: Mark Chappell <None>
…nsible-collections#623) Added support for InputTransformer attribute of cloudwatchevent_rule SUMMARY EventBridge has the InputTransformer attribute on target to allow providing custom input to a target based on certain event data. This PR adds this functionality and includes an example usage. ISSUE TYPE Feature Pull Request COMPONENT NAME aws.cloudwatchevent_rule ADDITIONAL INFORMATION ... "targets": [ { "arn": "arn:aws:sns:us-east-1:123456789012:MySNSTopic", "id": "MySNSTopic", "input_transformer": { "input_paths_map": { "instance": "$.detail.instance-id", "state": "$.detail.state" }, "input_template": "\"<instance> is in state <state>\"" } } ] Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: Avishay Bar <[email protected]> Reviewed-by: Jill R <None> Reviewed-by: Mark Chappell <None> This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections@bd097b5
SUMMARY
EventBridge has the InputTransformer attribute on target to allow providing custom input to a target based on certain event data. This PR adds this functionality and includes an example usage.
ISSUE TYPE
COMPONENT NAME
aws.cloudwatchevent_rule
ADDITIONAL INFORMATION