EndpointAccess Class
Endpoint access characteristics.
| Source | aws-eks/lib/cluster.ts |
|---|
Example
import { KubectlV37Layer } from '@aws-cdk/lambda-layer-kubectl-v37';
const cluster = new eks.Cluster(this, 'hello-eks', {
version: eks.KubernetesVersion.V1_37,
endpointAccess: eks.EndpointAccess.PRIVATE, // No access outside of your VPC.
kubectlLayer: new KubectlV37Layer(this, 'kubectl'),
});
from aws_cdk.lambda_layer_kubectl_v37 import KubectlV37Layer
cluster = eks.Cluster(self, "hello-eks",
version=eks.KubernetesVersion.V1_37,
endpoint_access=eks.EndpointAccess.PRIVATE, # No access outside of your VPC.
kubectl_layer=KubectlV37Layer(self, "kubectl")
)
import software.amazon.awscdk.cdk.lambdalayer.kubectl.v37.KubectlV37Layer;
Cluster cluster = Cluster.Builder.create(this, "hello-eks")
.version(KubernetesVersion.V1_37)
.endpointAccess(EndpointAccess.PRIVATE) // No access outside of your VPC.
.kubectlLayer(new KubectlV37Layer(this, "kubectl"))
.build();
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.LambdaLayer.KubectlV37;
var cluster = new Cluster(this, "hello-eks", new ClusterProps {
Version = KubernetesVersion.V1_37,
EndpointAccess = EndpointAccess.PRIVATE, // No access outside of your VPC.
KubectlLayer = new KubectlV37Layer(this, "kubectl")
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/cdklabs/awscdk-kubectl-go/kubectlv37"
cluster := eks.NewCluster(this, jsii.String("hello-eks"), &ClusterProps{
Version: eks.KubernetesVersion_V1_37(),
EndpointAccess: eks.EndpointAccess_PRIVATE(),
// No access outside of your VPC.
KubectlLayer: kubectlv37.NewKubectlV37Layer(this, jsii.String("kubectl")),
})
Properties
PRIVATEEndpointAccessPRIVATEEndpointAccessPRIVATEEndpointAccessPRIVATEEndpointAccessPRIVATEEndpointAccess static #Worker node traffic to the endpoint will stay within your VPC.
PUBLICEndpointAccessPUBLICEndpointAccessPUBLICEndpointAccessPUBLICEndpointAccessPUBLICEndpointAccess static #notes
Worker node traffic will leave your VPC to connect to the endpoint.
By default, the endpoint is exposed to all addresses. You can optionally limit the CIDR blocks that can access the public endpoint using the PUBLIC.onlyFrom method. If you limit access to specific CIDR blocks, you must ensure that the CIDR blocks that you specify include the addresses that worker nodes and Fargate pods (if you use them) access the public endpoint from.
PUBLIC_AND_PRIVATEEndpointAccessPUBLIC_AND_PRIVATEEndpointAccessPUBLIC_AND_PRIVATEEndpointAccessPUBLIC_AND_PRIVATEEndpointAccessPUBLIC_AND_PRIVATEEndpointAccess static #notes
Worker node traffic to the endpoint will stay within your VPC.
By default, the endpoint is exposed to all addresses. You can optionally limit the CIDR blocks that can access the public endpoint using the PUBLIC_AND_PRIVATE.onlyFrom method. If you limit access to specific CIDR blocks, you must ensure that the CIDR blocks that you specify include the addresses that worker nodes and Fargate pods (if you use them) access the public endpoint from.
Methods
onlyFrom(...cidr: string[]): EndpointAccess // chainabledef only_from(self, cidr: str) -> EndpointAccesspublic EndpointAccess onlyFrom(String cidr)public EndpointAccess OnlyFrom(string cidr)func OnlyFrom(Cidr *string) EndpointAccess #If public access is disabled, this method will result in an error.
1 parameter
Parameters
cidrcidrcidrcidrCidr— CIDR blocks.