0

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.)

Ardee Aram
  • 111
  • 4

1 Answers1

1

I got it. It can be accessed via

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

The resulting string will be of the format

arn:aws:iam::XXXXXXXXXXXX:user/johndoe

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

Ardee Aram
  • 111
  • 4