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.
Creates an IAM role from the specified role template. The new role takes its configuration—including its name, path, trust policy, inline and managed policies, permissions boundary, tags, and maximum session duration—from the role template version that you specify. For more information about roles, see IAM roles in the IAM User Guide.
If the template version defines parameters, use the ReplacementValues parameter
to supply the values that the service substitutes into the role during creation.
For .NET Core this operation is only available in asynchronous form. Please refer to AcquireRoleAsync.
Namespace: Amazon.IdentityManagement
Assembly: AWSSDK.IdentityManagement.dll
Version: 3.x.y.z
public virtual AcquireRoleResponse AcquireRole( AcquireRoleRequest request )
Container for the necessary parameters to execute the AcquireRole service method.
| Exception | Condition |
|---|---|
| ConcurrentModificationException | The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again. |
| EntityAlreadyExistsException | The request was rejected because it attempted to create a resource that already exists. |
| InvalidInputException | The request was rejected because an invalid or out-of-range value was supplied for an input parameter. |
| LimitExceededException | The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded. |
| MalformedPolicyDocumentException | The request was rejected because the policy document was malformed. The error message describes the specific error. |
| NameConflictException | The request was rejected because the resulting role name conflicts with an existing role in the account. |
| NoSuchEntityException | The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource. |
| RoleModifiedException | The request was rejected because someone modified the role template while the service was creating the role. Wait a few minutes and try the request again. |
| RoleTemplateDisabledException | The request was rejected because the specified role template is disabled. A disabled role template cannot be used to create new roles. Contact your administrator to enable the role template, or use a different role template. |
| ServiceFailureException | The request processing has failed because of an unknown error, exception or failure. |
.NET Framework:
Supported in: 4.7.2 and newer