Skip to content

list_pod_identity_associations async

list_pod_identity_associations(
    cluster_name: String,
    *,
    config_overrides: Optional[AsyncEKSClientConfig] = None,
    namespace: Optional[String] = None,
    service_account: Optional[String] = None,
    max_results: Optional[ListPodIdentityAssociationsMaxResults] = None,
    next_token: Optional[String] = None,
) -> ListPodIdentityAssociationsResponse

List the EKS Pod Identity associations in a cluster. You can filter the list by the namespace that the association is in or the service account that the association uses.

Parameters:

  • cluster_name (String) –

    The name of the cluster that the associations are in.

  • namespace (Optional[String], default: None ) –

    The name of the Kubernetes namespace inside the cluster that the associations are in.

  • service_account (Optional[String], default: None ) –

    The name of the Kubernetes service account that the associations use.

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

    The maximum number of EKS Pod Identity association results returned by ListPodIdentityAssociations in paginated output. When you use this parameter, ListPodIdentityAssociations returns only maxResults results in a single page along with a nextToken response element. You can see the remaining results of the initial request by sending another ListPodIdentityAssociations request with the returned nextToken value. This value can be between 1 and 100. If you don't use this parameter, ListPodIdentityAssociations returns up to 100 results and a nextToken value if applicable.

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

    The nextToken value returned from a previous paginated ListUpdates request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value.

    This token should be treated as an opaque identifier that is used only to retrieve the next items in a list and not for other programmatic purposes.

Raises:

  • InvalidParameterException –

    The specified parameter is invalid. Review the available parameters for the API request.

  • InvalidRequestException –

    The request is invalid given the state of the cluster. Check the state of the cluster and the associated operations.

  • ResourceNotFoundException –

    The specified resource could not be found. You can view your available clusters with ListClusters. You can view your available managed node groups with ListNodegroups. Amazon EKS clusters and node groups are Amazon Web Services Region specific.

  • ServerException –

    These errors are usually caused by a server-side issue.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_eks/_services/async_eks.py
async def list_pod_identity_associations(
    self,
    cluster_name: "capo_eks.types.string.String",
    *,
    config_overrides: Optional[AsyncEKSClientConfig] = None,
    namespace: Optional["capo_eks.types.string.String"] = None,
    service_account: Optional["capo_eks.types.string.String"] = None,
    max_results: Optional[
        "capo_eks.types.list_pod_identity_associations_max_results.ListPodIdentityAssociationsMaxResults"
    ] = None,
    next_token: Optional["capo_eks.types.string.String"] = None,
) -> "capo_eks.types.list_pod_identity_associations_response.ListPodIdentityAssociationsResponse":
    """<p>List the EKS Pod Identity associations in a cluster. You can filter the list by the namespace that the association is in or the service account that the association uses.</p>

    Args:
        cluster_name: <p>The name of the cluster that the associations are in.</p>
        namespace: <p>The name of the Kubernetes namespace inside the cluster that the associations are in.</p>
        service_account: <p>The name of the Kubernetes service account that the associations use.</p>
        max_results: <p>The maximum number of EKS Pod Identity association results returned by <code>ListPodIdentityAssociations</code> in paginated output. When you use this parameter, <code>ListPodIdentityAssociations</code> returns only <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListPodIdentityAssociations</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don't use this parameter, <code>ListPodIdentityAssociations</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
        next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>ListUpdates</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p> <note> <p>This token should be treated as an opaque identifier that is used only to retrieve the next items in a list and not for other programmatic purposes.</p> </note>

    Raises:
        capo_eks.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
        capo_eks.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid given the state of the cluster. Check the state of the cluster and the associated operations.</p>
        capo_eks.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found. You can view your available clusters with <code>ListClusters</code>. You can view your available managed node groups with <code>ListNodegroups</code>. Amazon EKS clusters and node groups are Amazon Web Services Region specific.</p>
        capo_eks.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
        capo_eks.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_eks.types.list_pod_identity_associations_request.ListPodIdentityAssociationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_eks.types.list_pod_identity_associations_response.ListPodIdentityAssociationsResponse"
    ]:
        import capo_eks._operations.aws_wesley_frontend.list_pod_identity_associations

        (
            output,
            http_response,
        ) = await capo_eks._operations.aws_wesley_frontend.list_pod_identity_associations.async_list_pod_identity_associations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPodIdentityAssociations")
    )
    input_: capo_eks.types.list_pod_identity_associations_request.ListPodIdentityAssociationsRequest = {
        "cluster_name": cluster_name
    }
    if namespace is not None:
        input_["namespace"] = namespace
    if service_account is not None:
        input_["service_account"] = service_account
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output