# AccessPolicyProps

Properties for configuring an Amazon EKS Access Policy.

Used as props by: [AccessPolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.AccessPolicy.html)

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

## 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 as eks } from 'aws-cdk-lib';

declare const accessPolicyArn: eks.AccessPolicyArn;
const accessPolicyProps: eks.AccessPolicyProps = {
  accessScope: {
    type: eks.AccessScopeType.NAMESPACE,

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

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 as eks

# access_policy_arn: eks.AccessPolicyArn

access_policy_props = eks.AccessPolicyProps(
    access_scope=eks.AccessScope(
        type=eks.AccessScopeType.NAMESPACE,

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

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.*;

AccessPolicyArn accessPolicyArn;

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

                // the properties below are optional
                .namespaces(List.of("namespaces"))
                .build())
        .policy(accessPolicyArn)
        .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.EKS;

AccessPolicyArn accessPolicyArn;

var accessPolicyProps = new AccessPolicyProps {
    AccessScope = new AccessScope {
        Type = AccessScopeType.NAMESPACE,

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

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"

var accessPolicyArn AccessPolicyArn

accessPolicyProps := &AccessPolicyProps{
	AccessScope: &AccessScope{
		Type: awscdk.Aws_eks.AccessScopeType_NAMESPACE,

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

## Properties

- `accessScope`: [AccessScope](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.AccessScope.html) (required) — The scope of the access policy, which determines the level of access granted.

- `policy`: [AccessPolicyArn](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.AccessPolicyArn.html) (required) — The access policy itself, which defines the specific permissions.
