Skip to main content

clusters

Creates, updates, deletes or gets a cluster resource or lists clusters in a region

Overview

Nameclusters
TypeResource
DescriptionAn object representing an Amazon EKS cluster.
Idaws.eks.clusters

Fields

NameDatatypeDescription
loggingobjectEnable 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.
encryption_config_key_arnstringAmazon Resource Name (ARN) or alias of the customer master key (CMK).
access_configobjectAn object representing the Access Config to use for the cluster.
certificate_authority_datastringThe certificate-authority-data for your cluster.
encryption_configarray
kubernetes_network_configobjectThe Kubernetes network configuration for the cluster.
role_arnstringThe 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.
namestringThe unique name to give to your cluster.
endpointstringThe endpoint for your Kubernetes API server, such as https://5E1D0CEXAMPLEA591B746AFC5AB30262.yl4.us-west-2.eks.amazonaws.com.
versionstringThe desired Kubernetes version for your cluster. If you don't specify a value here, the latest version available in Amazon EKS is used.
cluster_security_group_idstringThe 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.
idstringThe unique ID given to your cluster.
outpost_configobjectAn object representing the Outpost configuration to use for AWS EKS outpost cluster.
arnstringThe ARN of the cluster, such as arn:aws:eks:us-west-2:666666666666:cluster/prod.
resources_vpc_configobjectAn object representing the VPC configuration to use for an Amazon EKS cluster.
tagsarrayAn array of key-value pairs to apply to this resource.
open_id_connect_issuer_urlstringThe 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.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTRoleArn, ResourcesVpcConfig, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all clusters in a region.

SELECT
region,
logging,
encryption_config_key_arn,
access_config,
certificate_authority_data,
encryption_config,
kubernetes_network_config,
role_arn,
name,
endpoint,
version,
cluster_security_group_id,
id,
outpost_config,
arn,
resources_vpc_config,
tags,
open_id_connect_issuer_url
FROM aws.eks.clusters
WHERE region = 'us-east-1';

Gets all properties from an individual cluster.

SELECT
region,
logging,
encryption_config_key_arn,
access_config,
certificate_authority_data,
encryption_config,
kubernetes_network_config,
role_arn,
name,
endpoint,
version,
cluster_security_group_id,
id,
outpost_config,
arn,
resources_vpc_config,
tags,
open_id_connect_issuer_url
FROM aws.eks.clusters
WHERE region = 'us-east-1' AND data__Identifier = '<Name>';

INSERT example

Use the following StackQL query and manifest file to create a new cluster resource, using stack-deploy.

/*+ create */
INSERT INTO aws.eks.clusters (
RoleArn,
ResourcesVpcConfig,
region
)
SELECT
'{{ RoleArn }}',
'{{ ResourcesVpcConfig }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.eks.clusters
WHERE data__Identifier = '<Name>'
AND region = 'us-east-1';

Permissions

To operate on the clusters resource, the following permissions are required:

Read

eks:DescribeCluster

Create

eks:CreateCluster,
eks:DescribeCluster,
eks:TagResource,
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

Update

iam:PassRole,
eks:UpdateClusterConfig,
eks:UpdateClusterVersion,
eks:DescribeCluster,
eks:DescribeUpdate,
eks:TagResource,
eks:UntagResource

List

eks:ListClusters

Delete

eks:DeleteCluster,
eks:DescribeCluster