Skip to content

events: support SSM RunCommand  #7710

@Cloudrage

Description

@Cloudrage

Hello,

It seems that we can't target an SSM Run Command with Events > class Rule (construct) :
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.IRuleTarget.html

It's not obtainable from Ssm :
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.RuleTargetConfig.html

Use Case

I want to create scheduled Events Rule to Target an SSM RunCommand to call a Document, for example, to RunShellScript on my target(s) identified with Tags.

Proposed Solution

Be able to configure SSM Run Command in Events.Rule, Yaml example :

  TargetsProperties:
    - Arn: "arn:aws:ssm:{{environment_config.region}}::document/AWS-RunShellScript"
      Id: "1"
      Input: "{
      \"commands\":[ echo "Hello World" ]
      }"
      RoleArn: !stack_output ecs-host-cloudwatch-events-iam-role::RoleArn
      RunCommandParametersProperties:
        - Key: tag:UpdateECSAgent
          Values:
            - "true"

Other

Done without pb & successfully with events.CfnRule.

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-eventsRelated to CloudWatch Eventseffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions