I'm trying to convert a Capistrano deploy script to OpsWorks recipes. I'm doing so far so good, except for Slack integration. In the Capistrano script, it says

John Doe is deploying FooProject from Master to Production

via Slack, alerting the team if someone is doing deployment somewhere.

Currently, what I can do is create a deploy/before_migrate.rb to say

Deploying FooProject to Production

Is there a way to know the IAM User ID / User Name of the person invoking the deploy?

(If you notice, I also need to get the branch being deployed, but I'd reserve that for another post.)


I got it. It can be accessed via

deploying_user = node['deploy']['foo_app']['deploying_user']

The resulting string will be of the format


Where XXXXXXXXXXXX is your Amazon IAM ID, and johndoe is your IAM Username.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.