Class: DrawCloud::IAMUser
Instance Attribute Summary collapse
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#login_profile ⇒ Object
Returns the value of attribute login_profile.
-
#name ⇒ Object
Returns the value of attribute name.
-
#password ⇒ Object
Returns the value of attribute password.
-
#path ⇒ Object
Returns the value of attribute path.
-
#policies ⇒ Object
Returns the value of attribute policies.
Attributes inherited from Base
#as_groups, #as_launch_configurations, #deletion_policy, #depends_on, #ec2_instances, #elastic_ips, #gateways, #iam_access_keys, #iam_policies, #iam_users, #mappings, #metadata, #network_acls, #network_interfaces, #outputs, #parameters, #parent, #rdses, #resources, #route_tables, #security_groups, #sns_topics, #subnets, #vpcs, #wait_handles
Instance Method Summary collapse
- #iam_user ⇒ Object
-
#initialize(name, options = {}, &block) ⇒ IAMUser
constructor
A new instance of IAMUser.
- #load_into_config(config) ⇒ Object
- #to_h ⇒ Object
Methods inherited from Base
#[], #accessor, #add_standard_properties, #create_as_group, #create_as_launch_configuration, #create_ec2_instance, #create_ec2_instance_template, #create_elastic_ip, #create_iam_access_key, #create_iam_policy, #create_iam_user, #create_mapping, #create_network_acl, #create_network_interface, #create_output, #create_parameter, #create_rds, #create_route_table, #create_security_group, #create_service, #create_sns_topic, #create_subnet, #create_vpc, #create_wait_handle, #ref, #resource_name
Methods included from Locations
Methods included from Utilities
#desplice, #fnbase64, #fngetatt, #fnjoin, #hash_to_tag_array, #region, #resource_style, #splice, #stack_name
Constructor Details
#initialize(name, options = {}, &block) ⇒ IAMUser
Returns a new instance of IAMUser.
23 24 25 26 27 28 |
# File 'lib/draw_cloud/iam_user.rb', line 23 def initialize(name, ={}, &block) @name = name @groups = [] @policies = [] super(, &block) end |
Instance Attribute Details
#groups ⇒ Object
Returns the value of attribute groups.
21 22 23 |
# File 'lib/draw_cloud/iam_user.rb', line 21 def groups @groups end |
#login_profile ⇒ Object
Returns the value of attribute login_profile.
21 22 23 |
# File 'lib/draw_cloud/iam_user.rb', line 21 def login_profile @login_profile end |
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/draw_cloud/iam_user.rb', line 21 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
21 22 23 |
# File 'lib/draw_cloud/iam_user.rb', line 21 def password @password end |
#path ⇒ Object
Returns the value of attribute path.
21 22 23 |
# File 'lib/draw_cloud/iam_user.rb', line 21 def path @path end |
#policies ⇒ Object
Returns the value of attribute policies.
21 22 23 |
# File 'lib/draw_cloud/iam_user.rb', line 21 def policies @policies end |
Instance Method Details
#iam_user ⇒ Object
30 31 32 |
# File 'lib/draw_cloud/iam_user.rb', line 30 def iam_user self end |
#load_into_config(config) ⇒ Object
34 35 36 37 |
# 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 ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# 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 |