class DrawCloud::IAMUser

Attributes

groups[RW]
login_profile[RW]
name[RW]
password[RW]
path[RW]
policies[RW]

Public Class Methods

new(name, options={}, &block) click to toggle source
Calls superclass method DrawCloud::Base::new
# File lib/draw_cloud/iam_user.rb, line 23
def initialize(name, options={}, &block)
  @name = name
  @groups = []
  @policies = []
  super(options, &block)
end

Public Instance Methods

iam_user() click to toggle source
# File lib/draw_cloud/iam_user.rb, line 30
def iam_user
  self
end
load_into_config(config) click to toggle source
Calls superclass method DrawCloud::Base#load_into_config
# File lib/draw_cloud/iam_user.rb, line 34
def load_into_config(config)
  config.cf_add_resource resource_name, self
  super(config)
end
to_h() click to toggle source
# File lib/draw_cloud/iam_user.rb, line 39
def to_h
  h = {
    "Type" => "AWS::IAM::User",
    "Properties" => {
    }
  }
  h["Properties"]["Path"] = path if path
  h["Properties"]["Groups"] = groups.collect {|g| DrawCloud.ref(g)} if (groups && !groups.empty?)
  h["Properties"]["Policies"] = policies.collect {|p| DrawCloud.ref(p)} if (policies && !policies.empty?)
  h["Properties"]["LoginProfile"] = login_profile if login_profile
  h["Properties"]["LoginProfile"] = {"Password" => password} if (password && !h["Properties"].key?("LoginProfile"))
  add_standard_properties(h)
end