AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Simulate how a set of IAM policies and optionally a resource-based policy works with a list of API actions and AWS resources to determine the policies' effective permissions. The policies are provided as strings.

The simulation does not perform the API actions; it only checks the authorization to determine if the simulated policies allow or deny the actions.

If you want to simulate existing policies attached to an IAM user, group, or role, use SimulatePrincipalPolicy instead.

Context keys are variables maintained by AWS and its services that provide details about the context of an API query request. You can use the Condition element of an IAM policy to evaluate context keys. To get the list of context keys that the policies require for correct simulation, use GetContextKeysForCustomPolicy.

If the output is long, you can use MaxItems and Marker parameters to paginate the results.

Note:

For PCL and Unity this operation is only available in asynchronous form. Please refer to SimulateCustomPolicyAsync.

Namespace: Amazon.IdentityManagement
Assembly: AWSSDK.IdentityManagement.dll
Version: 3.x.y.z

Syntax

C#
public abstract SimulateCustomPolicyResponse SimulateCustomPolicy(
         SimulateCustomPolicyRequest request
)
Parameters
request
Type: Amazon.IdentityManagement.Model.SimulateCustomPolicyRequest

Container for the necessary parameters to execute the SimulateCustomPolicy service method.

Return Value
The response from the SimulateCustomPolicy service method, as returned by IdentityManagementService.

Exceptions

ExceptionCondition
InvalidInputException The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
PolicyEvaluationException The request failed because a provided policy could not be successfully evaluated. An additional detailed message indicates the source of the failure.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

Unity:
Supported Versions: 4.6 and above
Supported Platforms: Android, iOS, Standalone

See Also