Skip to content

list_access_grants

list_access_grants(
    account_id: AccountId,
    *,
    config_overrides: Optional[S3ControlClientConfig] = None,
    next_token: Optional[ContinuationToken] = None,
    max_results: Optional[MaxResults] = None,
    grantee_type: Optional[GranteeType] = None,
    grantee_identifier: Optional[GranteeIdentifier] = None,
    permission: Optional[Permission] = None,
    grant_scope: Optional[S3Prefix] = None,
    application_arn: Optional[IdentityCenterApplicationArn] = None,
) -> ListAccessGrantsResult

Returns the list of access grants in your S3 Access Grants instance.

Permissions

You must have the s3:ListAccessGrants permission to use this operation.

Parameters:

  • account_id (AccountId) –

    The Amazon Web Services account ID of the S3 Access Grants instance.

  • next_token (Optional[ContinuationToken], default: None ) –

    A pagination token to request the next page of results. Pass this value into a subsequent List Access Grants request in order to retrieve the next page of results.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of access grants that you would like returned in the List Access Grants response. If the results include the pagination token NextToken, make another call using the NextToken to determine if there are more results.

  • grantee_type (Optional[GranteeType], default: None ) –

    The type of the grantee to which access has been granted. It can be one of the following values:

    • IAM - An IAM user or role.

    • DIRECTORY_USER - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.

    • DIRECTORY_GROUP - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.

  • grantee_identifier (Optional[GranteeIdentifier], default: None ) –

    The unique identifer of the Grantee. If the grantee type is IAM, the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format a1b2c3d4-5678-90ab-cdef-EXAMPLE11111. You can obtain this UUID from your Amazon Web Services IAM Identity Center instance.

  • permission (Optional[Permission], default: None ) –

    The type of permission granted to your S3 data, which can be set to one of the following values:

    • READ – Grant read-only access to the S3 data.

    • WRITE – Grant write-only access to the S3 data.

    • READWRITE – Grant both read and write access to the S3 data.

  • grant_scope (Optional[S3Prefix], default: None ) –

    The S3 path of the data to which you are granting access. It is the result of appending the Subprefix to the location scope.

  • application_arn (Optional[IdentityCenterApplicationArn], default: None ) –

    The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application.

Raises:

Source code in docs_src/capo_s3_control/_services/s3_control.py
def list_access_grants(
    self,
    account_id: "capo_s3_control.types.account_id.AccountId",
    *,
    config_overrides: Optional[S3ControlClientConfig] = None,
    next_token: Optional[
        "capo_s3_control.types.continuation_token.ContinuationToken"
    ] = None,
    max_results: Optional["capo_s3_control.types.max_results.MaxResults"] = None,
    grantee_type: Optional["capo_s3_control.types.grantee_type.GranteeType"] = None,
    grantee_identifier: Optional[
        "capo_s3_control.types.grantee_identifier.GranteeIdentifier"
    ] = None,
    permission: Optional["capo_s3_control.types.permission.Permission"] = None,
    grant_scope: Optional["capo_s3_control.types.s3_prefix.S3Prefix"] = None,
    application_arn: Optional[
        "capo_s3_control.types.identity_center_application_arn.IdentityCenterApplicationArn"
    ] = None,
) -> "capo_s3_control.types.list_access_grants_result.ListAccessGrantsResult":
    """<p>Returns the list of access grants in your S3 Access Grants instance.</p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3:ListAccessGrants</code> permission to use this operation. </p> </dd> </dl>

    Args:
        account_id: <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
        next_token: <p>A pagination token to request the next page of results. Pass this value into a subsequent <code>List Access Grants</code> request in order to retrieve the next page of results.</p>
        max_results: <p>The maximum number of access grants that you would like returned in the <code>List Access Grants</code> response. If the results include the pagination token <code>NextToken</code>, make another call using the <code>NextToken</code> to determine if there are more results.</p>
        grantee_type: <p>The type of the grantee to which access has been granted. It can be one of the following values:</p> <ul> <li> <p> <code>IAM</code> - An IAM user or role.</p> </li> <li> <p> <code>DIRECTORY_USER</code> - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p> </li> <li> <p> <code>DIRECTORY_GROUP</code> - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.</p> </li> </ul>
        grantee_identifier: <p>The unique identifer of the <code>Grantee</code>. If the grantee type is <code>IAM</code>, the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format <code>a1b2c3d4-5678-90ab-cdef-EXAMPLE11111</code>. You can obtain this UUID from your Amazon Web Services IAM Identity Center instance.</p>
        permission: <p>The type of permission granted to your S3 data, which can be set to one of the following values:</p> <ul> <li> <p> <code>READ</code> – Grant read-only access to the S3 data.</p> </li> <li> <p> <code>WRITE</code> – Grant write-only access to the S3 data.</p> </li> <li> <p> <code>READWRITE</code> – Grant both read and write access to the S3 data.</p> </li> </ul>
        grant_scope: <p>The S3 path of the data to which you are granting access. It is the result of appending the <code>Subprefix</code> to the location scope.</p>
        application_arn: <p>The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application. </p>

    Raises:
        capo_s3_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_s3_control.types.list_access_grants_request.ListAccessGrantsRequest]",
    ) -> OperationResponse[
        "capo_s3_control.types.list_access_grants_result.ListAccessGrantsResult"
    ]:
        import capo_s3_control._operations.awss3_control_service_v20180820.list_access_grants

        output, http_response = (
            capo_s3_control._operations.awss3_control_service_v20180820.list_access_grants.list_access_grants(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAccessGrants")
    )
    input_: capo_s3_control.types.list_access_grants_request.ListAccessGrantsRequest = {
        "account_id": account_id
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if grantee_type is not None:
        input_["grantee_type"] = grantee_type
    if grantee_identifier is not None:
        input_["grantee_identifier"] = grantee_identifier
    if permission is not None:
        input_["permission"] = permission
    if grant_scope is not None:
        input_["grant_scope"] = grant_scope
    if application_arn is not None:
        input_["application_arn"] = application_arn

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output