RedshiftServerless / Client / create_role_association
create_role_association¶
- RedshiftServerless.Client.create_role_association(**kwargs)¶
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.
See also: AWS API Documentation
Request Syntax
response = client.create_role_association( targetArn='string', roleType='string', principal={ 'iam': { 'arn': 'string' } } )
- Parameters:
targetArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the default endpoint. Only
express-defaultis supported, and it must be in the same Amazon Web Services account as the caller. The ARN format isarn:aws-partition:redshift-serverless:region:account-id:workgroup/express/express-default, for examplearn:aws:redshift-serverless:us-east-1:111122223333:workgroup/express/express-default.roleType (string) –
[REQUIRED]
The case-sensitive system-defined role to associate the principal with. Valid values are
sys:superuser,sys:operator,sys:dba,sys:secadmin, andsys:monitor. On the express configuration,sys:operator,sys:dba, andsys:superusergive the same permissions.principal (dict) –
[REQUIRED]
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 Amazon Web Services account as the caller.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
iam.iam (dict) –
An IAM role or IAM user.
arn (string) – [REQUIRED]
The ARN of the IAM role or IAM user. The principal must be in the same account as the caller.
- Return type:
dict
- Returns:
Response Syntax
{ 'targetArn': 'string', 'roleType': 'string', 'principal': { 'iam': { 'arn': 'string', 'resolvedUniqueId': 'string' } } }
Response Structure
(dict) –
targetArn (string) –
The Amazon Resource Name (ARN) of the default endpoint.
roleType (string) –
The system-defined role the principal is associated with.
principal (dict) –
The associated principal, including its resolved unique ID.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
iam. If a client receives an unknown member it will setSDK_UNKNOWN_MEMBERas the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBERis as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
iam (dict) –
An IAM role or IAM user.
arn (string) –
The ARN of the IAM role or IAM user.
resolvedUniqueId (string) –
The unique ID that IAM assigned to the principal. Amazon Redshift looks up this ID from the principal ARN when it creates the association. Role IDs begin with
AROA, and user IDs begin withAIDA. The association is tied to this ID. A deleted and recreated IAM principal with the same ARN doesn’t inherit the previous principal’s association. The response omits this field when an idempotentDeleteRoleAssociationrequest finds no existing association.
Exceptions