Skip to content
v2.278.0

AccessPolicyProps Struct ​

Properties for configuring an Amazon EKS Access Policy.

Example ​

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
# 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
// 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();
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
};
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 ​

accessScopeAccessScopeaccess_scopeAccessScopeaccessScopeAccessScopeAccessScopeAccessScopeAccessScopeAccessScope required #
The scope of the access policy, which determines the level of access granted.
The access policy itself, which defines the specific permissions.