ClusterProps

class aws_cdk.aws_eks_legacy.ClusterProps(*, cluster_name=None, default_capacity=None, default_capacity_instance=None, kubectl_enabled=None, masters_role=None, output_cluster_name=None, output_config_command=None, output_masters_role_arn=None, role=None, security_group=None, version=None, vpc=None, vpc_subnets=None)

Bases: object

(deprecated) Properties to instantiate the Cluster.

Parameters:
  • cluster_name (Optional[str]) – (deprecated) Name for the cluster. Default: - Automatically generated name

  • default_capacity (Union[int, float, None]) – (deprecated) Number of instances to allocate as an initial capacity for this cluster. Instance type can be configured through defaultCapacityInstanceType, which defaults to m5.large. Use cluster.addCapacity to add additional customized capacity. Set this to 0 is you wish to avoid the initial capacity allocation. Default: 2

  • default_capacity_instance (Optional[InstanceType]) – (deprecated) The instance type to use for the default capacity. This will only be taken into account if defaultCapacity is > 0. Default: m5.large

  • kubectl_enabled (Optional[bool]) – (deprecated) Allows defining kubectrl-related resources on this cluster. If this is disabled, it will not be possible to use the following capabilities: - addResource - addRoleMapping - addUserMapping - addMastersRole and props.mastersRole If this is disabled, the cluster can only be managed by issuing kubectl commands from a session that uses the IAM role/user that created the account. NOTE: changing this value will destoy the cluster. This is because a managable cluster must be created using an AWS CloudFormation custom resource which executes with an IAM role owned by the CDK app. Default: true The cluster can be managed by the AWS CDK application.

  • masters_role (Optional[IRole]) – (deprecated) An IAM role that will be added to the system:masters Kubernetes RBAC group. Default: - By default, it will only possible to update this Kubernetes system by adding resources to this cluster via addResource or by defining KubernetesResource resources in your AWS CDK app. Use this if you wish to grant cluster administration privileges to another role.

  • output_cluster_name (Optional[bool]) – (deprecated) Determines whether a CloudFormation output with the name of the cluster will be synthesized. Default: false

  • output_config_command (Optional[bool]) – (deprecated) Determines whether a CloudFormation output with the aws eks update-kubeconfig command will be synthesized. This command will include the cluster name and, if applicable, the ARN of the masters IAM role. Default: true

  • output_masters_role_arn (Optional[bool]) – (deprecated) Determines whether a CloudFormation output with the ARN of the “masters” IAM role will be synthesized (if mastersRole is specified). Default: false

  • role (Optional[IRole]) – (deprecated) Role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. Default: - A role is automatically created for you

  • security_group (Optional[ISecurityGroup]) – (deprecated) Security Group to use for Control Plane ENIs. Default: - A security group is automatically created

  • version (Optional[str]) – (deprecated) The Kubernetes version to run in the cluster. Default: - If not supplied, will use Amazon default version

  • vpc (Optional[IVpc]) – (deprecated) The VPC in which to create the Cluster. Default: - a VPC with default configuration will be created and can be accessed through cluster.vpc.

  • vpc_subnets (Optional[Sequence[Union[SubnetSelection, Dict[str, Any]]]]) – (deprecated) Where to place EKS Control Plane ENIs. If you want to create public load balancers, this must include public subnets. For example, to only select private subnets, supply the following:: const vpcSubnets = [ { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT } ] Default: - All public and private subnets

Stability:

deprecated

ExampleMetadata:

infused

Example:

eks.Cluster(self, "cluster",
    default_capacity=10,
    default_capacity_instance=ec2.InstanceType("m2.xlarge")
)

Attributes

cluster_name

(deprecated) Name for the cluster.

Default:
  • Automatically generated name

Stability:

deprecated

default_capacity

(deprecated) Number of instances to allocate as an initial capacity for this cluster.

Instance type can be configured through defaultCapacityInstanceType, which defaults to m5.large.

Use cluster.addCapacity to add additional customized capacity. Set this to 0 is you wish to avoid the initial capacity allocation.

Default:

2

Stability:

deprecated

default_capacity_instance

(deprecated) The instance type to use for the default capacity.

This will only be taken into account if defaultCapacity is > 0.

Default:

m5.large

Stability:

deprecated

kubectl_enabled

(deprecated) Allows defining kubectrl-related resources on this cluster.

If this is disabled, it will not be possible to use the following capabilities:

  • addResource

  • addRoleMapping

  • addUserMapping

  • addMastersRole and props.mastersRole

If this is disabled, the cluster can only be managed by issuing kubectl commands from a session that uses the IAM role/user that created the account.

NOTE: changing this value will destoy the cluster. This is because a managable cluster must be created using an AWS CloudFormation custom resource which executes with an IAM role owned by the CDK app.

Default:

true The cluster can be managed by the AWS CDK application.

Stability:

deprecated

masters_role

(deprecated) An IAM role that will be added to the system:masters Kubernetes RBAC group.

Default:

  • By default, it will only possible to update this Kubernetes

system by adding resources to this cluster via addResource or by defining KubernetesResource resources in your AWS CDK app. Use this if you wish to grant cluster administration privileges to another role.

See:

https://kubernetes.io/docs/reference/access-authn-authz/rbac/#default-roles-and-role-bindings

Stability:

deprecated

output_cluster_name

(deprecated) Determines whether a CloudFormation output with the name of the cluster will be synthesized.

Default:

false

Stability:

deprecated

output_config_command

(deprecated) Determines whether a CloudFormation output with the aws eks update-kubeconfig command will be synthesized.

This command will include the cluster name and, if applicable, the ARN of the masters IAM role.

Default:

true

Stability:

deprecated

output_masters_role_arn

(deprecated) Determines whether a CloudFormation output with the ARN of the “masters” IAM role will be synthesized (if mastersRole is specified).

Default:

false

Stability:

deprecated

role

(deprecated) Role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.

Default:
  • A role is automatically created for you

Stability:

deprecated

security_group

(deprecated) Security Group to use for Control Plane ENIs.

Default:
  • A security group is automatically created

Stability:

deprecated

version

(deprecated) The Kubernetes version to run in the cluster.

Default:
  • If not supplied, will use Amazon default version

Stability:

deprecated

vpc

(deprecated) The VPC in which to create the Cluster.

Default:
  • a VPC with default configuration will be created and can be accessed through cluster.vpc.

Stability:

deprecated

vpc_subnets

(deprecated) Where to place EKS Control Plane ENIs.

If you want to create public load balancers, this must include public subnets.

For example, to only select private subnets, supply the following:

vpc_subnets = [{"subnet_type": ec2.SubnetType.PRIVATE_WITH_NAT}
]
Default:
  • All public and private subnets

Stability:

deprecated