NodeGroupArgs

data class NodeGroupArgs(val amiType: Output<String>? = null, val capacityType: Output<String>? = null, val clusterName: Output<String>? = null, val diskSize: Output<Int>? = null, val forceUpdateVersion: Output<Boolean>? = null, val instanceTypes: Output<List<String>>? = null, val labels: Output<Map<String, String>>? = null, val launchTemplate: Output<NodeGroupLaunchTemplateArgs>? = null, val nodeGroupName: Output<String>? = null, val nodeGroupNamePrefix: Output<String>? = null, val nodeRoleArn: Output<String>? = null, val releaseVersion: Output<String>? = null, val remoteAccess: Output<NodeGroupRemoteAccessArgs>? = null, val scalingConfig: Output<NodeGroupScalingConfigArgs>? = null, val subnetIds: Output<List<String>>? = null, val tags: Output<Map<String, String>>? = null, val taints: Output<List<NodeGroupTaintArgs>>? = null, val updateConfig: Output<NodeGroupUpdateConfigArgs>? = null, val version: Output<String>? = null) : ConvertibleToJava<NodeGroupArgs>

Manages an EKS Node Group, which can provision and optionally update an Auto Scaling Group of Kubernetes worker nodes compatible with EKS. Additional documentation about this functionality can be found in the EKS User Guide.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.eks.NodeGroup;
import com.pulumi.aws.eks.NodeGroupArgs;
import com.pulumi.aws.eks.inputs.NodeGroupScalingConfigArgs;
import com.pulumi.aws.eks.inputs.NodeGroupUpdateConfigArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new NodeGroup("example", NodeGroupArgs.builder()
.clusterName(aws_eks_cluster.example().name())
.nodeRoleArn(aws_iam_role.example().arn())
.subnetIds(aws_subnet.example().stream().map(element -> element.id()).collect(toList()))
.scalingConfig(NodeGroupScalingConfigArgs.builder()
.desiredSize(1)
.maxSize(2)
.minSize(1)
.build())
.updateConfig(NodeGroupUpdateConfigArgs.builder()
.maxUnavailable(1)
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(
aws_iam_role_policy_attachment.example-AmazonEKSWorkerNodePolicy(),
aws_iam_role_policy_attachment.example-AmazonEKS_CNI_Policy(),
aws_iam_role_policy_attachment.example-AmazonEC2ContainerRegistryReadOnly())
.build());
}
}

Ignoring Changes to Desired Size

You can utilize ignoreChanges create an EKS Node Group with an initial size of running instances, then ignore any changes to that count caused externally (e.g. Application Autoscaling).

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.eks.NodeGroup;
import com.pulumi.aws.eks.NodeGroupArgs;
import com.pulumi.aws.eks.inputs.NodeGroupScalingConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new NodeGroup("example", NodeGroupArgs.builder()
.scalingConfig(NodeGroupScalingConfigArgs.builder()
.desiredSize(2)
.build())
.build());
}
}

Example IAM Role for EKS Node Group

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.RolePolicyAttachment;
import com.pulumi.aws.iam.RolePolicyAttachmentArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Role("example", RoleArgs.builder()
.assumeRolePolicy(serializeJson(
jsonObject(
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Action", "sts:AssumeRole"),
jsonProperty("Effect", "Allow"),
jsonProperty("Principal", jsonObject(
jsonProperty("Service", "ec2.amazonaws.com")
))
))),
jsonProperty("Version", "2012-10-17")
)))
.build());
var example_AmazonEKSWorkerNodePolicy = new RolePolicyAttachment("example-AmazonEKSWorkerNodePolicy", RolePolicyAttachmentArgs.builder()
.policyArn("arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy")
.role(example.name())
.build());
var example_AmazonEKSCNIPolicy = new RolePolicyAttachment("example-AmazonEKSCNIPolicy", RolePolicyAttachmentArgs.builder()
.policyArn("arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy")
.role(example.name())
.build());
var example_AmazonEC2ContainerRegistryReadOnly = new RolePolicyAttachment("example-AmazonEC2ContainerRegistryReadOnly", RolePolicyAttachmentArgs.builder()
.policyArn("arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly")
.role(example.name())
.build());
}
}

Import

EKS Node Groups can be imported using the cluster_name and node_group_name separated by a colon (:), e.g.,

$ pulumi import aws:eks/nodeGroup:NodeGroup my_node_group my_cluster:my_node_group

Constructors

Link copied to clipboard
constructor(amiType: Output<String>? = null, capacityType: Output<String>? = null, clusterName: Output<String>? = null, diskSize: Output<Int>? = null, forceUpdateVersion: Output<Boolean>? = null, instanceTypes: Output<List<String>>? = null, labels: Output<Map<String, String>>? = null, launchTemplate: Output<NodeGroupLaunchTemplateArgs>? = null, nodeGroupName: Output<String>? = null, nodeGroupNamePrefix: Output<String>? = null, nodeRoleArn: Output<String>? = null, releaseVersion: Output<String>? = null, remoteAccess: Output<NodeGroupRemoteAccessArgs>? = null, scalingConfig: Output<NodeGroupScalingConfigArgs>? = null, subnetIds: Output<List<String>>? = null, tags: Output<Map<String, String>>? = null, taints: Output<List<NodeGroupTaintArgs>>? = null, updateConfig: Output<NodeGroupUpdateConfigArgs>? = null, version: Output<String>? = null)

Properties

Link copied to clipboard
val amiType: Output<String>? = null

Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the AWS documentation for valid values. This provider will only perform drift detection if a configuration value is provided.

Link copied to clipboard
val capacityType: Output<String>? = null

Type of capacity associated with the EKS Node Group. Valid values: ON_DEMAND, SPOT. This provider will only perform drift detection if a configuration value is provided.

Link copied to clipboard
val clusterName: Output<String>? = null

Name of the EKS Cluster. Must be between 1-100 characters in length. Must begin with an alphanumeric character, and must only contain alphanumeric characters, dashes and underscores (^[0-9A-Za-z][A-Za-z0-9\-_]+$).

Link copied to clipboard
val diskSize: Output<Int>? = null

Disk size in GiB for worker nodes. Defaults to 50 for Windows, 20 all other node groups. The provider will only perform drift detection if a configuration value is provided.

Link copied to clipboard
val forceUpdateVersion: Output<Boolean>? = null

Force version update if existing pods are unable to be drained due to a pod disruption budget issue.

Link copied to clipboard
val instanceTypes: Output<List<String>>? = null

List of instance types associated with the EKS Node Group. Defaults to ["t3&#46;medium"]. The provider will only perform drift detection if a configuration value is provided.

Link copied to clipboard
val labels: Output<Map<String, String>>? = null

Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed.

Link copied to clipboard

Configuration block with Launch Template settings. Detailed below.

Link copied to clipboard
val nodeGroupName: Output<String>? = null

Name of the EKS Node Group. If omitted, the provider will assign a random, unique name. Conflicts with node_group_name_prefix. The node group name can't be longer than 63 characters. It must start with a letter or digit, but can also include hyphens and underscores for the remaining characters.

Link copied to clipboard
val nodeGroupNamePrefix: Output<String>? = null

Creates a unique name beginning with the specified prefix. Conflicts with node_group_name.

Link copied to clipboard
val nodeRoleArn: Output<String>? = null

Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group.

Link copied to clipboard
val releaseVersion: Output<String>? = null

AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version.

Link copied to clipboard

Configuration block with remote access settings. Detailed below.

Link copied to clipboard

Configuration block with scaling settings. Detailed below.

Link copied to clipboard
val subnetIds: Output<List<String>>? = null

Identifiers of EC2 Subnets to associate with the EKS Node Group. These subnets must have the following resource tag: kubernetes.io/cluster/CLUSTER_NAME (where CLUSTER_NAME is replaced with the name of the EKS Cluster). The following arguments are optional:

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val taints: Output<List<NodeGroupTaintArgs>>? = null

The Kubernetes taints to be applied to the nodes in the node group. Maximum of 50 taints per node group. Detailed below.

Link copied to clipboard
Link copied to clipboard
val version: Output<String>? = null

Kubernetes version. Defaults to EKS Cluster Kubernetes version. The provider will only perform drift detection if a configuration value is provided.

Functions

Link copied to clipboard
open override fun toJava(): NodeGroupArgs