Skip to content

Commit

Permalink
Merge pull request #79 from Clever/tag-activities
Browse files Browse the repository at this point in the history
tag activities, take two
  • Loading branch information
rgarcia authored Sep 9, 2019
2 parents ff29845 + f06200d commit edd45bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.5
0.3.6
14 changes: 13 additions & 1 deletion cmd/sfncli/sfncli.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,27 @@ func main() {
}()

// register the activity with AWS (it might already exist, which is ok)
activityTags := tagsFromEnv()
sfnapi := sfn.New(session.New(), aws.NewConfig().WithRegion(*region))
createOutput, err := sfnapi.CreateActivityWithContext(mainCtx, &sfn.CreateActivityInput{
Name: activityName,
Tags: tagsFromEnv(),
Tags: activityTags,
})
if err != nil {
fmt.Printf("error creating activity: %s\n", err)
os.Exit(1)
}

// if the activity already exists, tags won't be applied, so explicitly
// set tags here
if _, err := sfnapi.TagResourceWithContext(mainCtx, &sfn.TagResourceInput{
ResourceArn: createOutput.ActivityArn,
Tags: activityTags,
}); err != nil {
fmt.Printf("error tagging activity: %s\n", err)
os.Exit(1)
}

log.InfoD("startup", logger.M{
"activity": *createOutput.ActivityArn,
"worker-name": *workerName,
Expand Down

0 comments on commit edd45bc

Please sign in to comment.