Sha256: 945cd55c3c69303687978550b3fe11e2071d5027301544d78a63fe5aa856fec9

Contents?: true

Size: 822 Bytes

Versions: 13

Compression:

Stored size: 822 Bytes

Contents

module Jets::Resource::Iam
  class FunctionRole < Jets::Resource::Base
    include BaseRoleDefinition

    def initialize(task)
      @task = task
      @policy_definitions = task.iam_policy || [] # iam_policy contains policy definitions
      @managed_policy_definitions = task.managed_iam_policy || [] # managed_iam_policy contains policy definitions
    end

    def role_logical_id
      "{namespace}_iam_role".underscore
    end

    def role_name
      funcion_namespace = replacements[:namespace].underscore.dasherize
      "#{Jets.config.project_namespace}-#{funcion_namespace}-role" # camelized because used as template value
    end

    def replacements
      {
        namespace: "#{@task.class_name.gsub('::','')}#{@task.meth.to_s.camelize}", # camelized because can be used as value
      }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
jets-0.8.18 lib/jets/resource/iam/function_role.rb
jets-0.8.17 lib/jets/resource/iam/function_role.rb
jets-0.8.15 lib/jets/resource/iam/function_role.rb
jets-0.8.14 lib/jets/resource/iam/function_role.rb
jets-0.8.13 lib/jets/resource/iam/function_role.rb
jets-0.8.12 lib/jets/resource/iam/function_role.rb
jets-0.8.11 lib/jets/resource/iam/function_role.rb
jets-0.8.10 lib/jets/resource/iam/function_role.rb
jets-0.8.9 lib/jets/resource/iam/function_role.rb
jets-0.8.8 lib/jets/resource/iam/function_role.rb
jets-0.8.6 lib/jets/resource/iam/function_role.rb
jets-0.8.5 lib/jets/resource/iam/function_role.rb
jets-0.8.4 lib/jets/resource/iam/function_role.rb