public class AttachRolePolicyRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
AttachRolePolicy operation
.
Attaches the specified managed policy to the specified role.
When you attach a managed policy to a role, the managed policy is used as the role's access (permissions) 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, refer to Managed Policies and Inline Policies in the Using IAM guide.
NOOP
Constructor and Description |
---|
AttachRolePolicyRequest() |
Modifier and Type | Method and Description |
---|---|
AttachRolePolicyRequest |
clone()
Creates a shallow clone of this request.
|
boolean |
equals(Object obj) |
String |
getPolicyArn()
The Amazon Resource Name (ARN).
|
String |
getRoleName()
The name (friendly name, not ARN) of the role to attach the policy to.
|
int |
hashCode() |
void |
setPolicyArn(String policyArn)
The Amazon Resource Name (ARN).
|
void |
setRoleName(String roleName)
The name (friendly name, not ARN) of the role to attach the policy to.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
AttachRolePolicyRequest |
withPolicyArn(String policyArn)
The Amazon Resource Name (ARN).
|
AttachRolePolicyRequest |
withRoleName(String roleName)
The name (friendly name, not ARN) of the role to attach the policy to.
|
copyBaseTo, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public String getRoleName()
Constraints:
Length: 1 - 64
Pattern: [\w+=,.@-]+
public void setRoleName(String roleName)
Constraints:
Length: 1 - 64
Pattern: [\w+=,.@-]+
roleName
- The name (friendly name, not ARN) of the role to attach the policy to.public AttachRolePolicyRequest withRoleName(String roleName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 64
Pattern: [\w+=,.@-]+
roleName
- The name (friendly name, not ARN) of the role to attach the policy to.public String getPolicyArn()
For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.
Constraints:
Length: 20 - 2048
For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.
public void setPolicyArn(String policyArn)
For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.
Constraints:
Length: 20 - 2048
policyArn
- The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS
resources. For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.
public AttachRolePolicyRequest withPolicyArn(String policyArn)
For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 20 - 2048
policyArn
- The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS
resources. For more information about ARNs, go to Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.
public String toString()
toString
in class Object
Object.toString()
public AttachRolePolicyRequest clone()
AmazonWebServiceRequest
clone
in class AmazonWebServiceRequest
Object.clone()
Copyright © 2015. All rights reserved.