Managing the account service role with the API
| Intended audience: AWS Quick Administrators and AWS Quick developers |
AWS Quick Sight uses an AWS Identity and Access Management (IAM) service role to access AWS resources on behalf of your account. Use the following API operations to inspect the account's service role and select a customer-managed role:
-
DescribeResourcePermissions returns the current role type and, for a customer-managed role, its Amazon Resource Name (ARN).
-
UpdateResourcePermissions selects a customer-managed role. You can switch from a service-managed role to a customer-managed role, or replace one customer-managed role with another.
Call both operations in the AWS Region where your AWS Quick Sight account is registered (the home Region).
Prerequisites
Before you update the service role, prepare a customer-managed IAM role that meets these requirements:
-
The role is in the same AWS account as your AWS Quick Sight account.
-
The trust policy allows the
quicksight.amazonaws.comservice principal to callsts:AssumeRole. -
The role has permissions policies that allow access to the AWS resources that your account uses.
For role setup instructions, see Passing IAM roles to Quick.
The IAM identity that calls the API needs these permissions:
-
quicksight:DescribeResourcePermissionsto inspect the configuration. -
quicksight:UpdateResourcePermissionsto update the configuration. -
iam:PassRoleon the customer-managed role that you select. This permission is required for every Update request. For more information, see Grant a user permissions to pass a role to an AWS service in the IAM User Guide.
For features that use session tags, also allow sts:TagSession in
the role trust policy. If you later add or remove this permission, call
UpdateResourcePermissions again with the same role ARN to refresh the
stored session-tag capability.
Use an AWS CLI or SDK version that includes both operations.
Inspecting the current service role
To inspect the account service role
-
Run the following AWS CLI command. Replace
111122223333with your AWS account ID andus-east-1with your home Region.aws quicksight describe-resource-permissions \ --aws-account-id111122223333\ --regionus-east-1For example, an account that uses a service-managed role returns a response similar to the following:
{ "Status": 200, "RoleType": "QUICKSIGHT_MANAGED", "RequestId": "00000000-0000-4000-8000-000000000000" } -
Check
RoleTypein the response:QUICKSIGHT_MANAGED-
AWS Quick Sight manages the role.
CUSTOMER_MANAGED-
You manage the role and its permissions. The response also contains
CustomerManagedRoleArn.
Selecting a customer-managed service role
Both RoleType and CustomerManagedRoleArn are required.
The only supported role type for this operation is
CUSTOMER_MANAGED.
To select a customer-managed service role
-
Run the following AWS CLI command. Replace
111122223333with your AWS account ID,arn:aws:iam::111122223333:role/QuickSightServiceRolewith your prepared role ARN, andus-east-1with your home Region.aws quicksight update-resource-permissions \ --aws-account-id111122223333\ --role-type CUSTOMER_MANAGED \ --customer-managed-role-arnarn:aws:iam::111122223333:role/QuickSightServiceRole\ --regionus-east-1A successful response returns the selected role type and ARN:
{ "Status": 200, "RoleType": "CUSTOMER_MANAGED", "CustomerManagedRoleArn": "arn:aws:iam::111122223333:role/QuickSightServiceRole", "RequestId": "00000000-0000-4000-8000-000000000000" } -
Run
describe-resource-permissionsagain with your account ID and home Region:aws quicksight describe-resource-permissions \ --aws-account-id111122223333\ --regionus-east-1Verify that
RoleTypeisCUSTOMER_MANAGEDandCustomerManagedRoleArnmatches the role that you selected.
To replace this role with another customer-managed role, repeat the procedure with the replacement role ARN.
Verify that the selected role allows access to the resources that your data sources need. Updating the configuration does not attach permissions policies to the role.
You can't use UpdateResourcePermissions to switch back to a
service-managed role. To make that change, use the Quick console's
AWS resource permissions settings. For instructions to open these settings,
see Accessing AWS
resources.