2

I have a step function which defined with jobs definition in java.

I wanna add an async run bash script which trying to move the data from efs to s3 bucket. What I did: 1. Login the the ec2 instance which has efs data mounted; 2. run the data move bash script;

The disadvantage of it is I need daily manually run this script. So, I wanna know if there is a way to run this script from step function since all the efs data are generated from the job submitted to this step function.

Paolo
  • 13,742
  • 6
  • 28
  • 51
Deritha
  • 55
  • 1
  • 7
  • Can you clarify? You want to run a script on some instance(s) based on a trigger from step function? – Marcin May 20 '20 at 00:05
  • Hello, try to run a lambda with python and the os module there. Ref.: https://stackoverflow.com/a/4256153/7348119 – Luigi Lopez May 20 '20 at 00:07

1 Answers1

3

You cannot directly however the following should work for you:

  • Step to call a Lambda function
  • Have Lambda run a Systems Manager Run Command
  • Wait for run command to be completed successfully, before returning success or error.

Either write your own Run Command Document or instead take a look at AWS-RunShellScript document.

Chris Williams
  • 27,937
  • 4
  • 22
  • 50