Questions tagged [amazon-cloudwatch-events]

65 questions
15
votes
6 answers

AWS Eventbridge: Pattern to capture ALL events

I'd like to deploy an AWS Event Rule in Eventbridge which is triggered by all events, with no filtering whatsoever. I've tried the following patterns with no luck. { source: ["*"] } According to the documentation you cannot leave the pattern empty.…
8
votes
1 answer

AWS Lambda not authorised to perform action listed in permissions

I have a very simple AWS Lambda function - just listing all my CloudWatch events: import boto3 def lambda_handler(event, context): client = boto3.client("events") return client.list_rules() However, when I try to run it (with an empty test…
7
votes
1 answer

Using wildcard in Custom event pattern for the event SSM parameter

I am having a lambda function that trigger a Jenkins job. I want to invoke this lambda when a new ssm parameter is added. I have added the below Custom event pattern in the cloud-watch event pattern. { "source": [ "aws.ssm" ], …
6
votes
3 answers

AWS cron expression to run every other Monday

I want to schedule a CloudWatch event to run every other Monday and have started with this command: 0 14 ? * 2 * Currently with the above command, I get a weekly schedule of Monday executions: Mon, 27 Jul 2020 14:00:00 GMT Mon, 03 Aug 2020 14:00:00…
thehme
  • 2,698
  • 4
  • 33
  • 39
6
votes
2 answers

AWS question - How can I get Cloudwatch event data in a Fargate task with Python

I'm new to Cloudwatch events and to Fargate. I want to trigger a Fargate task (Python) to run whenever a file is uploaded to a specific S3 bucket. I can get the task to run whenever I upload a file, and can see the name in the event log; however I…
5
votes
1 answer

How to define multiple triggers for lambda function in SAM template?

I created a lambda function from a SAM template, and defined multiple triggers, but only one of these triggers is being created in cloudformation. This is my sam template: Myfunc: Type: AWS::Serverless::Function Properties: …
David Perez
  • 478
  • 5
  • 17
4
votes
1 answer

How to propogate tags to an ECS Task launched from an EventBridge Target?

I have a EventBridge (previously CloudWatch Events) Rule and Target that are used to launch ECS Tasks on a schedule (cron). I would like to apply some tags to the Task. I tried including tags in RegisterTaskDefinition, but this did not result in any…
yonran
  • 18,156
  • 8
  • 72
  • 97
4
votes
2 answers

What permissions does the 'invoke stepfunction' role (created from cloudwatch events console) have?

I'm following this article to go through the steps on how to set up a cloudwatch rule in the AWS console to trigger a StepFunction state machine, link:https://blog.shikisoft.com/3-ways-to-schedule-aws-lambda-and-step-functions-state-machines/ One of…
4
votes
2 answers

How to use Terraform to define cloundwatch event rules to trigger StepFunction statemachine

I have defined the creation of a StepFunction state machine in Terraform, now I want to set a timer to trigger the state machine everyday, I think probably using cloudwatch event rules is a good choice, I know how to set event rule to trigger a…
4
votes
1 answer

Filter EC2 based on tag while sending EC2 Instance State-change Notification through SNS using Cloudwatch event rule

I am trying to configure AWS Event rule using event pattern. Bye default the code is { "source": [ "aws.ec2" ], "detail-type": [ "EC2 Instance State-change Notification" ] } I want to filter the EC2 based on tag lets say all of my…
aroy
  • 452
  • 2
  • 10
3
votes
0 answers

Set cpu and memory requirements for a Fargate AWS Batch job from an AWS Cloudwatch event

I am trying to automate Fargate AWS Batch jobs by means of AWS Cloudwatch Events. So far, so good. I am trying to run the same job definition with different configurations. I am able to set the batch job as a cloudwatch event target. I have learned…
3
votes
2 answers

How to use multiple prefixes in anything-but clause in AWS eventbridge eventpattern?

I have a situation where I need to filter out certain events using eventpatterns in eventbridge. I want to run the rule for all events except those where username starts with abc or xyz. I have tried below 2 syntax but none worked : "userIdentity":…
3
votes
1 answer

Can someone give me an example of a custom CloudWatch Event Pattern

I am trying to write a custom CloudWatch Event Pattern that will trigger an SSM Run Command. The problem I am having is I am not sure how I am supposed to write this event pattern. I've looked at the documentation and I am just not understanding how…
3
votes
2 answers

How to define multiple targets in CloudWatch events by serverless framework

I have been using the serverless framework (1.61.0). I have many and many scheduled events that are syncing data from another source. For instance, I am syncing Category entities within one lambda function. categories: handler:…
3
votes
1 answer

CloudWatch Events Rule not finding EC2 targets using tags

I have a CloudWatch Event Rule that will trigger an SSM Run Command Document. The targets will be identified using tags. My resources are defined according to the following CloudFormation template: SSMRunCommandDocument: Type: AWS::SSM::Document …
1
2 3 4 5