CfnNodegroup

class aws_cdk.aws_eks.CfnNodegroup(scope, id, *, cluster_name, node_role, subnets, ami_type=None, capacity_type=None, disk_size=None, force_update_enabled=None, instance_types=None, labels=None, launch_template=None, nodegroup_name=None, release_version=None, remote_access=None, scaling_config=None, tags=None, taints=None, update_config=None, version=None)

Bases: aws_cdk.core.CfnResource

A CloudFormation AWS::EKS::Nodegroup.

Creates a managed node group for an Amazon EKS cluster. You can only create a node group for your cluster that is equal to the current Kubernetes version for the cluster. All node groups are created with the latest AMI release version for the respective minor Kubernetes version of the cluster, unless you deploy a custom AMI using a launch template. For more information about using launch templates, see Launch template support .

An Amazon EKS managed node group is an Amazon EC2 Auto Scaling group and associated Amazon EC2 instances that are managed by AWS for an Amazon EKS cluster. Each node group uses a version of the Amazon EKS optimized Amazon Linux 2 AMI. For more information, see Managed Node Groups in the Amazon EKS User Guide .

CloudformationResource

AWS::EKS::Nodegroup

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_eks as eks

# labels: Any
# tags: Any

cfn_nodegroup = eks.CfnNodegroup(self, "MyCfnNodegroup",
    cluster_name="clusterName",
    node_role="nodeRole",
    subnets=["subnets"],

    # the properties below are optional
    ami_type="amiType",
    capacity_type="capacityType",
    disk_size=123,
    force_update_enabled=False,
    instance_types=["instanceTypes"],
    labels=labels,
    launch_template=eks.CfnNodegroup.LaunchTemplateSpecificationProperty(
        id="id",
        name="name",
        version="version"
    ),
    nodegroup_name="nodegroupName",
    release_version="releaseVersion",
    remote_access=eks.CfnNodegroup.RemoteAccessProperty(
        ec2_ssh_key="ec2SshKey",

        # the properties below are optional
        source_security_groups=["sourceSecurityGroups"]
    ),
    scaling_config=eks.CfnNodegroup.ScalingConfigProperty(
        desired_size=123,
        max_size=123,
        min_size=123
    ),
    tags=tags,
    taints=[eks.CfnNodegroup.TaintProperty(
        effect="effect",
        key="key",
        value="value"
    )],
    update_config=eks.CfnNodegroup.UpdateConfigProperty(
        max_unavailable=123,
        max_unavailable_percentage=123
    ),
    version="version"
)

Create a new AWS::EKS::Nodegroup.

Parameters
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • cluster_name (str) – The name of the cluster to create the node group in.

  • node_role (str) –

    The Amazon Resource Name (ARN) of the IAM role to associate with your node group. The Amazon EKS worker node kubelet daemon makes calls to AWS APIs on your behalf. Nodes receive permissions for these API calls through an IAM instance profile and associated policies. Before you can launch nodes and register them into a cluster, you must create an IAM role for those nodes to use when they are launched. For more information, see Amazon EKS node IAM role in the Amazon EKS User Guide . If you specify launchTemplate , then don’t specify `IamInstanceProfile <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IamInstanceProfile.html>`_ in your launch template, or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

  • subnets (Sequence[str]) –

    The subnets to use for the Auto Scaling group that is created for your node group. If you specify launchTemplate , then don’t specify `SubnetId <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html>`_ in your launch template, or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

  • ami_type (Optional[str]) –

    The AMI type for your node group. GPU instance types should use the AL2_x86_64_GPU AMI type. Non-GPU instances should use the AL2_x86_64 AMI type. Arm instances should use the AL2_ARM_64 AMI type. All types use the Amazon EKS optimized Amazon Linux 2 AMI. If you specify launchTemplate , and your launch template uses a custom AMI, then don’t specify amiType , or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

  • capacity_type (Optional[str]) – The capacity type of your managed node group.

  • disk_size (Union[int, float, None]) –

    The root device disk size (in GiB) for your node group instances. The default disk size is 20 GiB. If you specify launchTemplate , then don’t specify diskSize , or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

  • force_update_enabled (Union[bool, IResolvable, None]) – Force the update if the existing node group’s pods are unable to be drained due to a pod disruption budget issue. If an update fails because pods could not be drained, you can force the update after it fails to terminate the old node whether or not any pods are running on the node.

  • instance_types (Optional[Sequence[str]]) –

    Specify the instance types for a node group. If you specify a GPU instance type, be sure to specify AL2_x86_64_GPU with the amiType parameter. If you specify launchTemplate , then you can specify zero or one instance type in your launch template or you can specify 0-20 instance types for instanceTypes . If however, you specify an instance type in your launch template and specify any instanceTypes , the node group deployment will fail. If you don’t specify an instance type in a launch template or for instanceTypes , then t3.medium is used, by default. If you specify Spot for capacityType , then we recommend specifying multiple values for instanceTypes . For more information, see Managed node group capacity types and Launch template support in the Amazon EKS User Guide .

  • labels (Optional[Any]) – The Kubernetes labels to be applied to the nodes in the node group when they are created.

  • launch_template (Union[IResolvable, LaunchTemplateSpecificationProperty, None]) – An object representing a node group’s launch template specification. If specified, then do not specify instanceTypes , diskSize , or remoteAccess and make sure that the launch template meets the requirements in launchTemplateSpecification .

  • nodegroup_name (Optional[str]) – The unique name to give your node group.

  • release_version (Optional[str]) – The AMI version of the Amazon EKS optimized AMI to use with your node group (for example, 1.14.7- *YYYYMMDD* ). By default, the latest available AMI version for the node group’s current Kubernetes version is used. For more information, see Amazon EKS optimized Linux AMI Versions in the Amazon EKS User Guide . .. epigraph:: Changing this value triggers an update of the node group if one is available. However, only the latest available AMI release version is valid as an input. You cannot roll back to a previous AMI release version.

  • remote_access (Union[IResolvable, RemoteAccessProperty, None]) –

    The remote access (SSH) configuration to use with your node group. If you specify launchTemplate , then don’t specify remoteAccess , or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

  • scaling_config (Union[IResolvable, ScalingConfigProperty, None]) – The scaling configuration details for the Auto Scaling group that is created for your node group.

  • tags (Optional[Any]) – The metadata to apply to the node group to assist with categorization and organization. Each tag consists of a key and an optional value. You define both. Node group tags do not propagate to any other resources associated with the node group, such as the Amazon EC2 instances or subnets.

  • taints (Union[IResolvable, Sequence[Union[IResolvable, TaintProperty]], None]) – The Kubernetes taints to be applied to the nodes in the node group when they are created. Effect is one of No_Schedule , Prefer_No_Schedule , or No_Execute . Kubernetes taints can be used together with tolerations to control how workloads are scheduled to your nodes. For more information, see Node taints on managed node groups .

  • update_config (Union[IResolvable, UpdateConfigProperty, None]) – The node group update configuration.

  • version (Optional[str]) –

    The Kubernetes version to use for your managed nodes. By default, the Kubernetes version of the cluster is used, and this is the only accepted specified value. If you specify launchTemplate , and your launch template uses a custom AMI, then don’t specify version , or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters

path (str) – The path of the value to delete.

Return type

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters

target (CfnResource) –

Return type

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters
  • key (str) –

  • value (Any) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

None

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters

property_path (str) – The path to the property.

Return type

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters

attribute_name (str) – The name of the attribute.

Return type

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters

key (str) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

Any

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters

new_logical_id (str) – The new logical ID to use for this stack element.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Returns

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::EKS::Nodegroup'
ami_type

The AMI type for your node group.

GPU instance types should use the AL2_x86_64_GPU AMI type. Non-GPU instances should use the AL2_x86_64 AMI type. Arm instances should use the AL2_ARM_64 AMI type. All types use the Amazon EKS optimized Amazon Linux 2 AMI. If you specify launchTemplate , and your launch template uses a custom AMI, then don’t specify amiType , or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-amitype

Return type

Optional[str]

attr_arn

The Amazon Resource Name (ARN) associated with the managed node group.

CloudformationAttribute

Arn

Return type

str

attr_cluster_name

The name of the cluster that the managed node group resides in.

CloudformationAttribute

ClusterName

Return type

str

attr_id

Id

Type

cloudformationAttribute

Return type

str

attr_nodegroup_name

The name associated with an Amazon EKS managed node group.

CloudformationAttribute

NodegroupName

Return type

str

capacity_type

The capacity type of your managed node group.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-capacitytype

Return type

Optional[str]

cfn_options

Options for this resource, such as condition, update policy etc.

Return type

ICfnResourceOptions

cfn_resource_type

AWS resource type.

Return type

str

cluster_name

The name of the cluster to create the node group in.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-clustername

Return type

str

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

Return type

List[str]

disk_size

The root device disk size (in GiB) for your node group instances.

The default disk size is 20 GiB. If you specify launchTemplate , then don’t specify diskSize , or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-disksize

Return type

Union[int, float, None]

force_update_enabled

Force the update if the existing node group’s pods are unable to be drained due to a pod disruption budget issue.

If an update fails because pods could not be drained, you can force the update after it fails to terminate the old node whether or not any pods are running on the node.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-forceupdateenabled

Return type

Union[bool, IResolvable, None]

instance_types

Specify the instance types for a node group.

If you specify a GPU instance type, be sure to specify AL2_x86_64_GPU with the amiType parameter. If you specify launchTemplate , then you can specify zero or one instance type in your launch template or you can specify 0-20 instance types for instanceTypes . If however, you specify an instance type in your launch template and specify any instanceTypes , the node group deployment will fail. If you don’t specify an instance type in a launch template or for instanceTypes , then t3.medium is used, by default. If you specify Spot for capacityType , then we recommend specifying multiple values for instanceTypes . For more information, see Managed node group capacity types and Launch template support in the Amazon EKS User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-instancetypes

Return type

Optional[List[str]]

labels

The Kubernetes labels to be applied to the nodes in the node group when they are created.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-labels

Return type

Any

launch_template

An object representing a node group’s launch template specification.

If specified, then do not specify instanceTypes , diskSize , or remoteAccess and make sure that the launch template meets the requirements in launchTemplateSpecification .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-launchtemplate

Return type

Union[IResolvable, LaunchTemplateSpecificationProperty, None]

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Return type

str

Returns

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The construct tree node associated with this construct.

Return type

ConstructNode

node_role

The Amazon Resource Name (ARN) of the IAM role to associate with your node group.

The Amazon EKS worker node kubelet daemon makes calls to AWS APIs on your behalf. Nodes receive permissions for these API calls through an IAM instance profile and associated policies. Before you can launch nodes and register them into a cluster, you must create an IAM role for those nodes to use when they are launched. For more information, see Amazon EKS node IAM role in the Amazon EKS User Guide . If you specify launchTemplate , then don’t specify `IamInstanceProfile <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IamInstanceProfile.html>`_ in your launch template, or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-noderole

Return type

str

nodegroup_name

The unique name to give your node group.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-nodegroupname

Return type

Optional[str]

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Return type

str

release_version

//docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html>`_ in the Amazon EKS User Guide .

Changing this value triggers an update of the node group if one is available. However, only the latest available AMI release version is valid as an input. You cannot roll back to a previous AMI release version.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-releaseversion

Type

The AMI version of the Amazon EKS optimized AMI to use with your node group (for example, 1.14.7- *YYYYMMDD* ). By default, the latest available AMI version for the node group’s current Kubernetes version is used. For more information, see `Amazon EKS optimized Linux AMI Versions <https

Return type

Optional[str]

remote_access

The remote access (SSH) configuration to use with your node group.

If you specify launchTemplate , then don’t specify remoteAccess , or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-remoteaccess

Return type

Union[IResolvable, RemoteAccessProperty, None]

scaling_config

The scaling configuration details for the Auto Scaling group that is created for your node group.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-scalingconfig

Return type

Union[IResolvable, ScalingConfigProperty, None]

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Return type

Stack

subnets

The subnets to use for the Auto Scaling group that is created for your node group.

If you specify launchTemplate , then don’t specify `SubnetId <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html>`_ in your launch template, or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-subnets

Return type

List[str]

tags

The metadata to apply to the node group to assist with categorization and organization.

Each tag consists of a key and an optional value. You define both. Node group tags do not propagate to any other resources associated with the node group, such as the Amazon EC2 instances or subnets.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-tags

Return type

TagManager

taints

The Kubernetes taints to be applied to the nodes in the node group when they are created.

Effect is one of No_Schedule , Prefer_No_Schedule , or No_Execute . Kubernetes taints can be used together with tolerations to control how workloads are scheduled to your nodes. For more information, see Node taints on managed node groups .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-taints

Return type

Union[IResolvable, List[Union[IResolvable, TaintProperty]], None]

update_config

The node group update configuration.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-updateconfig

Return type

Union[IResolvable, UpdateConfigProperty, None]

version

The Kubernetes version to use for your managed nodes.

By default, the Kubernetes version of the cluster is used, and this is the only accepted specified value. If you specify launchTemplate , and your launch template uses a custom AMI, then don’t specify version , or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html#cfn-eks-nodegroup-version

Return type

Optional[str]

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters

x (Any) –

Return type

bool

Returns

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters

construct (IConstruct) –

Return type

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

LaunchTemplateSpecificationProperty

class CfnNodegroup.LaunchTemplateSpecificationProperty(*, id=None, name=None, version=None)

Bases: object

An object representing a node group launch template specification.

The launch template cannot include `SubnetId <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html>`_ , `IamInstanceProfile <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IamInstanceProfile.html>`_ , `RequestSpotInstances <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html>`_ , `HibernationOptions <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_HibernationOptionsRequest.html>`_ , or `TerminateInstances <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TerminateInstances.html>`_ , or the node group deployment or update will fail. For more information about launch templates, see `CreateLaunchTemplate <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html>`_ in the Amazon EC2 API Reference. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide .

Specify either name or id , but not both.

Parameters
  • id (Optional[str]) – The ID of the launch template.

  • name (Optional[str]) – The name of the launch template.

  • version (Optional[str]) – The version of the launch template to use. If no version is specified, then the template’s default version is used.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-launchtemplatespecification.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_eks as eks

launch_template_specification_property = eks.CfnNodegroup.LaunchTemplateSpecificationProperty(
    id="id",
    name="name",
    version="version"
)

Attributes

id

The ID of the launch template.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-launchtemplatespecification.html#cfn-eks-nodegroup-launchtemplatespecification-id

Return type

Optional[str]

name

The name of the launch template.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-launchtemplatespecification.html#cfn-eks-nodegroup-launchtemplatespecification-name

Return type

Optional[str]

version

The version of the launch template to use.

If no version is specified, then the template’s default version is used.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-launchtemplatespecification.html#cfn-eks-nodegroup-launchtemplatespecification-version

Return type

Optional[str]

RemoteAccessProperty

class CfnNodegroup.RemoteAccessProperty(*, ec2_ssh_key, source_security_groups=None)

Bases: object

An object representing the remote access configuration for the managed node group.

Parameters
  • ec2_ssh_key (str) – The Amazon EC2 SSH key that provides access for SSH communication with the nodes in the managed node group. For more information, see Amazon EC2 key pairs and Linux instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances .

  • source_security_groups (Optional[Sequence[str]]) – The security groups that are allowed SSH access (port 22) to the nodes. If you specify an Amazon EC2 SSH key but do not specify a source security group when you create a managed node group, then port 22 on the nodes is opened to the internet (0.0.0.0/0). For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-remoteaccess.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_eks as eks

remote_access_property = eks.CfnNodegroup.RemoteAccessProperty(
    ec2_ssh_key="ec2SshKey",

    # the properties below are optional
    source_security_groups=["sourceSecurityGroups"]
)

Attributes

ec2_ssh_key

The Amazon EC2 SSH key that provides access for SSH communication with the nodes in the managed node group.

For more information, see Amazon EC2 key pairs and Linux instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-remoteaccess.html#cfn-eks-nodegroup-remoteaccess-ec2sshkey

Return type

str

source_security_groups

The security groups that are allowed SSH access (port 22) to the nodes.

If you specify an Amazon EC2 SSH key but do not specify a source security group when you create a managed node group, then port 22 on the nodes is opened to the internet (0.0.0.0/0). For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-remoteaccess.html#cfn-eks-nodegroup-remoteaccess-sourcesecuritygroups

Return type

Optional[List[str]]

ScalingConfigProperty

class CfnNodegroup.ScalingConfigProperty(*, desired_size=None, max_size=None, min_size=None)

Bases: object

An object representing the scaling configuration details for the Auto Scaling group that is associated with your node group.

When creating a node group, you must specify all or none of the properties. When updating a node group, you can specify any or none of the properties.

Parameters
  • desired_size (Union[int, float, None]) – The current number of nodes that the managed node group should maintain. .. epigraph:: If you use Cluster Autoscaler, you shouldn’t change the desiredSize value directly, as this can cause the Cluster Autoscaler to suddenly scale up or scale down. Whenever this parameter changes, the number of worker nodes in the node group is updated to the specified size. If this parameter is given a value that is smaller than the current number of running worker nodes, the necessary number of worker nodes are terminated to match the given value. When using CloudFormation, no action occurs if you remove this parameter from your CFN template. This parameter can be different from minSize in some cases, such as when starting with extra hosts for testing. This parameter can also be different when you want to start with an estimated number of needed hosts, but let Cluster Autoscaler reduce the number if there are too many. When Cluster Autoscaler is used, the desiredSize parameter is altered by Cluster Autoscaler (but can be out-of-date for short periods of time). Cluster Autoscaler doesn’t scale a managed node group lower than minSize or higher than maxSize.

  • max_size (Union[int, float, None]) – The maximum number of nodes that the managed node group can scale out to. For information about the maximum number that you can specify, see Amazon EKS service quotas in the Amazon EKS User Guide .

  • min_size (Union[int, float, None]) – The minimum number of nodes that the managed node group can scale in to.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-scalingconfig.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_eks as eks

scaling_config_property = eks.CfnNodegroup.ScalingConfigProperty(
    desired_size=123,
    max_size=123,
    min_size=123
)

Attributes

desired_size

The current number of nodes that the managed node group should maintain.

If you use Cluster Autoscaler, you shouldn’t change the desiredSize value directly, as this can cause the Cluster Autoscaler to suddenly scale up or scale down.

Whenever this parameter changes, the number of worker nodes in the node group is updated to the specified size. If this parameter is given a value that is smaller than the current number of running worker nodes, the necessary number of worker nodes are terminated to match the given value. When using CloudFormation, no action occurs if you remove this parameter from your CFN template.

This parameter can be different from minSize in some cases, such as when starting with extra hosts for testing. This parameter can also be different when you want to start with an estimated number of needed hosts, but let Cluster Autoscaler reduce the number if there are too many. When Cluster Autoscaler is used, the desiredSize parameter is altered by Cluster Autoscaler (but can be out-of-date for short periods of time). Cluster Autoscaler doesn’t scale a managed node group lower than minSize or higher than maxSize.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-scalingconfig.html#cfn-eks-nodegroup-scalingconfig-desiredsize

Return type

Union[int, float, None]

max_size

The maximum number of nodes that the managed node group can scale out to.

For information about the maximum number that you can specify, see Amazon EKS service quotas in the Amazon EKS User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-scalingconfig.html#cfn-eks-nodegroup-scalingconfig-maxsize

Return type

Union[int, float, None]

min_size

The minimum number of nodes that the managed node group can scale in to.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-scalingconfig.html#cfn-eks-nodegroup-scalingconfig-minsize

Return type

Union[int, float, None]

TaintProperty

class CfnNodegroup.TaintProperty(*, effect=None, key=None, value=None)

Bases: object

A property that allows a node to repel a set of pods.

For more information, see Node taints on managed node groups .

Parameters
  • effect (Optional[str]) – The effect of the taint.

  • key (Optional[str]) – The key of the taint.

  • value (Optional[str]) – The value of the taint.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-taint.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_eks as eks

taint_property = eks.CfnNodegroup.TaintProperty(
    effect="effect",
    key="key",
    value="value"
)

Attributes

effect

The effect of the taint.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-taint.html#cfn-eks-nodegroup-taint-effect

Return type

Optional[str]

key

The key of the taint.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-taint.html#cfn-eks-nodegroup-taint-key

Return type

Optional[str]

value

The value of the taint.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-taint.html#cfn-eks-nodegroup-taint-value

Return type

Optional[str]

UpdateConfigProperty

class CfnNodegroup.UpdateConfigProperty(*, max_unavailable=None, max_unavailable_percentage=None)

Bases: object

The update configuration for the node group.

Parameters
  • max_unavailable (Union[int, float, None]) – The maximum number of nodes unavailable at once during a version update. Nodes will be updated in parallel. This value or maxUnavailablePercentage is required to have a value.The maximum number is 100.

  • max_unavailable_percentage (Union[int, float, None]) – The maximum percentage of nodes unavailable during a version update. This percentage of nodes will be updated in parallel, up to 100 nodes at once. This value or maxUnavailable is required to have a value.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-updateconfig.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_eks as eks

update_config_property = eks.CfnNodegroup.UpdateConfigProperty(
    max_unavailable=123,
    max_unavailable_percentage=123
)

Attributes

max_unavailable

The maximum number of nodes unavailable at once during a version update.

Nodes will be updated in parallel. This value or maxUnavailablePercentage is required to have a value.The maximum number is 100.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-updateconfig.html#cfn-eks-nodegroup-updateconfig-maxunavailable

Return type

Union[int, float, None]

max_unavailable_percentage

The maximum percentage of nodes unavailable during a version update.

This percentage of nodes will be updated in parallel, up to 100 nodes at once. This value or maxUnavailable is required to have a value.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-eks-nodegroup-updateconfig.html#cfn-eks-nodegroup-updateconfig-maxunavailablepercentage

Return type

Union[int, float, None]