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

Extend cloudwatch params

Open duderamos opened this issue 3 years ago • 7 comments

SUMMARY

I want to be able to provide more parameters for targets in to cloudwatch_rule smodule. Currently, there is no way to define ECS LaunchType and NetworkConfiguration.

Closes: https://github.com/ansible-collections/community.aws/issues/143

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

cloudwatch_rule

ADDITIONAL INFORMATION

This is an example of task definition:

---
- hosts: localhost
  connection: local
  gather_facts: false
  tasks:
  - name: Schedule for Foo
    cloudwatchevent_rule:
      name: run_foo
      state: enabled
      schedule_expression: "rate(60 minutes)"
      targets:
      - id: run-job-foo
        arn: arn:aws:ecs:ap-southeast-2:123456789123:cluster/jobs-cluster
        role_arn: arn:aws:iam::123456789123:role/ecsEventsRole
        ecs_parameters:
          launch_type: FARGATE
          network_configuration:
            awsvpc_configuration:
              assign_public_ip: ENABLED
              security_groups:
              - sg-58519c0e3db6f851
              subnets:
              - subnet-0c4b66b1d07e4e0c
          task_definition_arn: arn:aws:ecs:ap-southeast-2:123456789123:task-definition/task-to-run:1
          task_count: 1

duderamos avatar Jan 10 '21 12:01 duderamos

cc @jillr @jsdalton @s-hertel @tremble @wimnat click here for bot help

ansibullbot avatar Jan 13 '21 00:01 ansibullbot

Hey @markuman , can you please check it again? I think I addressed the feedback items.

duderamos avatar Jan 13 '21 21:01 duderamos

Hey guys, anything else I should improve here before it's good to merge? @markuman @tremble @jillr @wimnat

duderamos avatar Jan 23 '21 02:01 duderamos

@duderamos do you have some time to fix the integration test as @jillr suggested?

markuman avatar Jun 21 '21 12:06 markuman

Not related to this pr, but according to the yaml documentation of this module, input and input_path must become mutually_exclusive=(['input', 'input_path']) in the argument specs.

markuman avatar Jun 21 '21 12:06 markuman

Not related to this pr, but according to the yaml documentation of this module, input and input_path must become mutually_exclusive=(['input', 'input_path']) in the argument specs.

..because https://github.com/ansible-collections/community.aws/pull/354/files#diff-3a2f223edc4e34ea28b9859827a830844d92a8cd97f1300a2d16b1703a083bc8R358 this does not work and will always result in passing both, input and input_path to that api.

markuman avatar Jun 21 '21 13:06 markuman

platform_version: "1.4.0" is also missing in the integration test. without platform version, it fails. Also the group seems to be necessary.

markuman avatar Jun 21 '21 13:06 markuman

@duderamos Since the cloudwatchevent_rule module has been migrated to https://github.com/ansible-collections/amazon.aws/blob/main/plugins/modules/cloudwatchevent_rule.py, could you please open the PR against https://github.com/ansible-collections/amazon.aws and address the suggested changes? Thank you.

alinabuzachis avatar Sep 28 '22 10:09 alinabuzachis