Sha256: 821f6f17d4df900fddfc4c82e735b5580c5b2ad0550866e495592552a828178c

Contents?: true

Size: 1.66 KB

Versions: 76

Compression:

Stored size: 1.66 KB

Contents

module Fog
  module AWS
    class IAM
        # At the moment this is the only policy you can use
        EC2_ASSUME_ROLE_POLICY = <<-JSON
{
  "Version":"2008-10-17",
  "Statement":[
      {
        "Effect":"Allow",
        "Principal":{
          "Service":["ec2.amazonaws.com"]
        },
        "Action":["sts:AssumeRole"]
      }
  ]
}
        JSON

      class Real
        require 'fog/aws/parsers/iam/single_role'

        # Creates a new role for your AWS account
        # 
        # ==== Parameters
        # * RoleName<~String>: name of the role to create 
        # * AssumeRolePolicyDocument<~String>: The policy that grants an entity permission to assume the role.
        # * Path<~String>: This parameter is optional. If it is not included, it defaults to a slash (/).
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'Role'<~Hash>:
        #       * 'Arn'<~String> -
        #       * 'AssumeRolePolicyDocument'<~String<  
        #       * 'Path'<~String> -
        #       * 'RoleId'<~String> -
        #       * 'RoleName'<~String> -
        #     * 'RequestId'<~String> - Id of the request
        #
        # ==== See Also
        # http://docs.amazonwebservices.com/IAM/latest/APIReference/API_CreateRole.html
        #
        def create_role(role_name, assume_role_policy_document, path = '/')
          request(
            'Action'    => 'CreateRole',
            'RoleName'  => role_name,
            'AssumeRolePolicyDocument'      => assume_role_policy_document,
            'Path'      => path,
            :parser     => Fog::Parsers::AWS::IAM::SingleRole.new
          )
        end

      end
    end
  end
end

Version data entries

76 entries across 76 versions & 11 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/aws/requests/iam/create_role.rb
fog-1.20.0 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/aws/requests/iam/create_role.rb
fog-1.19.0 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/aws/requests/iam/create_role.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/aws/requests/iam/create_role.rb