lib/build-cloud/iamrole.rb in build-cloud-0.0.10 vs lib/build-cloud/iamrole.rb in build-cloud-0.0.11
- old
+ new
@@ -34,22 +34,23 @@
role = @iam.roles.new( @options )
role.save
@log.debug( role.inspect )
+ @iam.create_instance_profile( @options[:rolename] )
+
policies.each do |policy|
@log.debug( "Adding policy #{policy}" )
policy_document = JSON.parse( policy[:policy_document] )
@iam.put_role_policy( @options[:rolename], policy[:policy_name],
policy_document )
- @iam.create_instance_profile( @options[:rolename] )
- @iam.add_role_to_instance_profile( @options[:rolename], @options[:rolename] )
-
end
+
+ @iam.add_role_to_instance_profile( @options[:rolename], @options[:rolename] )
end
def read
@iam.roles.select { |r| r.rolename == @options[:rolename] }.first