Sha256: 0335404674fa2bf00af4510503504cadc7b4e2bd0e3a7a4aba74892b5bc5b0b1

Contents?: true

Size: 1.33 KB

Versions: 55

Compression:

Stored size: 1.33 KB

Contents

module Fog
  module AWS
    class IAM
      class Real
        require 'fog/aws/parsers/iam/basic'

        # Creates a managed policy
        #
        # ==== Parameters
        # * policy_document<~Hash>: policy document, see: http://docs.amazonwebservices.com/IAM/latest/UserGuide/PoliciesOverview.html
        # * role_name<~String>: name of role to update
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'RequestId'<~String> - Id of the request
        #
        # ==== See Also
        # http://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateAssumeRolePolicy.html
        #
        def update_assume_role_policy(policy_document, role_name)
          request({
            'Action'          => 'UpdateAssumeRolePolicy',
            'PolicyDocument'  => Fog::JSON.encode(policy_document),
            'RoleName'        => role_name,
            :parser           => Fog::Parsers::AWS::IAM::Basic.new
          }.reject {|_, value| value.nil?})
        end
        
        class Mock
          def update_assume_role_policy(policy_document, role_name)
            Excon::Response.new.tap do |response|
              response.body = { 'RequestId' => Fog::AWS::Mock.request_id }
              response.status = 200
            end
          end
        end
      end
    end
  end
end

Version data entries

55 entries across 53 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-aws-2.0.1/lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-3.0.0 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-2.0.1 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-2.0.0 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-1.4.1 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-1.4.0 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-1.3.0 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-1.2.1 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-1.2.0 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-1.1.0 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-1.0.0 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-0.13.0 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-0.12.0 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-0.11.0 lib/fog/aws/requests/iam/update_assume_role_policy.rb
fog-aws-0.10.0 lib/fog/aws/requests/iam/update_assume_role_policy.rb