View a markdown version of this page

CreateRoleAssociation - Amazon Redshift Serverless

CreateRoleAssociation

Associates an IAM principal with an Amazon Redshift system-defined role on Amazon Redshift Serverless with express configuration. When the principal connects to the regional endpoint, its database user gets the associated system-defined role for monitoring, operational, or administrative tasks. A role association doesn't give access to your data. You must also have separate permissions to obtain credentials and connect to the regional endpoint. To associate multiple principals or role types, submit a separate request for each association. You can associate up to 10 principals with each role type.

Request Syntax

{ "principal": { ... }, "roleType": "string", "targetArn": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

principal

The IAM role or IAM user to associate with the role type, specified by its ARN. The principal must exist and must be in the same AWS account as the caller.

Type: PrincipalInput object

Note: This object is a Union. Only one member of this object can be specified or returned.

Required: Yes

roleType

The case-sensitive system-defined role to associate the principal with. Valid values are sys:superuser, sys:operator, sys:dba, sys:secadmin, and sys:monitor. On the express configuration, sys:operator, sys:dba, and sys:superuser give the same permissions.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Required: Yes

targetArn

The Amazon Resource Name (ARN) of the default endpoint. Only express-default is supported, and it must be in the same AWS account as the caller. The ARN format is arn:aws-partition:redshift-serverless:region:account-id:workgroup/express/express-default, for example arn:aws:redshift-serverless:us-east-1:111122223333:workgroup/express/express-default.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1011.

Required: Yes

Response Syntax

{ "principal": { ... }, "roleType": "string", "targetArn": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

principal

The associated principal, including its resolved unique ID.

Type: PrincipalOutput object

Note: This object is a Union. Only one member of this object can be specified or returned.

roleType

The system-defined role the principal is associated with.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

targetArn

The Amazon Resource Name (ARN) of the default endpoint.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1011.

Errors

For information about the errors that are common to all actions, see Common Error Types.

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 400

ConflictException

The submitted action has conflicts.

HTTP Status Code: 400

InternalServerException

The request processing has failed because of an unknown error, exception or failure.

HTTP Status Code: 500

ResourceNotFoundException

The resource could not be found.

resourceName

The name of the resource that could not be found.

HTTP Status Code: 400

ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 400

ValidationException

The input failed to satisfy the constraints specified by an AWS service.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: