class GeoEngineer::Resources::AwsIamRole

AwsIamGroup aws_iam_role terrform resource,

{www.terraform.io/docs/providers/aws/r/iam_role.html Terraform Docs}

Public Class Methods

_fetch_remote_resources(provider) click to toggle source
# File lib/geoengineer/resources/aws_iam_role.rb, line 37
def self._fetch_remote_resources(provider)
  roles = AwsClients.iam(provider).list_roles['roles'].map(&:to_h)
  roles.map do |r|
    r.merge({ name: r[:role_name],
              _geo_id: r[:role_name],
              _terraform_id: r[:role_name],
              assume_role_policy: URI.decode(r[:assume_role_policy_document]) })
  end
end

Public Instance Methods

_assume_role_policy_file(path, binding_obj = nil) click to toggle source
# File lib/geoengineer/resources/aws_iam_role.rb, line 29
def _assume_role_policy_file(path, binding_obj = nil)
  _json_file(:assume_role_policy, path, binding_obj)
end
support_tags?() click to toggle source
# File lib/geoengineer/resources/aws_iam_role.rb, line 33
def support_tags?
  false
end
to_terraform_state() click to toggle source
# File lib/geoengineer/resources/aws_iam_role.rb, line 14
def to_terraform_state
  tfstate = super

  arn = NullObject.maybe(remote_resource).arn
  assume_role_policy = NullObject.maybe(remote_resource).assume_role_policy

  attributes = {}
  attributes['arn'] = arn if arn
  attributes['force_detach_policies'] = force_detach_policies || 'false'
  attributes['assume_role_policy'] = _normalize_json(assume_role_policy) if assume_role_policy

  tfstate[:primary][:attributes] = attributes
  tfstate
end