Amazon.IdentityManagement.AmazonIdentityManagementServiceClient.AttachRolePolicy C# (CSharp) Method

AttachRolePolicy() public method

Attaches the specified managed policy to the specified IAM role.

When you attach a managed policy to a role, the managed policy becomes part of the role's permission (access) policy. You cannot use a managed policy as the role's trust policy. The role's trust policy is created at the same time as the role, using CreateRole. You can update a role's trust policy using UpdateAssumeRolePolicy.

Use this API to attach a managed policy to a role. To embed an inline policy in a role, use PutRolePolicy. For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide.

/// The request was rejected because an invalid or out-of-range value was supplied for /// an input parameter. /// /// The request was rejected because it attempted to create resources beyond the current /// AWS account limits. The error message describes the limit exceeded. /// /// The request was rejected because it referenced an entity that does not exist. The /// error message describes the entity. /// /// The request processing has failed because of an unknown error, exception or failure. ///
public AttachRolePolicy ( AttachRolePolicyRequest request ) : AttachRolePolicyResponse
request Amazon.IdentityManagement.Model.AttachRolePolicyRequest Container for the necessary parameters to execute the AttachRolePolicy service method.
return AttachRolePolicyResponse
        public AttachRolePolicyResponse AttachRolePolicy(AttachRolePolicyRequest request)
        {
            var marshaller = new AttachRolePolicyRequestMarshaller();
            var unmarshaller = AttachRolePolicyResponseUnmarshaller.Instance;

            return Invoke<AttachRolePolicyRequest,AttachRolePolicyResponse>(request, marshaller, unmarshaller);
        }
AmazonIdentityManagementServiceClient