skip to Main Content

https://www.jnto.go.jp/jpn/statistics/since2003_visitor_arrivals.xlsx

I have the above public website. The website or file is updated once a month by the admin of that website. Can you please tell me how to trigger State machine when that above website is updated?

I have looked at API Gateway but it only assign State machine an endpoint to trigger and not triggering the state machine from an endpoint.

2

Answers


  1. You can use AWS Eventbridge to trigger your AWS step function. Create a rule eg. If the last logged in date is changed then an event is triggered which in turn triggers the state function.

    More methods can be found here

    Login or Signup to reply.
  2. Because the website is outside your AWS environment, you must periodically poll its information to check if the file was updated.

    There’s no out-of-the-box solution in AWS. One way to achieve it:

    • EventBridge Scheduler: Trigger a lambda every week (eg. Friday)
    • DynamoDB Table: To track the "Last-Modified" value
    • Lambda: Fetch the URL and check the "Last-Modified" header. Compare it with the value in DynamoDB, it if is different, update DynamoDB and trigger the Step Functions workflow via AWS SDK

    References:


    Updates 2023-03-15

    I shared a demo-ish code using CDK on:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search