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

Serverless pattern eventbridge schedule remove one time schedules cdk python #1992

Conversation

manikandanks2000
Copy link
Contributor

Issue #, if available:

Description of changes:
Remove completed Amazon EventBridge Schedules and sent notification using Amazon SNS

This pattern will create an Amazon EventBridge Scheduler and will run every five minutes and will use AWS Lambda to identify expired and completed Amazon Evenbridge Scheduler tasks that are expired 7 days or more and will send an SNS notification once the activity is completed. The pattern is deployed using the AWS Cloud Development Kit (AWS CDK) for Python.

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

Copy link

github-actions bot commented Jan 3, 2024

@undefined looks like you are missing the example-pattern.json file in your pattern.

You can find the example-pattern template here.

The file is used on ServerlessLand and is required. Once the file is added we can review the pattern.

Copy link
Contributor

@pputhran pputhran left a comment

Choose a reason for hiding this comment

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

This is missing some of the required files. Can you please check? Also can you expand how is this different from Automatically delete schedules upon completion with Amazon EventBridge Scheduler

@manikandanks2000
Copy link
Contributor Author

pattern file and project files updated and included in the merge request . thanks
blog referenced is providing steps on how to remove one time schedule using aws console and did not provide a CDK code for reference.

Copy link

github-actions bot commented Jan 4, 2024

@undefined your 'example-pattern.json' is missing some key fields, please review below and address any errors you have

  1. authors[0].linkedin: authors[0].linkedin. Please remove the URL in this property, only include the ID to your LinkedIn profile.

If you need any help, take a look at the example-pattern file.

Make the changes, and push your changes back to this pull request. When all automated checks are successful, the Serverless DA team will process your pull request.

Copy link
Contributor

@pputhran pputhran left a comment

Choose a reason for hiding this comment

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

linkedin should include just the ID not uri

"name": "Manikandan Karimanal",
"image": "https://drive.google.com/file/d/16r4jGGMpPhu4Igez-lzstIe-L5nJVMxf/view",
"bio": "Solution Architect @AWS",
"linkedin": "https://www.linkedin.com/in/manikandanks/"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please take a look at the error and fix the LinkedIn Id?

  '1. `authors[0].linkedin`: authors[0].linkedin. Please remove the URL in this property, only include the ID to your LinkedIn profile.\n'

Copy link
Contributor Author

@manikandanks2000 manikandanks2000 Jan 5, 2024

Choose a reason for hiding this comment

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

thanks for the input . fixed the example pattern file with LinkedIn id only.

Copy link

github-actions bot commented Jan 5, 2024

Valid pattern file found.

Reviewer you can view the pattern file here

Copy link
Contributor

@pputhran pputhran left a comment

Choose a reason for hiding this comment

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

requesting a few changes

```
2. Change directory to the pattern directory:
```
cd eventbridge-schedule-remove-one-time-schedule-to-sns-cdk-python
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be eventbridge-schedule-remove-one-time-schedules-cdk-python ?

Along with a schedule and topic, the CDK stack creates an IAM role and policy for Amazon EventBridge Scheduler to assume and send messages.

## Testing
After the stack has been deployed, you can verify Amazon EventBridge is successfully publishing to the topic by viewing the topics "NumberOfMessagesPublished" metric in CloudWatch and verifying positive data points.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add any screenshot here to make it clear?

@manikandanks2000
Copy link
Contributor Author

agreed. updated the folder names as advised.
architecture reference diagram available in img folder as below
/img/onetimeschedule-architecturediagram.png
let me know if this should be placed in the parent folder or otherwise.
thanks again

Copy link

github-actions bot commented Jan 9, 2024

Valid pattern file found.

Reviewer you can view the pattern file here

Copy link

github-actions bot commented Jan 9, 2024

Valid pattern file found.

Reviewer you can view the pattern file here

Fixed the projectFolder and templateFile
Copy link

github-actions bot commented Jan 9, 2024

Valid pattern file found.

Reviewer you can view the pattern file here

@pputhran
Copy link
Contributor

pputhran commented Jan 9, 2024

@manikandanks2000 I had to fix a couple of small changes in the example-pattern.json file. Please have a look and see if this applies to your other submissions as well. Rest looks good and this PR will be merged in soon. Thanks for your submission.

@manikandanks2000
Copy link
Contributor Author

thanks for your help and the changes made.

@julianwood julianwood merged commit 0e61056 into aws-samples:main Jan 22, 2024
2 checks passed
@manikandanks2000
Copy link
Contributor Author

@pputhran i see the project merged successfully. but the github project folder name need to be corrected as below. Let me know whether a new merge request is required to make this change.

https://serverlessland.com/patterns/eventbridge-schedule-remove-one-time-schedules-cdk-python

Incorrect path used :
https://github.com/aws-samples/serverless-patterns/tree/main/eventbridge-schedule-remove-onetime-schedule-to-sns-cdk-python

Correct path to be used :
https://github.com/aws-samples/serverless-patterns/tree/main/eventbridge-schedule-remove-one-time-schedules-cdk-python

@pputhran
Copy link
Contributor

pputhran commented Feb 4, 2024

Please open a new PR with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants