Class: GitlabConfig::IamRole

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab_config/aws/iam_role.rb

Overview

Iam role is used to get the credentials for the node and use them in the configuration elsewhere

In order to get the correct credentials it is necessary to call an AWS api that will return them. See: docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

Constant Summary collapse

AWS_URL =
'http://169.254.169.254/latest/meta-data/iam/security-credentials'

Instance Method Summary collapse

Constructor Details

#initialize(role) ⇒ IamRole



14
15
16
# File 'lib/gitlab_config/aws/iam_role.rb', line 14

def initialize(role)
  @role = role
end

Instance Method Details

#keyObject



18
19
20
21
# File 'lib/gitlab_config/aws/iam_role.rb', line 18

def key
  get_credentials if @key.nil?
  @key
end

#secretObject



23
24
25
26
# File 'lib/gitlab_config/aws/iam_role.rb', line 23

def secret
  get_credentials if @secret.nil?
  @secret
end