Skip to content
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

Terraform serverless pattern - delayed-eventbridge-events #2375

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

farrjam
Copy link
Contributor

@farrjam farrjam commented Jul 13, 2024

Issue #2376, if available:

Description of changes:
It is initial commit for creating terraform serverless pattern of delayed-eventbridge-events. This terraform pattern listens for EventBridge events, processes them and creates schedules for every user. 24 hours after user has been created a schedule is run that publishes events directly into EventBridge.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

{
"title": "Delayed EventBridge events with EventBridge Scheduler",
"description": "Setup future EventBridge events with EventBridge Scheduler",
"language": "",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add language

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/delayed-eventbridge-events-terraform",
"templateURL": "serverless-patterns/delayed-eventbridge-events-terraform",
"projectFolder": "delayed-eventbridge-events-terraform",
"templateFile": "delayed-eventbridge-events-terraform/main.tf"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove folder name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

"name": "Farrukh Jamal",
"image": "https://media.licdn.com/dms/image/C5103AQHH_uSeGxOlZw/profile-displayphoto-shrink_400_400/0/1570698220038?e=1726099200&v=beta&t=7HUDKvPyM5GbBA1eOhVGB9POwFhXC3v87-vrqCIk1d0",
"bio": "Cloud Engineer at AWS based in the Australia.",
"linkedin": "https://www.linkedin.com/in/farrukhjamal/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only LinkedIn ID is required

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

# Function that listens to schedule directly onto EventBridge and "email a customer" as an example

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

aws events put-events --entries "Source='myapp.users',DetailType='UserCreated',Detail='{\"id\": \"test-customer-id\", \"firstName\": \"FirstName\", \"lastName\": \"LastName\"}',EventBusName='<custom-event-bus-ARN>'"
```

2. Check the CloudWatch metrics of `UserCreatedRule` and `UserCreated24HoursAgoRule` EventBridge rule and `SchedulesForUsers24HoursAfterCreation` EventBridge Scheduler Group. Also, check the CloudWatch Logs of Lambda Functions which are targets of corresponding `UserCreatedRule` and `UserCreated24HoursAgoRule` EventBridge rules.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you could add a command like aws logs start-live-tail . . . to check Lambda Function logs, it would be helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added command

@parikhudit
Copy link
Contributor

@farrjam Thanks for the contribution PR. I can see following two patterns as a part of this PR

  • delayed-eventbridge-events-terraform
  • eventbridge-pipes-sqs-to-stepfunctions-terraform

It is recommended to have one PR per pattern. Could you kindly remove changes for pattern eventbridge-pipes-sqs-to-stepfunctions-terraform from this PR? Also, I've added few minor comments to pattern delayed-eventbridge-events-terraform.

@farrjam farrjam force-pushed the farrjam-feature-delayed-eventbridge-events-terraform branch from 11815f3 to f562101 Compare August 5, 2024 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants