# AccessScope

Represents the scope of an access policy.

The scope defines the namespaces or cluster-level access granted by the policy.

- Source: [`aws-eks-v2/lib/access-entry.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-eks-v2/lib/access-entry.ts#L79)
- Type last changed: v2.240.0 · 23 Feb 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_eks_v2 as eks_v2 } from 'aws-cdk-lib';
const accessScope: eks_v2.AccessScope = {
  type: eks_v2.AccessScopeType.NAMESPACE,

  // the properties below are optional
  namespaces: ['namespaces'],
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_eks_v2 as eks_v2

access_scope = eks_v2.AccessScope(
    type=eks_v2.AccessScopeType.NAMESPACE,

    # the properties below are optional
    namespaces=["namespaces"]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.eks_v2.*;

AccessScope accessScope = AccessScope.builder()
        .type(AccessScopeType.NAMESPACE)

        // the properties below are optional
        .namespaces(List.of("namespaces"))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EKSv2;

var accessScope = new AccessScope {
    Type = AccessScopeType.NAMESPACE,

    // the properties below are optional
    Namespaces = new [] { "namespaces" }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

accessScope := &AccessScope{
	Type: awscdk.Aws_eks_v2.AccessScopeType_NAMESPACE,

	// the properties below are optional
	Namespaces: []*string{
		jsii.String("namespaces"),
	},
}
```

## Properties

- `namespaces`: string[] — A Kubernetes namespace that an access policy is scoped to.

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

  A value is required if you specified
  namespace for Type.

- `type`: [AccessScopeType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks_v2.AccessScopeType.html) (required) — The scope type of the policy, either 'namespace' or 'cluster'.
