Reputation: 177
I have Lambda written in Golang. Lambda does some action and invoke Step Function. I have hard coded Step Function ARN in the code. I don't like this solution and would like to improve it. How it works right now:
arn := aws.String(sfnArn) // e.g: arn:aws:states:us-east-1:123:stateMachine:machine-name
params := &sfn.StartExecutionInput{Input: input, Name: name, StateMachineArn: arn}
output, err := client.StartExecution(params)
Any idea how to improve it? I'm using Terraform so maybe there is any option to pass ARN through TF?
Upvotes: 1
Views: 412
Reputation: 21530
There are a lot of options how to solve this issue. So I am going to name the once that come to my mind with focus of leveraging AWS services.
There are obviously a million more options. You could read a configuration file from S3 or EFS or bundle a static configuration file with your Lambda or query HTTP based API to read that value.
Upvotes: 2