# AccessPolicyNameOptions

Represents the options required to create an Amazon EKS Access Policy using the `fromAccessPolicyName()` method.

- Source: [`aws-eks/lib/access-entry.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-eks/lib/access-entry.ts#L187)
- Type last changed: v2.146.0 · 13 Jun 2024

## Example

```ts
// AmazonEKSClusterAdminPolicy with `cluster` scope
eks.AccessPolicy.fromAccessPolicyName('AmazonEKSClusterAdminPolicy', {
  accessScopeType: eks.AccessScopeType.CLUSTER,
});
// AmazonEKSAdminPolicy with `namespace` scope
eks.AccessPolicy.fromAccessPolicyName('AmazonEKSAdminPolicy', {
  accessScopeType: eks.AccessScopeType.NAMESPACE,
  namespaces: ['foo', 'bar'] } );
```

## Properties

- `accessScopeType`: [AccessScopeType](/cdk/api/v2/docs/aws-cdk-lib.aws_eks.AccessScopeType.html) (required) — The scope of the access policy.

  This determines the level of access granted by the policy.

- `namespaces`: string[] — An optional array of Kubernetes namespaces to which the access policy applies.

  **Default:** no specific namespaces for this scope
