Skip to main content

access_policies

Creates, updates, deletes, gets or lists an access_policies resource.

Overview

Nameaccess_policies
TypeResource
Idaws.eks.access_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the access policy.
arnstringThe ARN of the access policy.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_access_policiesselectregionmaxResults, nextTokenLists the available access policies.
associate_access_policyupdatename, principal_arn, region, policyArn, accessScopeAssociates an access policy and its scope to an access entry. For more information about associating access policies, see Associating and disassociating access policies to and from access entries in the Amazon EKS User Guide.
disassociate_access_policyupdatename, principal_arn, policy_arn, regionDisassociates an access policy from an access entry.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
namestringThe name of your cluster.
policy_arnstringThe ARN of the policy to disassociate from the access entry. For a list of associated policies ARNs, use ListAssociatedAccessPolicies.
principal_arnstringThe ARN of the IAM principal for the AccessEntry.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results, returned in paginated output. You receive maxResults in a single page, along with a nextToken response element. You can see the remaining results of the initial request by sending another request with the returned nextToken value. This value can be between 1 and 100. If you don't use this parameter, 100 results and a nextToken value, if applicable, are returned.
nextTokenstringThe nextToken value returned from a previous paginated 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 value is null when there are no more results to return. 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.

SELECT examples

Lists the available access policies.

SELECT
name,
arn
FROM aws.eks.access_policies
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;

UPDATE examples

Associates an access policy and its scope to an access entry. For more information about associating access policies, see Associating and disassociating access policies to and from access entries in the Amazon EKS User Guide.

UPDATE aws.eks.access_policies
SET
policyArn = '{{ policyArn }}',
accessScope = '{{ accessScope }}'
WHERE
name = '{{ name }}' --required
AND principal_arn = '{{ principal_arn }}' --required
AND region = '{{ region }}' --required
AND policyArn = '{{ policyArn }}' --required
AND accessScope = '{{ accessScope }}' --required
RETURNING
associated_access_policy,
cluster_name,
principal_arn;