You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::EKS::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for Amazon Elastic Kubernetes Service. To construct a client, you need to configure a :region and :credentials.

eks = Aws::EKS::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::EKS::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::EKS::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#create_cluster(options = {}) ⇒ Types::CreateClusterResponse

Creates an Amazon EKS control plane.

The Amazon EKS control plane consists of control plane instances that run the Kubernetes software, such as etcd and the API server. The control plane runs in an account managed by AWS, and the Kubernetes API is exposed via the Amazon EKS API server endpoint. Each Amazon EKS cluster control plane is single-tenant and unique and runs on its own set of Amazon EC2 instances.

The cluster control plane is provisioned across multiple Availability Zones and fronted by an Elastic Load Balancing Network Load Balancer. Amazon EKS also provisions elastic network interfaces in your VPC subnets to provide connectivity from the control plane instances to the worker nodes (for example, to support kubectl exec, logs, and proxy data flows).

Amazon EKS worker nodes run in your AWS account and connect to your cluster's control plane via the Kubernetes API server endpoint and a certificate file that is created for your cluster.

You can use the endpointPublicAccess and endpointPrivateAccess parameters to enable or disable public and private access to your cluster's Kubernetes API server endpoint. By default, public access is enabled, and private access is disabled. For more information, see Amazon EKS Cluster Endpoint Access Control in the Amazon EKS User Guide .

You can use the logging parameter to enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By default, cluster control plane logs aren't exported to CloudWatch Logs. For more information, see Amazon EKS Cluster Control Plane Logs in the Amazon EKS User Guide .

CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see Amazon CloudWatch Pricing.

Cluster creation typically takes between 10 and 15 minutes. After you create an Amazon EKS cluster, you must configure your Kubernetes tooling to communicate with the API server and launch worker nodes into your cluster. For more information, see Managing Cluster Authentication and Launching Amazon EKS Worker Nodes in the Amazon EKS User Guide.

Examples:

Example: To create a new cluster


# The following example creates an Amazon EKS cluster called prod.

resp = client.create_cluster({
  version: "1.10", 
  name: "prod", 
  client_request_token: "1d2129a1-3d38-460a-9756-e5b91fddb951", 
  resources_vpc_config: {
    security_group_ids: [
      "sg-6979fe18", 
    ], 
    subnet_ids: [
      "subnet-6782e71e", 
      "subnet-e7e761ac", 
    ], 
  }, 
  role_arn: "arn:aws:iam::012345678910:role/eks-service-role-AWSServiceRoleForAmazonEKS-J7ONKE3BQ4PI", 
})

# resp.to_h outputs the following:
{
}

Request syntax with placeholder values


resp = client.create_cluster({
  name: "ClusterName", # required
  version: "String",
  role_arn: "String", # required
  resources_vpc_config: { # required
    subnet_ids: ["String"],
    security_group_ids: ["String"],
    endpoint_public_access: false,
    endpoint_private_access: false,
  },
  logging: {
    cluster_logging: [
      {
        types: ["api"], # accepts api, audit, authenticator, controllerManager, scheduler
        enabled: false,
      },
    ],
  },
  client_request_token: "String",
  tags: {
    "TagKey" => "TagValue",
  },
})

Response structure


resp.cluster.name #=> String
resp.cluster.arn #=> String
resp.cluster.created_at #=> Time
resp.cluster.version #=> String
resp.cluster.endpoint #=> String
resp.cluster.role_arn #=> String
resp.cluster.resources_vpc_config.subnet_ids #=> Array
resp.cluster.resources_vpc_config.subnet_ids[0] #=> String
resp.cluster.resources_vpc_config.security_group_ids #=> Array
resp.cluster.resources_vpc_config.security_group_ids[0] #=> String
resp.cluster.resources_vpc_config.vpc_id #=> String
resp.cluster.resources_vpc_config.endpoint_public_access #=> true/false
resp.cluster.resources_vpc_config.endpoint_private_access #=> true/false
resp.cluster.logging.cluster_logging #=> Array
resp.cluster.logging.cluster_logging[0].types #=> Array
resp.cluster.logging.cluster_logging[0].types[0] #=> String, one of "api", "audit", "authenticator", "controllerManager", "scheduler"
resp.cluster.logging.cluster_logging[0].enabled #=> true/false
resp.cluster.identity.oidc.issuer #=> String
resp.cluster.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "FAILED"
resp.cluster.certificate_authority.data #=> String
resp.cluster.client_request_token #=> String
resp.cluster.platform_version #=> String
resp.cluster.tags #=> Hash
resp.cluster.tags["TagKey"] #=> String

Options Hash (options):

  • :name (required, String)

    The unique name to give to your cluster.

  • :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.

  • :role_arn (required, String)

    The Amazon Resource Name (ARN) of the IAM role that provides permissions for Amazon EKS to make calls to other AWS API operations on your behalf. For more information, see Amazon EKS Service IAM Role in the Amazon EKS User Guide .

  • :resources_vpc_config (required, Types::VpcConfigRequest)

    The VPC configuration used by the cluster control plane. Amazon EKS VPC resources have specific requirements to work properly with Kubernetes. For more information, see Cluster VPC Considerations and Cluster Security Group Considerations in the Amazon EKS User Guide. You must specify at least two subnets. You can specify up to five security groups, but we recommend that you use a dedicated security group for your cluster control plane.

  • :logging (Types::Logging)

    Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By default, cluster control plane logs aren\'t exported to CloudWatch Logs. For more information, see Amazon EKS Cluster Control Plane Logs in the Amazon EKS User Guide .

    CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see Amazon CloudWatch Pricing.

  • :client_request_token (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

  • :tags (Hash<String,String>)

    The metadata to apply to the cluster to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define.

Returns:

See Also:

#delete_cluster(options = {}) ⇒ Types::DeleteClusterResponse

Deletes the Amazon EKS cluster control plane.

If you have active services in your cluster that are associated with a load balancer, you must delete those services before deleting the cluster so that the load balancers are deleted properly. Otherwise, you can have orphaned resources in your VPC that prevent you from being able to delete the VPC. For more information, see Deleting a Cluster in the Amazon EKS User Guide.

Examples:

Example: To delete a cluster


# This example command deletes a cluster named `devel` in your default region.

resp = client.delete_cluster({
  name: "devel", 
})

# resp.to_h outputs the following:
{
}

Request syntax with placeholder values


resp = client.delete_cluster({
  name: "String", # required
})

Response structure


resp.cluster.name #=> String
resp.cluster.arn #=> String
resp.cluster.created_at #=> Time
resp.cluster.version #=> String
resp.cluster.endpoint #=> String
resp.cluster.role_arn #=> String
resp.cluster.resources_vpc_config.subnet_ids #=> Array
resp.cluster.resources_vpc_config.subnet_ids[0] #=> String
resp.cluster.resources_vpc_config.security_group_ids #=> Array
resp.cluster.resources_vpc_config.security_group_ids[0] #=> String
resp.cluster.resources_vpc_config.vpc_id #=> String
resp.cluster.resources_vpc_config.endpoint_public_access #=> true/false
resp.cluster.resources_vpc_config.endpoint_private_access #=> true/false
resp.cluster.logging.cluster_logging #=> Array
resp.cluster.logging.cluster_logging[0].types #=> Array
resp.cluster.logging.cluster_logging[0].types[0] #=> String, one of "api", "audit", "authenticator", "controllerManager", "scheduler"
resp.cluster.logging.cluster_logging[0].enabled #=> true/false
resp.cluster.identity.oidc.issuer #=> String
resp.cluster.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "FAILED"
resp.cluster.certificate_authority.data #=> String
resp.cluster.client_request_token #=> String
resp.cluster.platform_version #=> String
resp.cluster.tags #=> Hash
resp.cluster.tags["TagKey"] #=> String

Options Hash (options):

  • :name (required, String)

    The name of the cluster to delete.

Returns:

See Also:

#describe_cluster(options = {}) ⇒ Types::DescribeClusterResponse

Returns descriptive information about an Amazon EKS cluster.

The API server endpoint and certificate authority data returned by this operation are required for kubelet and kubectl to communicate with your Kubernetes API server. For more information, see Create a kubeconfig for Amazon EKS.

The API server endpoint and certificate authority data aren't available until the cluster reaches the ACTIVE state.

Examples:

Example: To describe a cluster


# This example command provides a description of the specified cluster in your default region.

resp = client.describe_cluster({
  name: "devel", 
})

# resp.to_h outputs the following:
{
  cluster: {
    version: "1.10", 
    name: "devel", 
    arn: "arn:aws:eks:us-west-2:012345678910:cluster/devel", 
    certificate_authority: {
      data: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRFNE1EVXpNVEl6TVRFek1Wb1hEVEk0TURVeU9ESXpNVEV6TVZvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTTZWCjVUaG4rdFcySm9Xa2hQMzRlVUZMNitaRXJOZGIvWVdrTmtDdWNGS2RaaXl2TjlMVmdvUmV2MjlFVFZlN1ZGbSsKUTJ3ZURyRXJiQyt0dVlibkFuN1ZLYmE3ay9hb1BHekZMdmVnb0t6b0M1N2NUdGVwZzRIazRlK2tIWHNaME10MApyb3NzcjhFM1ROeExETnNJTThGL1cwdjhsTGNCbWRPcjQyV2VuTjFHZXJnaDNSZ2wzR3JIazBnNTU0SjFWenJZCm9hTi8zODFUczlOTFF2QTBXb0xIcjBFRlZpTFdSZEoyZ3lXaC9ybDVyOFNDOHZaQXg1YW1BU0hVd01aTFpWRC8KTDBpOW4wRVM0MkpVdzQyQmxHOEdpd3NhTkJWV3lUTHZKclNhRXlDSHFtVVZaUTFDZkFXUjl0L3JleVVOVXM3TApWV1FqM3BFbk9RMitMSWJrc0RzQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFNZ3RsQ1dIQ2U2YzVHMXl2YlFTS0Q4K2hUalkKSm1NSG56L2EvRGt0WG9YUjFVQzIrZUgzT1BZWmVjRVZZZHVaSlZCckNNQ2VWR0ZkeWdBYlNLc1FxWDg0S2RXbAp1MU5QaERDSmEyRHliN2pVMUV6VThTQjFGZUZ5ZFE3a0hNS1E1blpBRVFQOTY4S01hSGUrSm0yQ2x1UFJWbEJVCjF4WlhTS1gzTVZ0K1Q0SU1EV2d6c3JRSjVuQkRjdEtLcUZtM3pKdVVubHo5ZEpVckdscEltMjVJWXJDckxYUFgKWkUwRUtRNWEzMHhkVWNrTHRGQkQrOEtBdFdqSS9yZUZPNzM1YnBMdVoyOTBaNm42QlF3elRrS0p4cnhVc3QvOAppNGsxcnlsaUdWMm5SSjBUYjNORkczNHgrYWdzYTRoSTFPbU90TFM0TmgvRXJxT3lIUXNDc2hEQUtKUT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=", 
    }, 
    created_at: Time.parse(1527807879.988), 
    endpoint: "https://A0DCCD80A04F01705DD065655C30CC3D.yl4.us-west-2.eks.amazonaws.com", 
    resources_vpc_config: {
      security_group_ids: [
        "sg-6979fe18", 
      ], 
      subnet_ids: [
        "subnet-6782e71e", 
        "subnet-e7e761ac", 
      ], 
      vpc_id: "vpc-950809ec", 
    }, 
    role_arn: "arn:aws:iam::012345678910:role/eks-service-role-AWSServiceRoleForAmazonEKS-J7ONKE3BQ4PI", 
    status: "ACTIVE", 
  }, 
}

Request syntax with placeholder values


resp = client.describe_cluster({
  name: "String", # required
})

Response structure


resp.cluster.name #=> String
resp.cluster.arn #=> String
resp.cluster.created_at #=> Time
resp.cluster.version #=> String
resp.cluster.endpoint #=> String
resp.cluster.role_arn #=> String
resp.cluster.resources_vpc_config.subnet_ids #=> Array
resp.cluster.resources_vpc_config.subnet_ids[0] #=> String
resp.cluster.resources_vpc_config.security_group_ids #=> Array
resp.cluster.resources_vpc_config.security_group_ids[0] #=> String
resp.cluster.resources_vpc_config.vpc_id #=> String
resp.cluster.resources_vpc_config.endpoint_public_access #=> true/false
resp.cluster.resources_vpc_config.endpoint_private_access #=> true/false
resp.cluster.logging.cluster_logging #=> Array
resp.cluster.logging.cluster_logging[0].types #=> Array
resp.cluster.logging.cluster_logging[0].types[0] #=> String, one of "api", "audit", "authenticator", "controllerManager", "scheduler"
resp.cluster.logging.cluster_logging[0].enabled #=> true/false
resp.cluster.identity.oidc.issuer #=> String
resp.cluster.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "FAILED"
resp.cluster.certificate_authority.data #=> String
resp.cluster.client_request_token #=> String
resp.cluster.platform_version #=> String
resp.cluster.tags #=> Hash
resp.cluster.tags["TagKey"] #=> String

Options Hash (options):

  • :name (required, String)

    The name of the cluster to describe.

Returns:

See Also:

#describe_update(options = {}) ⇒ Types::DescribeUpdateResponse

Returns descriptive information about an update against your Amazon EKS cluster.

When the status of the update is Succeeded, the update is complete. If an update fails, the status is Failed, and an error detail explains the reason for the failure.

Examples:

Request syntax with placeholder values


resp = client.describe_update({
  name: "String", # required
  update_id: "String", # required
})

Response structure


resp.update.id #=> String
resp.update.status #=> String, one of "InProgress", "Failed", "Cancelled", "Successful"
resp.update.type #=> String, one of "VersionUpdate", "EndpointAccessUpdate", "LoggingUpdate"
resp.update.params #=> Array
resp.update.params[0].type #=> String, one of "Version", "PlatformVersion", "EndpointPrivateAccess", "EndpointPublicAccess", "ClusterLogging"
resp.update.params[0].value #=> String
resp.update.created_at #=> Time
resp.update.errors #=> Array
resp.update.errors[0].error_code #=> String, one of "SubnetNotFound", "SecurityGroupNotFound", "EniLimitReached", "IpNotAvailable", "AccessDenied", "OperationNotPermitted", "VpcIdNotFound", "Unknown"
resp.update.errors[0].error_message #=> String
resp.update.errors[0].resource_ids #=> Array
resp.update.errors[0].resource_ids[0] #=> String

Options Hash (options):

  • :name (required, String)

    The name of the Amazon EKS cluster to update.

  • :update_id (required, String)

    The ID of the update to describe.

Returns:

See Also:

#list_clusters(options = {}) ⇒ Types::ListClustersResponse

Lists the Amazon EKS clusters in your AWS account in the specified Region.

Examples:

Example: To list your available clusters


# This example command lists all of your available clusters in your default region.

resp = client.list_clusters({
})

# resp.to_h outputs the following:
{
  clusters: [
    "devel", 
    "prod", 
  ], 
}

Request syntax with placeholder values


resp = client.list_clusters({
  max_results: 1,
  next_token: "String",
})

Response structure


resp.clusters #=> Array
resp.clusters[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (Integer)

    The maximum number of cluster results returned by ListClusters in paginated output. When you use this parameter, ListClusters returns only maxResults results in a single page along with a nextToken response element. You can see the remaining results of the initial request by sending another ListClusters request with the returned nextToken value. This value can be between 1 and 100. If you don\'t use this parameter, ListClusters returns up to 100 results and a nextToken value if applicable.

  • :next_token (String)

    The nextToken value returned from a previous paginated ListClusters request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value.

    This token should be treated as an opaque identifier that is used only to retrieve the next items in a list and not for other programmatic purposes.

Returns:

See Also:

#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse

List the tags for an Amazon EKS resource.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "String", # required
})

Response structure


resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) that identifies the resource for which to list the tags. Currently, the supported resources are Amazon EKS clusters.

Returns:

See Also:

#list_updates(options = {}) ⇒ Types::ListUpdatesResponse

Lists the updates associated with an Amazon EKS cluster in your AWS account, in the specified Region.

Examples:

Request syntax with placeholder values


resp = client.list_updates({
  name: "String", # required
  next_token: "String",
  max_results: 1,
})

Response structure


resp.update_ids #=> Array
resp.update_ids[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :name (required, String)

    The name of the Amazon EKS cluster to list updates for.

  • :next_token (String)

    The nextToken value returned from a previous paginated ListUpdates request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value.

  • :max_results (Integer)

    The maximum number of update results returned by ListUpdates in paginated output. When you use this parameter, ListUpdates returns only maxResults results in a single page along with a nextToken response element. You can see the remaining results of the initial request by sending another ListUpdates request with the returned nextToken value. This value can be between 1 and 100. If you don\'t use this parameter, ListUpdates returns up to 100 results and a nextToken value if applicable.

Returns:

See Also:

#tag_resource(options = {}) ⇒ Struct

Associates the specified tags to a resource with the specified resourceArn. If existing tags on a resource are not specified in the request parameters, they are not changed. When a resource is deleted, the tags associated with that resource are deleted as well.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "String", # required
  tags: { # required
    "TagKey" => "TagValue",
  },
})

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource to which to add tags. Currently, the supported resources are Amazon EKS clusters.

  • :tags (required, Hash<String,String>)

    The tags to add to the resource. A tag is an array of key-value pairs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#untag_resource(options = {}) ⇒ Struct

Deletes specified tags from a resource.

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "String", # required
  tag_keys: ["TagKey"], # required
})

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource from which to delete tags. Currently, the supported resources are Amazon EKS clusters.

  • :tag_keys (required, Array<String>)

    The keys of the tags to be removed.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_cluster_config(options = {}) ⇒ Types::UpdateClusterConfigResponse

Updates an Amazon EKS cluster configuration. Your cluster continues to function during the update. The response output includes an update ID that you can use to track the status of your cluster update with the DescribeUpdate API operation.

You can use this API operation to enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By default, cluster control plane logs aren't exported to CloudWatch Logs. For more information, see Amazon EKS Cluster Control Plane Logs in the Amazon EKS User Guide .

CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see Amazon CloudWatch Pricing.

You can also use this API operation to enable or disable public and private access to your cluster's Kubernetes API server endpoint. By default, public access is enabled, and private access is disabled. For more information, see Amazon EKS Cluster Endpoint Access Control in the Amazon EKS User Guide .

At this time, you can not update the subnets or security group IDs for an existing cluster.

Cluster updates are asynchronous, and they should finish within a few minutes. During an update, the cluster status moves to UPDATING (this status transition is eventually consistent). When the update is complete (either Failed or Successful), the cluster status moves to Active.

Examples:

Request syntax with placeholder values


resp = client.update_cluster_config({
  name: "String", # required
  resources_vpc_config: {
    subnet_ids: ["String"],
    security_group_ids: ["String"],
    endpoint_public_access: false,
    endpoint_private_access: false,
  },
  logging: {
    cluster_logging: [
      {
        types: ["api"], # accepts api, audit, authenticator, controllerManager, scheduler
        enabled: false,
      },
    ],
  },
  client_request_token: "String",
})

Response structure


resp.update.id #=> String
resp.update.status #=> String, one of "InProgress", "Failed", "Cancelled", "Successful"
resp.update.type #=> String, one of "VersionUpdate", "EndpointAccessUpdate", "LoggingUpdate"
resp.update.params #=> Array
resp.update.params[0].type #=> String, one of "Version", "PlatformVersion", "EndpointPrivateAccess", "EndpointPublicAccess", "ClusterLogging"
resp.update.params[0].value #=> String
resp.update.created_at #=> Time
resp.update.errors #=> Array
resp.update.errors[0].error_code #=> String, one of "SubnetNotFound", "SecurityGroupNotFound", "EniLimitReached", "IpNotAvailable", "AccessDenied", "OperationNotPermitted", "VpcIdNotFound", "Unknown"
resp.update.errors[0].error_message #=> String
resp.update.errors[0].resource_ids #=> Array
resp.update.errors[0].resource_ids[0] #=> String

Options Hash (options):

  • :name (required, String)

    The name of the Amazon EKS cluster to update.

  • :resources_vpc_config (Types::VpcConfigRequest)

    An object representing the VPC configuration to use for an Amazon EKS cluster.

  • :logging (Types::Logging)

    Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By default, cluster control plane logs aren\'t exported to CloudWatch Logs. For more information, see Amazon EKS Cluster Control Plane Logs in the Amazon EKS User Guide .

    CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see Amazon CloudWatch Pricing.

  • :client_request_token (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Returns:

See Also:

#update_cluster_version(options = {}) ⇒ Types::UpdateClusterVersionResponse

Updates an Amazon EKS cluster to the specified Kubernetes version. Your cluster continues to function during the update. The response output includes an update ID that you can use to track the status of your cluster update with the DescribeUpdate API operation.

Cluster updates are asynchronous, and they should finish within a few minutes. During an update, the cluster status moves to UPDATING (this status transition is eventually consistent). When the update is complete (either Failed or Successful), the cluster status moves to Active.

Examples:

Request syntax with placeholder values


resp = client.update_cluster_version({
  name: "String", # required
  version: "String", # required
  client_request_token: "String",
})

Response structure


resp.update.id #=> String
resp.update.status #=> String, one of "InProgress", "Failed", "Cancelled", "Successful"
resp.update.type #=> String, one of "VersionUpdate", "EndpointAccessUpdate", "LoggingUpdate"
resp.update.params #=> Array
resp.update.params[0].type #=> String, one of "Version", "PlatformVersion", "EndpointPrivateAccess", "EndpointPublicAccess", "ClusterLogging"
resp.update.params[0].value #=> String
resp.update.created_at #=> Time
resp.update.errors #=> Array
resp.update.errors[0].error_code #=> String, one of "SubnetNotFound", "SecurityGroupNotFound", "EniLimitReached", "IpNotAvailable", "AccessDenied", "OperationNotPermitted", "VpcIdNotFound", "Unknown"
resp.update.errors[0].error_message #=> String
resp.update.errors[0].resource_ids #=> Array
resp.update.errors[0].resource_ids[0] #=> String

Options Hash (options):

  • :name (required, String)

    The name of the Amazon EKS cluster to update.

  • :version (required, String)

    The desired Kubernetes version following a successful update.

  • :client_request_token (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Returns:

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:
:cluster_active#describe_cluster3040
:cluster_deleted#describe_cluster3040

Returns:

  • (Array<Symbol>)

    the list of supported waiters.