aws / aws/aws-cdk

events: support SSM RunCommand

Open
#7,710 12 comments 22 reactions 0 assignees View on GitHub
@aws-cdk/aws-events effort/medium feature-request p1
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
74

Description

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**.

* [ ] :wave: I may be able to implement this feature request
* [ ] :warning: This feature might incur a breaking change

---

This is a :rocket: Feature Request

Contributor guide

Open the contributing guide

Research direction

Start with the events Rule target APIs, especially IRuleTarget and RuleTargetConfig, and compare their behavior with events.CfnRule. Trace how an SSM RunCommand target, document input, role, and tag-based parameters should be represented, then verify that a scheduled Rule can invoke the document with those settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.