Class: LambdaWhenever::IamRole
- Inherits:
-
Object
- Object
- LambdaWhenever::IamRole
- Defined in:
- lib/lambda_whenever/iam_role.rb
Overview
The IamRole class is responsible for interacting with AWS IAM roles.
Instance Method Summary collapse
- #arn ⇒ Object
- #exists? ⇒ Boolean
-
#initialize(option) ⇒ IamRole
constructor
A new instance of IamRole.
Constructor Details
#initialize(option) ⇒ IamRole
Returns a new instance of IamRole.
6 7 8 9 10 11 |
# File 'lib/lambda_whenever/iam_role.rb', line 6 def initialize(option) client = option.iam_client @resource = Aws::IAM::Resource.new(client: client) @role_name = option.iam_role @role = resource.role(@role_name) end |
Instance Method Details
#arn ⇒ Object
13 14 15 |
# File 'lib/lambda_whenever/iam_role.rb', line 13 def arn role&.arn end |
#exists? ⇒ Boolean
17 18 19 20 21 |
# File 'lib/lambda_whenever/iam_role.rb', line 17 def exists? !!arn rescue Aws::IAM::Errors::NoSuchEntity false end |