0

Is there a way to get ARN of a Step Functions "Activity" from the "Name" of the activity using Java? For example, the ARN is in the following format:

arn:aws:states:us-east-1:acct-number:activity:activity-name

Is there an API available that looks something like this: getActivityArn(activityName)

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
DilTeam
  • 2,551
  • 9
  • 42
  • 69
  • Of course, this will work but we want to avoid specifying 'account number' in our properties file. DevOps team doesn't like that. Will look into 'listActivities' as suggested by John Rotenstein. – DilTeam Mar 16 '18 at 13:53
  • From inside any EC2 instance (though not from a Lambda function), you can also learn the account number associated with the instance, using the [instance identity document from the instance metadata service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html), e.g. `curl -s -S http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .accountId`. – Michael - sqlbot Mar 16 '18 at 14:20
  • @Michael-sqlbot - Now do you see how complex your suggestion is? Wouldn't 'listActivities' be a better option? – DilTeam Mar 16 '18 at 16:14

1 Answers1

1

There is no function like that, but you could use listActivities(), which returns a list of activities including their Name and ARN. You could then filter/iterate the list to extract an ARN given a Name.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470