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.
Example
Use a bare-bones client and the command you need to make an API call.
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.
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.
Example
Use a bare-bones client and the command you need to make an API call.
Param
CreateServiceLinkedRoleCommandInput
Returns
CreateServiceLinkedRoleCommandOutput
See
input
shape.response
shape.config
shape.Throws
InvalidInputException (client fault)
The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
Throws
LimitExceededException (client fault)
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.
Throws
NoSuchEntityException (client fault)
The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.
Throws
ServiceFailureException (server fault)
The request processing has failed because of an unknown error, exception or failure.
Throws
IAMServiceException
Base exception class for all service exceptions from IAM service.