nodegroups
Creates, updates, deletes or gets a nodegroup resource or lists nodegroups in a region
Overview
| Name | nodegroups |
| Type | Resource |
| Description | Resource schema for AWS::EKS::Nodegroup |
| Id | awscc.eks.nodegroups |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
ami_type | string | The AMI type for your node group. |
capacity_type | string | The capacity type of your managed node group. |
cluster_name | string | Name of the cluster to create the node group in. |
disk_size | integer | The root device disk size (in GiB) for your node group instances. |
force_update_enabled | boolean | Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue. |
instance_types | array | Specify the instance types for a node group. |
labels | object | The Kubernetes labels to be applied to the nodes in the node group when they are created. |
launch_template | object | An object representing a node group's launch template specification. |
nodegroup_name | string | The unique name to give your node group. |
node_role | string | The Amazon Resource Name (ARN) of the IAM role to associate with your node group. |
release_version | string | The AMI version of the Amazon EKS-optimized AMI to use with your node group. |
remote_access | object | The remote access (SSH) configuration to use with your node group. |
scaling_config | object | The scaling configuration details for the Auto Scaling group that is created for your node group. |
subnets | array | The subnets to use for the Auto Scaling group that is created for your node group. |
tags | object | The metadata, as key-value pairs, to apply to the node group to assist with categorization and organization. Follows same schema as Labels for consistency. |
taints | array | The Kubernetes taints to be applied to the nodes in the node group when they are created. |
update_config | object | The node group update configuration. |
node_repair_config | object | The node auto repair configuration for node group. |
version | string | The Kubernetes version to use for your managed nodes. |
id | string | |
arn | string | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | |
region | string | AWS region. |
For more information, see AWS::EKS::Nodegroup.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | nodegroups | INSERT | ClusterName, NodeRole, Subnets, region |
delete_resource | nodegroups | DELETE | Identifier, region |
update_resource | nodegroups | UPDATE | Identifier, PatchDocument, region |
list_resources | nodegroups_list_only | SELECT | region |
get_resource | nodegroups | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual nodegroup.
SELECT
region,
ami_type,
capacity_type,
cluster_name,
disk_size,
force_update_enabled,
instance_types,
labels,
launch_template,
nodegroup_name,
node_role,
release_version,
remote_access,
scaling_config,
subnets,
tags,
taints,
update_config,
node_repair_config,
version,
id,
arn
FROM awscc.eks.nodegroups
WHERE
region = 'us-east-1' AND
Identifier = '{{ id }}';
Lists all nodegroups in a region.
SELECT
region,
id
FROM awscc.eks.nodegroups_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new nodegroup resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.eks.nodegroups (
ClusterName,
NodeRole,
Subnets,
region
)
SELECT
'{{ cluster_name }}',
'{{ node_role }}',
'{{ subnets }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.eks.nodegroups (
AmiType,
CapacityType,
ClusterName,
DiskSize,
ForceUpdateEnabled,
InstanceTypes,
Labels,
LaunchTemplate,
NodegroupName,
NodeRole,
ReleaseVersion,
RemoteAccess,
ScalingConfig,
Subnets,
Tags,
Taints,
UpdateConfig,
NodeRepairConfig,
Version,
region
)
SELECT
'{{ ami_type }}',
'{{ capacity_type }}',
'{{ cluster_name }}',
'{{ disk_size }}',
'{{ force_update_enabled }}',
'{{ instance_types }}',
'{{ labels }}',
'{{ launch_template }}',
'{{ nodegroup_name }}',
'{{ node_role }}',
'{{ release_version }}',
'{{ remote_access }}',
'{{ scaling_config }}',
'{{ subnets }}',
'{{ tags }}',
'{{ taints }}',
'{{ update_config }}',
'{{ node_repair_config }}',
'{{ version }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: nodegroup
props:
- name: ami_type
value: '{{ ami_type }}'
- name: capacity_type
value: '{{ capacity_type }}'
- name: cluster_name
value: '{{ cluster_name }}'
- name: disk_size
value: '{{ disk_size }}'
- name: force_update_enabled
value: '{{ force_update_enabled }}'
- name: instance_types
value:
- '{{ instance_types[0] }}'
- name: labels
value: {}
- name: launch_template
value:
id: '{{ id }}'
version: '{{ version }}'
name: '{{ name }}'
- name: nodegroup_name
value: '{{ nodegroup_name }}'
- name: node_role
value: '{{ node_role }}'
- name: release_version
value: '{{ release_version }}'
- name: remote_access
value:
source_security_groups:
- '{{ source_security_groups[0] }}'
ec2_ssh_key: '{{ ec2_ssh_key }}'
- name: scaling_config
value:
min_size: '{{ min_size }}'
desired_size: '{{ desired_size }}'
max_size: '{{ max_size }}'
- name: subnets
value:
- '{{ subnets[0] }}'
- name: tags
value: {}
- name: taints
value:
- key: '{{ key }}'
value: '{{ value }}'
effect: '{{ effect }}'
- name: update_config
value:
max_unavailable: null
max_unavailable_percentage: null
update_strategy: '{{ update_strategy }}'
- name: node_repair_config
value:
enabled: '{{ enabled }}'
- name: version
value: '{{ version }}'
UPDATE example
Use the following StackQL query and manifest file to update a nodegroup resource, using stack-deploy.
/*+ update */
UPDATE awscc.eks.nodegroups
SET PatchDocument = string('{{ {
"ForceUpdateEnabled": force_update_enabled,
"Labels": labels,
"LaunchTemplate": launch_template,
"ReleaseVersion": release_version,
"ScalingConfig": scaling_config,
"Tags": tags,
"Taints": taints,
"UpdateConfig": update_config,
"NodeRepairConfig": node_repair_config,
"Version": version
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
DELETE example
/*+ delete */
DELETE FROM awscc.eks.nodegroups
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';
Permissions
To operate on the nodegroups resource, the following permissions are required:
- Create
- Read
- Delete
- List
- Update
eks:CreateNodegroup,
eks:DescribeNodegroup,
eks:TagResource,
ec2:DescribeSubnets,
ec2:DescribeVpcs,
ec2:DescribeSecurityGroups,
ec2:DescribeKeyPairs,
ec2:CreateTags,
ec2:DeleteTags,
ec2:DescribeRouteTables,
ec2:DescribeLaunchTemplates,
ec2:DescribeLaunchTemplateVersions,
ec2:RunInstances,
iam:CreateServiceLinkedRole,
iam:GetRole,
iam:PassRole,
iam:ListAttachedRolePolicies
eks:DescribeNodegroup
eks:DeleteNodegroup,
eks:DescribeNodegroup
eks:ListNodegroups
iam:GetRole,
iam:PassRole,
eks:DescribeNodegroup,
eks:DescribeUpdate,
eks:ListUpdates,
eks:TagResource,
eks:UntagResource,
eks:UpdateNodegroupConfig,
eks:UpdateNodegroupVersion,
ec2:DescribeLaunchTemplateVersions,
ec2:RunInstances