public class SimulatePrincipalPolicyRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
SimulatePrincipalPolicy operation
.
Simulate the set of IAM policies attached to an IAM entity against a list of API actions and AWS resources to determine the policies' effective permissions. The entity can be an IAM user, group, or role. If you specify a user, then the simulation also includes all of the policies attached to groups that the user is a member of.
You can optionally include a list of one or more additional policies specified as strings to include in the simulation. If you want to simulate only policies specified as strings, use SimulateCustomPolicy instead.
The simulation does not perform the API actions, it only checks the authorization to determine if the simulated policies allow or deny the actions.
Note: This API discloses information about the permissions granted to other users. If you do not want users to see other user's permissions, then consider allowing them to use SimulateCustomPolicy instead.
Context keys are variables maintained by AWS and its services that
provide details about the context of an API query request, and can be
evaluated by using the Condition
element of an IAM
policy. To get the list of context keys required by the policies to
simulate them correctly, use GetContextKeysForPrincipalPolicy.
If the output is long, you can paginate the results using the
MaxItems
and Marker
parameters.
NOOP
Constructor and Description |
---|
SimulatePrincipalPolicyRequest() |
Modifier and Type | Method and Description |
---|---|
SimulatePrincipalPolicyRequest |
clone()
Creates a shallow clone of this request.
|
boolean |
equals(Object obj) |
List<String> |
getActionNames()
A list of names of API actions to evaluate in the simulation.
|
List<ContextEntry> |
getContextEntries()
A list of context keys and corresponding values that are used by the
simulation.
|
String |
getMarker()
Use this parameter only when paginating results and only after you
receive a response indicating that the results are truncated.
|
Integer |
getMaxItems()
Use this only when paginating results to indicate the maximum number
of items you want in the response.
|
List<String> |
getPolicyInputList()
An optional list of additional policy documents to include in the
simulation.
|
String |
getPolicySourceArn()
The Amazon Resource Name (ARN) of a user, group, or role whose
policies you want to include in the simulation.
|
List<String> |
getResourceArns()
A list of ARNs of AWS resources to include in the simulation.
|
int |
hashCode() |
void |
setActionNames(Collection<String> actionNames)
A list of names of API actions to evaluate in the simulation.
|
void |
setContextEntries(Collection<ContextEntry> contextEntries)
A list of context keys and corresponding values that are used by the
simulation.
|
void |
setMarker(String marker)
Use this parameter only when paginating results and only after you
receive a response indicating that the results are truncated.
|
void |
setMaxItems(Integer maxItems)
Use this only when paginating results to indicate the maximum number
of items you want in the response.
|
void |
setPolicyInputList(Collection<String> policyInputList)
An optional list of additional policy documents to include in the
simulation.
|
void |
setPolicySourceArn(String policySourceArn)
The Amazon Resource Name (ARN) of a user, group, or role whose
policies you want to include in the simulation.
|
void |
setResourceArns(Collection<String> resourceArns)
A list of ARNs of AWS resources to include in the simulation.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
SimulatePrincipalPolicyRequest |
withActionNames(Collection<String> actionNames)
A list of names of API actions to evaluate in the simulation.
|
SimulatePrincipalPolicyRequest |
withActionNames(String... actionNames)
A list of names of API actions to evaluate in the simulation.
|
SimulatePrincipalPolicyRequest |
withContextEntries(Collection<ContextEntry> contextEntries)
A list of context keys and corresponding values that are used by the
simulation.
|
SimulatePrincipalPolicyRequest |
withContextEntries(ContextEntry... contextEntries)
A list of context keys and corresponding values that are used by the
simulation.
|
SimulatePrincipalPolicyRequest |
withMarker(String marker)
Use this parameter only when paginating results and only after you
receive a response indicating that the results are truncated.
|
SimulatePrincipalPolicyRequest |
withMaxItems(Integer maxItems)
Use this only when paginating results to indicate the maximum number
of items you want in the response.
|
SimulatePrincipalPolicyRequest |
withPolicyInputList(Collection<String> policyInputList)
An optional list of additional policy documents to include in the
simulation.
|
SimulatePrincipalPolicyRequest |
withPolicyInputList(String... policyInputList)
An optional list of additional policy documents to include in the
simulation.
|
SimulatePrincipalPolicyRequest |
withPolicySourceArn(String policySourceArn)
The Amazon Resource Name (ARN) of a user, group, or role whose
policies you want to include in the simulation.
|
SimulatePrincipalPolicyRequest |
withResourceArns(Collection<String> resourceArns)
A list of ARNs of AWS resources to include in the simulation.
|
SimulatePrincipalPolicyRequest |
withResourceArns(String... resourceArns)
A list of ARNs of AWS resources to include in the simulation.
|
copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public String getPolicySourceArn()
Constraints:
Length: 20 - 2048
public void setPolicySourceArn(String policySourceArn)
Constraints:
Length: 20 - 2048
policySourceArn
- The Amazon Resource Name (ARN) of a user, group, or role whose
policies you want to include in the simulation. If you specify a user,
group, or role, the simulation includes all policies associated with
that entity. If you specify a user, the simulation also includes all
policies attached to any groups the user is a member of.public SimulatePrincipalPolicyRequest withPolicySourceArn(String policySourceArn)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 20 - 2048
policySourceArn
- The Amazon Resource Name (ARN) of a user, group, or role whose
policies you want to include in the simulation. If you specify a user,
group, or role, the simulation includes all policies associated with
that entity. If you specify a user, the simulation also includes all
policies attached to any groups the user is a member of.public List<String> getPolicyInputList()
public void setPolicyInputList(Collection<String> policyInputList)
policyInputList
- An optional list of additional policy documents to include in the
simulation. Each document is specified as a string containing the
complete, valid JSON text of an IAM policy.public SimulatePrincipalPolicyRequest withPolicyInputList(String... policyInputList)
NOTE: This method appends the values to the existing list (if
any). Use setPolicyInputList(java.util.Collection)
or withPolicyInputList(java.util.Collection)
if you want to override
the existing values.
Returns a reference to this object so that method calls can be chained together.
policyInputList
- An optional list of additional policy documents to include in the
simulation. Each document is specified as a string containing the
complete, valid JSON text of an IAM policy.public SimulatePrincipalPolicyRequest withPolicyInputList(Collection<String> policyInputList)
Returns a reference to this object so that method calls can be chained together.
policyInputList
- An optional list of additional policy documents to include in the
simulation. Each document is specified as a string containing the
complete, valid JSON text of an IAM policy.public List<String> getActionNames()
iam:CreateUser
.iam:CreateUser
.public void setActionNames(Collection<String> actionNames)
iam:CreateUser
.actionNames
- A list of names of API actions to evaluate in the simulation. Each
action is evaluated for each resource. Each action must include the
service identifier, such as iam:CreateUser
.public SimulatePrincipalPolicyRequest withActionNames(String... actionNames)
iam:CreateUser
.
NOTE: This method appends the values to the existing list (if
any). Use setActionNames(java.util.Collection)
or withActionNames(java.util.Collection)
if you want to override the
existing values.
Returns a reference to this object so that method calls can be chained together.
actionNames
- A list of names of API actions to evaluate in the simulation. Each
action is evaluated for each resource. Each action must include the
service identifier, such as iam:CreateUser
.public SimulatePrincipalPolicyRequest withActionNames(Collection<String> actionNames)
iam:CreateUser
.
Returns a reference to this object so that method calls can be chained together.
actionNames
- A list of names of API actions to evaluate in the simulation. Each
action is evaluated for each resource. Each action must include the
service identifier, such as iam:CreateUser
.public List<String> getResourceArns()
*
(all resources). Each API in the ActionNames
parameter is
evaluated for each resource in this list. The simulation determines
the access result (allowed or denied) of each combination and reports
it in the response.*
(all resources). Each API in the ActionNames
parameter is
evaluated for each resource in this list. The simulation determines
the access result (allowed or denied) of each combination and reports
it in the response.public void setResourceArns(Collection<String> resourceArns)
*
(all resources). Each API in the ActionNames
parameter is
evaluated for each resource in this list. The simulation determines
the access result (allowed or denied) of each combination and reports
it in the response.resourceArns
- A list of ARNs of AWS resources to include in the simulation. If this
parameter is not provided then the value defaults to *
(all resources). Each API in the ActionNames
parameter is
evaluated for each resource in this list. The simulation determines
the access result (allowed or denied) of each combination and reports
it in the response.public SimulatePrincipalPolicyRequest withResourceArns(String... resourceArns)
*
(all resources). Each API in the ActionNames
parameter is
evaluated for each resource in this list. The simulation determines
the access result (allowed or denied) of each combination and reports
it in the response.
NOTE: This method appends the values to the existing list (if
any). Use setResourceArns(java.util.Collection)
or withResourceArns(java.util.Collection)
if you want to override the
existing values.
Returns a reference to this object so that method calls can be chained together.
resourceArns
- A list of ARNs of AWS resources to include in the simulation. If this
parameter is not provided then the value defaults to *
(all resources). Each API in the ActionNames
parameter is
evaluated for each resource in this list. The simulation determines
the access result (allowed or denied) of each combination and reports
it in the response.public SimulatePrincipalPolicyRequest withResourceArns(Collection<String> resourceArns)
*
(all resources). Each API in the ActionNames
parameter is
evaluated for each resource in this list. The simulation determines
the access result (allowed or denied) of each combination and reports
it in the response.
Returns a reference to this object so that method calls can be chained together.
resourceArns
- A list of ARNs of AWS resources to include in the simulation. If this
parameter is not provided then the value defaults to *
(all resources). Each API in the ActionNames
parameter is
evaluated for each resource in this list. The simulation determines
the access result (allowed or denied) of each combination and reports
it in the response.public List<ContextEntry> getContextEntries()
Condition
element in one of the simulated IAM permission
policies, the corresponding value is supplied.Condition
element in one of the simulated IAM permission
policies, the corresponding value is supplied.public void setContextEntries(Collection<ContextEntry> contextEntries)
Condition
element in one of the simulated IAM permission
policies, the corresponding value is supplied.contextEntries
- A list of context keys and corresponding values that are used by the
simulation. Whenever a context key is evaluated by a
Condition
element in one of the simulated IAM permission
policies, the corresponding value is supplied.public SimulatePrincipalPolicyRequest withContextEntries(ContextEntry... contextEntries)
Condition
element in one of the simulated IAM permission
policies, the corresponding value is supplied.
NOTE: This method appends the values to the existing list (if
any). Use setContextEntries(java.util.Collection)
or withContextEntries(java.util.Collection)
if you want to override the
existing values.
Returns a reference to this object so that method calls can be chained together.
contextEntries
- A list of context keys and corresponding values that are used by the
simulation. Whenever a context key is evaluated by a
Condition
element in one of the simulated IAM permission
policies, the corresponding value is supplied.public SimulatePrincipalPolicyRequest withContextEntries(Collection<ContextEntry> contextEntries)
Condition
element in one of the simulated IAM permission
policies, the corresponding value is supplied.
Returns a reference to this object so that method calls can be chained together.
contextEntries
- A list of context keys and corresponding values that are used by the
simulation. Whenever a context key is evaluated by a
Condition
element in one of the simulated IAM permission
policies, the corresponding value is supplied.public Integer getMaxItems()
IsTruncated
response
element is true
. This parameter is optional. If you do
not include it, it defaults to 100. Note that IAM might return fewer
results, even when there are more results available. If this is the
case, the IsTruncated
response element returns
true
and Marker
contains a value to include
in the subsequent call that tells the service where to continue from.
Constraints:
Range: 1 - 1000
IsTruncated
response
element is true
. This parameter is optional. If you do
not include it, it defaults to 100. Note that IAM might return fewer
results, even when there are more results available. If this is the
case, the IsTruncated
response element returns
true
and Marker
contains a value to include
in the subsequent call that tells the service where to continue from.
public void setMaxItems(Integer maxItems)
IsTruncated
response
element is true
. This parameter is optional. If you do
not include it, it defaults to 100. Note that IAM might return fewer
results, even when there are more results available. If this is the
case, the IsTruncated
response element returns
true
and Marker
contains a value to include
in the subsequent call that tells the service where to continue from.
Constraints:
Range: 1 - 1000
maxItems
- Use this only when paginating results to indicate the maximum number
of items you want in the response. If there are additional items
beyond the maximum you specify, the IsTruncated
response
element is true
. This parameter is optional. If you do
not include it, it defaults to 100. Note that IAM might return fewer
results, even when there are more results available. If this is the
case, the IsTruncated
response element returns
true
and Marker
contains a value to include
in the subsequent call that tells the service where to continue from.
public SimulatePrincipalPolicyRequest withMaxItems(Integer maxItems)
IsTruncated
response
element is true
. This parameter is optional. If you do
not include it, it defaults to 100. Note that IAM might return fewer
results, even when there are more results available. If this is the
case, the IsTruncated
response element returns
true
and Marker
contains a value to include
in the subsequent call that tells the service where to continue from.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Range: 1 - 1000
maxItems
- Use this only when paginating results to indicate the maximum number
of items you want in the response. If there are additional items
beyond the maximum you specify, the IsTruncated
response
element is true
. This parameter is optional. If you do
not include it, it defaults to 100. Note that IAM might return fewer
results, even when there are more results available. If this is the
case, the IsTruncated
response element returns
true
and Marker
contains a value to include
in the subsequent call that tells the service where to continue from.
public String getMarker()
Marker
element in the response you
received to inform the next call about where to start.
Constraints:
Length: 1 - 320
Pattern: [\u0020-\u00FF]+
Marker
element in the response you
received to inform the next call about where to start.public void setMarker(String marker)
Marker
element in the response you
received to inform the next call about where to start.
Constraints:
Length: 1 - 320
Pattern: [\u0020-\u00FF]+
marker
- Use this parameter only when paginating results and only after you
receive a response indicating that the results are truncated. Set it
to the value of the Marker
element in the response you
received to inform the next call about where to start.public SimulatePrincipalPolicyRequest withMarker(String marker)
Marker
element in the response you
received to inform the next call about where to start.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 320
Pattern: [\u0020-\u00FF]+
marker
- Use this parameter only when paginating results and only after you
receive a response indicating that the results are truncated. Set it
to the value of the Marker
element in the response you
received to inform the next call about where to start.public String toString()
toString
in class Object
Object.toString()
public SimulatePrincipalPolicyRequest clone()
AmazonWebServiceRequest
clone
in class AmazonWebServiceRequest
Object.clone()
Copyright © 2015. All rights reserved.