Class NodeGroup
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
Example IAM Role for EKS Node Group
using System.Collections.Generic;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Iam.Role("example", new Aws.Iam.RoleArgs
{
AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
{
{ "Statement", new[]
{
new Dictionary<string, object?>
{
{ "Action", "sts:AssumeRole" },
{ "Effect", "Allow" },
{ "Principal", new Dictionary<string, object?>
{
{ "Service", "ec2.amazonaws.com" },
} },
},
}
},
{ "Version", "2012-10-17" },
}),
});
var example_AmazonEKSWorkerNodePolicy = new Aws.Iam.RolePolicyAttachment("example-AmazonEKSWorkerNodePolicy", new Aws.Iam.RolePolicyAttachmentArgs
{
PolicyArn = "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy",
Role = example.Name,
});
var example_AmazonEKSCNIPolicy = new Aws.Iam.RolePolicyAttachment("example-AmazonEKSCNIPolicy", new Aws.Iam.RolePolicyAttachmentArgs
{
PolicyArn = "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy",
Role = example.Name,
});
var example_AmazonEC2ContainerRegistryReadOnly = new Aws.Iam.RolePolicyAttachment("example-AmazonEC2ContainerRegistryReadOnly", new Aws.Iam.RolePolicyAttachmentArgs
{
PolicyArn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly",
Role = example.Name,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Eks
Assembly: Pulumi.Aws.dll
Syntax
public class NodeGroup : CustomResource
Constructors
View SourceNodeGroup(String, NodeGroupArgs, CustomResourceOptions)
Create a NodeGroup resource with the given unique name, arguments, and options.
Declaration
public NodeGroup(string name, NodeGroupArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| NodeGroupArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAmiType
Type of Amazon Machine Image (AMI) associated with the EKS Node Group. Defaults to AL2_x86_64. Valid values: AL2_x86_64, AL2_x86_64_GPU. This provider will only perform drift detection if a configuration value is provided.
Declaration
public Output<string> AmiType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Arn
Amazon Resource Name (ARN) of the EKS Node Group.
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ClusterName
Name of the EKS Cluster.
Declaration
public Output<string> ClusterName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DiskSize
Disk size in GiB for worker nodes. Defaults to 20. This provider will only perform drift detection if a configuration value is provided.
Declaration
public Output<int> DiskSize { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
ForceUpdateVersion
Force version update if existing pods are unable to be drained due to a pod disruption budget issue.
Declaration
public Output<bool?> ForceUpdateVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
InstanceTypes
Set of instance types associated with the EKS Node Group. Defaults to ["t3.medium"]. This provider will only perform drift detection if a configuration value is provided. Currently, the EKS API only accepts a single value in the set.
Declaration
public Output<string> InstanceTypes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Labels
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.
Declaration
public Output<ImmutableDictionary<string, string>> Labels { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
NodeGroupName
Name of the EKS Node Group.
Declaration
public Output<string> NodeGroupName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NodeRoleArn
Amazon Resource Name (ARN) of the IAM Role that provides permissions for the EKS Node Group.
Declaration
public Output<string> NodeRoleArn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ReleaseVersion
AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version.
Declaration
public Output<string> ReleaseVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RemoteAccess
Configuration block with remote access settings. Detailed below.
Declaration
public Output<NodeGroupRemoteAccess> RemoteAccess { get; }
Property Value
| Type | Description |
|---|---|
| Output<NodeGroupRemoteAccess> |
Resources
List of objects containing information about underlying resources.
Declaration
public Output<ImmutableArray<NodeGroupResource>> Resources { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<NodeGroupResource>> |
ScalingConfig
Configuration block with scaling settings. Detailed below.
Declaration
public Output<NodeGroupScalingConfig> ScalingConfig { get; }
Property Value
| Type | Description |
|---|---|
| Output<NodeGroupScalingConfig> |
Status
Status of the EKS Node Group.
Declaration
public Output<string> Status { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SubnetIds
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).
Declaration
public Output<ImmutableArray<string>> SubnetIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Tags
Key-value mapping of resource tags.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
Version
Kubernetes version. Defaults to EKS Cluster Kubernetes version. This provider will only perform drift detection if a configuration value is provided.
Declaration
public Output<string> Version { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, NodeGroupState, CustomResourceOptions)
Get an existing NodeGroup resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static NodeGroup Get(string name, Input<string> id, NodeGroupState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| NodeGroupState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| NodeGroup |