clusters
Creates, updates, deletes or gets a cluster resource or lists clusters in a region
Overview
| Name | clusters |
| Type | Resource |
| Description | An object representing an Amazon EKS cluster. |
| Id | awscc.eks.clusters |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
encryption_config | array | |
kubernetes_network_config | object | The Kubernetes network configuration for the cluster. |
logging | object | Enable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs based on log types. By default, cluster control plane logs aren't exported to CloudWatch Logs. |
name | string | The unique name to give to your cluster. |
id | string | The unique ID given to your cluster. |
resources_vpc_config | object | An object representing the VPC configuration to use for an Amazon EKS cluster. |
outpost_config | object | An object representing the Outpost configuration to use for AWS EKS outpost cluster. |
access_config | object | An object representing the Access Config to use for the cluster. |
upgrade_policy | object | An object representing the Upgrade Policy to use for the cluster. |
remote_network_config | object | Configuration fields for specifying on-premises node and pod CIDRs that are external to the VPC passed during cluster creation. |
compute_config | object | Todo: add description |
storage_config | object | Todo: add description |
role_arn | string | The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. |
version | string | The desired Kubernetes version for your cluster. If you don't specify a value here, the latest version available in Amazon EKS is used. |
force | boolean | Force cluster version update |
tags | array | An array of key-value pairs to apply to this resource. |
arn | string | The ARN of the cluster, such as arn:aws:eks:us-west-2:666666666666:cluster/prod. |
endpoint | string | The endpoint for your Kubernetes API server, such as https://5E1D0CEXAMPLEA591B746AFC5AB30262.yl4.us-west-2.eks.amazonaws.com. |
certificate_authority_data | string | The certificate-authority-data for your cluster. |
cluster_security_group_id | string | The cluster security group that was created by Amazon EKS for the cluster. Managed node groups use this security group for control plane to data plane communication. |
encryption_config_key_arn | string | Amazon Resource Name (ARN) or alias of the customer master key (CMK). |
open_id_connect_issuer_url | string | The issuer URL for the cluster's OIDC identity provider, such as https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B716D3041E. If you need to remove https:// from this output value, you can include the following code in your template. |
bootstrap_self_managed_addons | boolean | Set this value to false to avoid creating the default networking add-ons when the cluster is created. |
deletion_protection | boolean | Set this value to true to enable deletion protection for the cluster. |
zonal_shift_config | object | The current zonal shift configuration to use for the cluster. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
name | string | The unique name to give to your cluster. |
region | string | AWS region. |
For more information, see AWS::EKS::Cluster.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | clusters | INSERT | RoleArn, ResourcesVpcConfig, region |
delete_resource | clusters | DELETE | Identifier, region |
update_resource | clusters | UPDATE | Identifier, PatchDocument, region |
list_resources | clusters_list_only | SELECT | region |
get_resource | clusters | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual cluster.
SELECT
region,
encryption_config,
kubernetes_network_config,
logging,
name,
id,
resources_vpc_config,
outpost_config,
access_config,
upgrade_policy,
remote_network_config,
compute_config,
storage_config,
role_arn,
version,
force,
tags,
arn,
endpoint,
certificate_authority_data,
cluster_security_group_id,
encryption_config_key_arn,
open_id_connect_issuer_url,
bootstrap_self_managed_addons,
deletion_protection,
zonal_shift_config
FROM awscc.eks.clusters
WHERE
region = 'us-east-1' AND
Identifier = '{{ name }}';
Lists all clusters in a region.
SELECT
region,
name
FROM awscc.eks.clusters_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new cluster resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.eks.clusters (
ResourcesVpcConfig,
RoleArn,
region
)
SELECT
'{{ resources_vpc_config }}',
'{{ role_arn }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.eks.clusters (
EncryptionConfig,
KubernetesNetworkConfig,
Logging,
Name,
ResourcesVpcConfig,
OutpostConfig,
AccessConfig,
UpgradePolicy,
RemoteNetworkConfig,
ComputeConfig,
StorageConfig,
RoleArn,
Version,
Force,
Tags,
BootstrapSelfManagedAddons,
DeletionProtection,
ZonalShiftConfig,
region
)
SELECT
'{{ encryption_config }}',
'{{ kubernetes_network_config }}',
'{{ logging }}',
'{{ name }}',
'{{ resources_vpc_config }}',
'{{ outpost_config }}',
'{{ access_config }}',
'{{ upgrade_policy }}',
'{{ remote_network_config }}',
'{{ compute_config }}',
'{{ storage_config }}',
'{{ role_arn }}',
'{{ version }}',
'{{ force }}',
'{{ tags }}',
'{{ bootstrap_self_managed_addons }}',
'{{ deletion_protection }}',
'{{ zonal_shift_config }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: cluster
props:
- name: encryption_config
value:
- provider:
key_arn: '{{ key_arn }}'
resources:
- '{{ resources[0] }}'
- name: kubernetes_network_config
value:
service_ipv4_cidr: '{{ service_ipv4_cidr }}'
service_ipv6_cidr: '{{ service_ipv6_cidr }}'
ip_family: '{{ ip_family }}'
elastic_load_balancing:
enabled: '{{ enabled }}'
- name: logging
value:
cluster_logging:
enabled_types:
- type: '{{ type }}'
- name: name
value: '{{ name }}'
- name: resources_vpc_config
value:
endpoint_private_access: '{{ endpoint_private_access }}'
endpoint_public_access: '{{ endpoint_public_access }}'
public_access_cidrs:
- '{{ public_access_cidrs[0] }}'
security_group_ids:
- '{{ security_group_ids[0] }}'
subnet_ids:
- '{{ subnet_ids[0] }}'
- name: outpost_config
value:
outpost_arns:
- '{{ outpost_arns[0] }}'
control_plane_instance_type: '{{ control_plane_instance_type }}'
control_plane_placement:
group_name: '{{ group_name }}'
- name: access_config
value:
bootstrap_cluster_creator_admin_permissions: '{{ bootstrap_cluster_creator_admin_permissions }}'
authentication_mode: '{{ authentication_mode }}'
- name: upgrade_policy
value:
support_type: '{{ support_type }}'
- name: remote_network_config
value:
remote_node_networks:
- cidrs:
- '{{ cidrs[0] }}'
remote_pod_networks:
- cidrs:
- '{{ cidrs[0] }}'
- name: compute_config
value:
enabled: '{{ enabled }}'
node_role_arn: '{{ node_role_arn }}'
node_pools:
- '{{ node_pools[0] }}'
- name: storage_config
value:
block_storage:
enabled: '{{ enabled }}'
- name: role_arn
value: '{{ role_arn }}'
- name: version
value: '{{ version }}'
- name: force
value: '{{ force }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: bootstrap_self_managed_addons
value: '{{ bootstrap_self_managed_addons }}'
- name: deletion_protection
value: '{{ deletion_protection }}'
- name: zonal_shift_config
value:
enabled: '{{ enabled }}'
UPDATE example
Use the following StackQL query and manifest file to update a cluster resource, using stack-deploy.
/*+ update */
UPDATE awscc.eks.clusters
SET PatchDocument = string('{{ {
"Logging": logging,
"ResourcesVpcConfig": resources_vpc_config,
"UpgradePolicy": upgrade_policy,
"RemoteNetworkConfig": remote_network_config,
"ComputeConfig": compute_config,
"StorageConfig": storage_config,
"Version": version,
"Force": force,
"Tags": tags,
"DeletionProtection": deletion_protection,
"ZonalShiftConfig": zonal_shift_config
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.eks.clusters
WHERE
Identifier = '{{ name }}' AND
region = 'us-east-1';
Permissions
To operate on the clusters resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
eks:CreateCluster,
eks:DescribeCluster,
eks:TagResource,
eks:CreateAccessEntry,
iam:PassRole,
iam:GetRole,
iam:ListAttachedRolePolicies,
iam:CreateServiceLinkedRole,
iam:CreateInstanceProfile,
iam:TagInstanceProfile,
iam:AddRoleToInstanceProfile,
iam:GetInstanceProfile,
iam:DeleteInstanceProfile,
iam:RemoveRoleFromInstanceProfile,
ec2:DescribeSubnets,
ec2:DescribeVpcs,
kms:DescribeKey,
kms:CreateGrant
eks:DescribeCluster
iam:PassRole,
eks:UpdateClusterConfig,
eks:UpdateClusterVersion,
eks:DescribeCluster,
eks:DescribeUpdate,
eks:TagResource,
eks:UntagResource
eks:DeleteCluster,
eks:DescribeCluster
eks:ListClusters