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.

Creates an IAM role that is linked to a specific Amazon Web Services service. The service controls the attached policies and when the role can be deleted. This helps ensure that the service is not broken by an unexpectedly changed or deleted role, which could put your Amazon Web Services resources into an unknown state. Allowing the service to control the role helps improve service stability and proper cleanup when a service and its role are no longer needed. For more information, see Using service-linked roles in the IAM User Guide.

To attach a policy to this service-linked role, you must make the request using the Amazon Web Services service that depends on this role.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to CreateServiceLinkedRoleAsync.

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

Syntax

C#
public virtual CreateServiceLinkedRoleResponse CreateServiceLinkedRole(
         CreateServiceLinkedRoleRequest request
)

Parameters

request
Type: Amazon.IdentityManagement.Model.CreateServiceLinkedRoleRequest

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

Return Value


The response from the CreateServiceLinkedRole 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.
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.
NoSuchEntityException The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.
ServiceFailureException The request processing has failed because of an unknown error, exception or failure.

Version Information

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

See Also