Class: Aws::EKS::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb

Overview

An API client for EKS. To construct a client, you need to configure a :region and :credentials.

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

For details on configuring region and credentials see the developer guide.

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

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

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

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • Aws::Credentials - Used for configuring static, non-refreshing credentials.

    • Aws::InstanceProfileCredentials - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • Aws::SharedCredentials - Used for loading credentials from a shared file, such as ~/.aws/config.

    • Aws::AssumeRoleCredentials - Used when you need to assume a role.

    When :credentials are not configured directly, the following locations will be searched for credentials:

    • Aws.config[:credentials]
    • The :access_key_id, :secret_access_key, and :session_token options.
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • ~/.aws/credentials
    • ~/.aws/config
    • EC2 IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of Aws::InstanceProfileCredentails to enable retries and extended timeouts.
  • :region (required, String)

    The AWS region to connect to. The configured :region is used to determine the service :endpoint. When not passed, a default :region is searched for in the following locations:

    • Aws.config[:region]
    • ENV['AWS_REGION']
    • ENV['AMAZON_REGION']
    • ENV['AWS_DEFAULT_REGION']
    • ~/.aws/credentials
    • ~/.aws/config
  • :access_key_id (String)
  • :active_endpoint_cache (Boolean) — default: false

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

  • :adaptive_retry_wait_to_fill (Boolean) — default: true

    Used only in adaptive retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a RetryCapacityNotAvailableError and will not retry instead of sleeping.

  • :client_side_monitoring (Boolean) — default: false

    When true, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1"

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true

    Used only in standard and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks.

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :endpoint (String)

    The client endpoint is normally constructed from the :region option. You should only configure an :endpoint when connecting to test or custom endpoints. This should be a valid HTTP(S) URI.

  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    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.

  • :endpoint_discovery (Boolean) — default: false

    When set to true, endpoint discovery will be enabled for operations when available.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the :logger at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in standard and adaptive retry modes.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used.

  • :retry_backoff (Proc)

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the legacy retry mode.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the legacy retry mode.

    @see https://www.awsarchitectureblog.com/2015/03/backoff.html

  • :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, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the legacy retry mode.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_mode (String) — default: "legacy"

    Specifies which retry algorithm to use. Values are:

    • legacy - The pre-existing retry behavior. This is default value if no retry mode is provided.

    • standard - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make.

    • adaptive - An experimental retry mode that includes all the functionality of standard mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future.

  • :secret_access_key (String)
  • :session_token (String)
  • :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.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request.

  • :http_proxy (URI::HTTP, String)

    A proxy to send requests through. Formatted like 'http://proxy.com:123'.

  • :http_open_timeout (Float) — default: 15

    The number of seconds to wait when opening a HTTP session before raising a Timeout::Error.

  • :http_read_timeout (Integer) — default: 60

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_idle_timeout (Float) — default: 5

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_continue_timeout (Float) — default: 1

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has "Expect" header set to "100-continue". Defaults to nil which disables this behaviour. This value can safely be set per request on the session.

  • :http_wire_trace (Boolean) — default: false

    When true, HTTP debug output will be sent to the :logger.

  • :ssl_verify_peer (Boolean) — default: true

    When true, SSL peer certificates are verified when establishing a connection.

  • :ssl_ca_bundle (String)

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_directory (String)

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.



309
310
311
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 309

def initialize(*args)
  super
end

Instance Method Details

#create_cluster(params = {}) ⇒ 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,
    public_access_cidrs: ["String"],
  },
  logging: {
    cluster_logging: [
      {
        types: ["api"], # accepts api, audit, authenticator, controllerManager, scheduler
        enabled: false,
      },
    ],
  },
  client_request_token: "String",
  tags: {
    "TagKey" => "TagValue",
  },
  encryption_config: [
    {
      resources: ["String"],
      provider: {
        key_arn: "String",
      },
    },
  ],
})

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.cluster_security_group_id #=> String
resp.cluster.resources_vpc_config.vpc_id #=> String
resp.cluster.resources_vpc_config.endpoint_public_access #=> Boolean
resp.cluster.resources_vpc_config.endpoint_private_access #=> Boolean
resp.cluster.resources_vpc_config.public_access_cidrs #=> Array
resp.cluster.resources_vpc_config.public_access_cidrs[0] #=> String
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 #=> Boolean
resp.cluster.identity.oidc.issuer #=> String
resp.cluster.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "FAILED", "UPDATING"
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
resp.cluster.encryption_config #=> Array
resp.cluster.encryption_config[0].resources #=> Array
resp.cluster.encryption_config[0].resources[0] #=> String
resp.cluster.encryption_config[0].provider.key_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

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

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

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

  • :encryption_config (Array<Types::EncryptionConfig>)

    The encryption configuration for the cluster.

Returns:

See Also:



535
536
537
538
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 535

def create_cluster(params = {}, options = {})
  req = build_request(:create_cluster, params)
  req.send_request(options)
end

#create_fargate_profile(params = {}) ⇒ Types::CreateFargateProfileResponse

Creates an AWS Fargate profile for your Amazon EKS cluster. You must have at least one Fargate profile in a cluster to be able to run pods on Fargate.

The Fargate profile allows an administrator to declare which pods run on Fargate and specify which pods run on which Fargate profile. This declaration is done through the profile’s selectors. Each profile can have up to five selectors that contain a namespace and labels. A namespace is required for every selector. The label field consists of multiple optional key-value pairs. Pods that match the selectors are scheduled on Fargate. If a to-be-scheduled pod matches any of the selectors in the Fargate profile, then that pod is run on Fargate.

When you create a Fargate profile, you must specify a pod execution role to use with the pods that are scheduled with the profile. This role is added to the cluster's Kubernetes Role Based Access Control (RBAC) for authorization so that the kubelet that is running on the Fargate infrastructure can register with your Amazon EKS cluster so that it can appear in your cluster as a node. The pod execution role also provides IAM permissions to the Fargate infrastructure to allow read access to Amazon ECR image repositories. For more information, see Pod Execution Role in the Amazon EKS User Guide.

Fargate profiles are immutable. However, you can create a new updated profile to replace an existing profile and then delete the original after the updated profile has finished creating.

If any Fargate profiles in a cluster are in the DELETING status, you must wait for that Fargate profile to finish deleting before you can create any other profiles in that cluster.

For more information, see AWS Fargate Profile in the Amazon EKS User Guide.

Examples:

Request syntax with placeholder values


resp = client.create_fargate_profile({
  fargate_profile_name: "String", # required
  cluster_name: "String", # required
  pod_execution_role_arn: "String", # required
  subnets: ["String"],
  selectors: [
    {
      namespace: "String",
      labels: {
        "String" => "String",
      },
    },
  ],
  client_request_token: "String",
  tags: {
    "TagKey" => "TagValue",
  },
})

Response structure


resp.fargate_profile.fargate_profile_name #=> String
resp.fargate_profile.fargate_profile_arn #=> String
resp.fargate_profile.cluster_name #=> String
resp.fargate_profile.created_at #=> Time
resp.fargate_profile.pod_execution_role_arn #=> String
resp.fargate_profile.subnets #=> Array
resp.fargate_profile.subnets[0] #=> String
resp.fargate_profile.selectors #=> Array
resp.fargate_profile.selectors[0].namespace #=> String
resp.fargate_profile.selectors[0].labels #=> Hash
resp.fargate_profile.selectors[0].labels["String"] #=> String
resp.fargate_profile.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "CREATE_FAILED", "DELETE_FAILED"
resp.fargate_profile.tags #=> Hash
resp.fargate_profile.tags["TagKey"] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :fargate_profile_name (required, String)

    The name of the Fargate profile.

  • :cluster_name (required, String)

    The name of the Amazon EKS cluster to apply the Fargate profile to.

  • :pod_execution_role_arn (required, String)

    The Amazon Resource Name (ARN) of the pod execution role to use for pods that match the selectors in the Fargate profile. The pod execution role allows Fargate infrastructure to register with your cluster as a node, and it provides read access to Amazon ECR image repositories. For more information, see Pod Execution Role in the Amazon EKS User Guide.

  • :subnets (Array<String>)

    The IDs of subnets to launch your pods into. At this time, pods running on Fargate are not assigned public IP addresses, so only private subnets (with no direct route to an Internet Gateway) are accepted for this parameter.

  • :selectors (Array<Types::FargateProfileSelector>)

    The selectors to match for pods to use this Fargate profile. Each selector must have an associated namespace. Optionally, you can also specify labels for a namespace. You may specify up to five selectors in a Fargate profile.

  • :client_request_token (String)

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :tags (Hash<String,String>)

    The metadata to apply to the Fargate profile to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Fargate profile tags do not propagate to any other resources associated with the Fargate profile, such as the pods that are scheduled with it.

Returns:

See Also:



671
672
673
674
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 671

def create_fargate_profile(params = {}, options = {})
  req = build_request(:create_fargate_profile, params)
  req.send_request(options)
end

#create_nodegroup(params = {}) ⇒ Types::CreateNodegroupResponse

Creates a managed worker node group for an Amazon EKS cluster. You can only create a node group for your cluster that is equal to the current Kubernetes version for the cluster. All node groups are created with the latest AMI release version for the respective minor Kubernetes version of the cluster.

An Amazon EKS managed node group is an Amazon EC2 Auto Scaling group and associated Amazon EC2 instances that are managed by AWS for an Amazon EKS cluster. Each node group uses a version of the Amazon EKS-optimized Amazon Linux 2 AMI. For more information, see Managed Node Groups in the Amazon EKS User Guide.

Examples:

Request syntax with placeholder values


resp = client.create_nodegroup({
  cluster_name: "String", # required
  nodegroup_name: "String", # required
  scaling_config: {
    min_size: 1,
    max_size: 1,
    desired_size: 1,
  },
  disk_size: 1,
  subnets: ["String"], # required
  instance_types: ["String"],
  ami_type: "AL2_x86_64", # accepts AL2_x86_64, AL2_x86_64_GPU
  remote_access: {
    ec2_ssh_key: "String",
    source_security_groups: ["String"],
  },
  node_role: "String", # required
  labels: {
    "labelKey" => "labelValue",
  },
  tags: {
    "TagKey" => "TagValue",
  },
  client_request_token: "String",
  version: "String",
  release_version: "String",
})

Response structure


resp.nodegroup.nodegroup_name #=> String
resp.nodegroup.nodegroup_arn #=> String
resp.nodegroup.cluster_name #=> String
resp.nodegroup.version #=> String
resp.nodegroup.release_version #=> String
resp.nodegroup.created_at #=> Time
resp.nodegroup.modified_at #=> Time
resp.nodegroup.status #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATE_FAILED", "DELETE_FAILED", "DEGRADED"
resp.nodegroup.scaling_config.min_size #=> Integer
resp.nodegroup.scaling_config.max_size #=> Integer
resp.nodegroup.scaling_config.desired_size #=> Integer
resp.nodegroup.instance_types #=> Array
resp.nodegroup.instance_types[0] #=> String
resp.nodegroup.subnets #=> Array
resp.nodegroup.subnets[0] #=> String
resp.nodegroup.remote_access.ec2_ssh_key #=> String
resp.nodegroup.remote_access.source_security_groups #=> Array
resp.nodegroup.remote_access.source_security_groups[0] #=> String
resp.nodegroup.ami_type #=> String, one of "AL2_x86_64", "AL2_x86_64_GPU"
resp.nodegroup.node_role #=> String
resp.nodegroup.labels #=> Hash
resp.nodegroup.labels["labelKey"] #=> String
resp.nodegroup.resources.auto_scaling_groups #=> Array
resp.nodegroup.resources.auto_scaling_groups[0].name #=> String
resp.nodegroup.resources.remote_access_security_group #=> String
resp.nodegroup.disk_size #=> Integer
resp.nodegroup.health.issues #=> Array
resp.nodegroup.health.issues[0].code #=> String, one of "AutoScalingGroupNotFound", "AutoScalingGroupInvalidConfiguration", "Ec2SecurityGroupNotFound", "Ec2SecurityGroupDeletionFailure", "Ec2LaunchTemplateNotFound", "Ec2LaunchTemplateVersionMismatch", "Ec2SubnetNotFound", "Ec2SubnetInvalidConfiguration", "IamInstanceProfileNotFound", "IamLimitExceeded", "IamNodeRoleNotFound", "NodeCreationFailure", "AsgInstanceLaunchFailures", "InstanceLimitExceeded", "InsufficientFreeAddresses", "AccessDenied", "InternalFailure"
resp.nodegroup.health.issues[0].message #=> String
resp.nodegroup.health.issues[0].resource_ids #=> Array
resp.nodegroup.health.issues[0].resource_ids[0] #=> String
resp.nodegroup.tags #=> Hash
resp.nodegroup.tags["TagKey"] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :cluster_name (required, String)

    The name of the cluster to create the node group in.

  • :nodegroup_name (required, String)

    The unique name to give your node group.

  • :scaling_config (Types::NodegroupScalingConfig)

    The scaling configuration details for the Auto Scaling group that is created for your node group.

  • :disk_size (Integer)

    The root device disk size (in GiB) for your node group instances. The default disk size is 20 GiB.

  • :subnets (required, Array<String>)

    The subnets to use for the Auto Scaling group that is created for your node group. These subnets must have the tag key kubernetes.io/cluster/CLUSTER_NAME with a value of shared, where CLUSTER_NAME is replaced with the name of your cluster.

  • :instance_types (Array<String>)

    The instance type to use for your node group. Currently, you can specify a single instance type for a node group. The default value for this parameter is t3.medium. If you choose a GPU instance type, be sure to specify the AL2_x86_64_GPU with the amiType parameter.

  • :ami_type (String)

    The AMI type for your node group. GPU instance types should use the AL2_x86_64_GPU AMI type, which uses the Amazon EKS-optimized Linux AMI with GPU support. Non-GPU instances should use the AL2_x86_64 AMI type, which uses the Amazon EKS-optimized Linux AMI.

  • :remote_access (Types::RemoteAccessConfig)

    The remote access (SSH) configuration to use with your node group.

  • :node_role (required, String)

    The Amazon Resource Name (ARN) of the IAM role to associate with your node group. The Amazon EKS worker node kubelet daemon makes calls to AWS APIs on your behalf. Worker nodes receive permissions for these API calls through an IAM instance profile and associated policies. Before you can launch worker nodes and register them into a cluster, you must create an IAM role for those worker nodes to use when they are launched. For more information, see Amazon EKS Worker Node IAM Role in the Amazon EKS User Guide .

  • :labels (Hash<String,String>)

    The Kubernetes labels to be applied to the nodes in the node group when they are created.

  • :tags (Hash<String,String>)

    The metadata to apply to the node group to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Node group tags do not propagate to any other resources associated with the node group, such as the Amazon EC2 instances or subnets.

  • :client_request_token (String)

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :version (String)

    The Kubernetes version to use for your managed nodes. By default, the Kubernetes version of the cluster is used, and this is the only accepted specified value.

  • :release_version (String)

    The AMI version of the Amazon EKS-optimized AMI to use with your node group. By default, the latest available AMI version for the node group's current Kubernetes version is used. For more information, see Amazon EKS-Optimized Linux AMI Versions in the Amazon EKS User Guide.

Returns:

See Also:



849
850
851
852
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 849

def create_nodegroup(params = {}, options = {})
  req = build_request(:create_nodegroup, params)
  req.send_request(options)
end

#delete_cluster(params = {}) ⇒ 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.

If you have managed node groups or Fargate profiles attached to the cluster, you must delete them first. For more information, see DeleteNodegroup and DeleteFargateProfile.

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.cluster_security_group_id #=> String
resp.cluster.resources_vpc_config.vpc_id #=> String
resp.cluster.resources_vpc_config.endpoint_public_access #=> Boolean
resp.cluster.resources_vpc_config.endpoint_private_access #=> Boolean
resp.cluster.resources_vpc_config.public_access_cidrs #=> Array
resp.cluster.resources_vpc_config.public_access_cidrs[0] #=> String
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 #=> Boolean
resp.cluster.identity.oidc.issuer #=> String
resp.cluster.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "FAILED", "UPDATING"
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
resp.cluster.encryption_config #=> Array
resp.cluster.encryption_config[0].resources #=> Array
resp.cluster.encryption_config[0].resources[0] #=> String
resp.cluster.encryption_config[0].provider.key_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :name (required, String)

    The name of the cluster to delete.

Returns:

See Also:



935
936
937
938
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 935

def delete_cluster(params = {}, options = {})
  req = build_request(:delete_cluster, params)
  req.send_request(options)
end

#delete_fargate_profile(params = {}) ⇒ Types::DeleteFargateProfileResponse

Deletes an AWS Fargate profile.

When you delete a Fargate profile, any pods running on Fargate that were created with the profile are deleted. If those pods match another Fargate profile, then they are scheduled on Fargate with that profile. If they no longer match any Fargate profiles, then they are not scheduled on Fargate and they may remain in a pending state.

Only one Fargate profile in a cluster can be in the DELETING status at a time. You must wait for a Fargate profile to finish deleting before you can delete any other profiles in that cluster.

Examples:

Request syntax with placeholder values


resp = client.delete_fargate_profile({
  cluster_name: "String", # required
  fargate_profile_name: "String", # required
})

Response structure


resp.fargate_profile.fargate_profile_name #=> String
resp.fargate_profile.fargate_profile_arn #=> String
resp.fargate_profile.cluster_name #=> String
resp.fargate_profile.created_at #=> Time
resp.fargate_profile.pod_execution_role_arn #=> String
resp.fargate_profile.subnets #=> Array
resp.fargate_profile.subnets[0] #=> String
resp.fargate_profile.selectors #=> Array
resp.fargate_profile.selectors[0].namespace #=> String
resp.fargate_profile.selectors[0].labels #=> Hash
resp.fargate_profile.selectors[0].labels["String"] #=> String
resp.fargate_profile.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "CREATE_FAILED", "DELETE_FAILED"
resp.fargate_profile.tags #=> Hash
resp.fargate_profile.tags["TagKey"] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :cluster_name (required, String)

    The name of the Amazon EKS cluster associated with the Fargate profile to delete.

  • :fargate_profile_name (required, String)

    The name of the Fargate profile to delete.

Returns:

See Also:



991
992
993
994
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 991

def delete_fargate_profile(params = {}, options = {})
  req = build_request(:delete_fargate_profile, params)
  req.send_request(options)
end

#delete_nodegroup(params = {}) ⇒ Types::DeleteNodegroupResponse

Deletes an Amazon EKS node group for a cluster.

Examples:

Request syntax with placeholder values


resp = client.delete_nodegroup({
  cluster_name: "String", # required
  nodegroup_name: "String", # required
})

Response structure


resp.nodegroup.nodegroup_name #=> String
resp.nodegroup.nodegroup_arn #=> String
resp.nodegroup.cluster_name #=> String
resp.nodegroup.version #=> String
resp.nodegroup.release_version #=> String
resp.nodegroup.created_at #=> Time
resp.nodegroup.modified_at #=> Time
resp.nodegroup.status #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATE_FAILED", "DELETE_FAILED", "DEGRADED"
resp.nodegroup.scaling_config.min_size #=> Integer
resp.nodegroup.scaling_config.max_size #=> Integer
resp.nodegroup.scaling_config.desired_size #=> Integer
resp.nodegroup.instance_types #=> Array
resp.nodegroup.instance_types[0] #=> String
resp.nodegroup.subnets #=> Array
resp.nodegroup.subnets[0] #=> String
resp.nodegroup.remote_access.ec2_ssh_key #=> String
resp.nodegroup.remote_access.source_security_groups #=> Array
resp.nodegroup.remote_access.source_security_groups[0] #=> String
resp.nodegroup.ami_type #=> String, one of "AL2_x86_64", "AL2_x86_64_GPU"
resp.nodegroup.node_role #=> String
resp.nodegroup.labels #=> Hash
resp.nodegroup.labels["labelKey"] #=> String
resp.nodegroup.resources.auto_scaling_groups #=> Array
resp.nodegroup.resources.auto_scaling_groups[0].name #=> String
resp.nodegroup.resources.remote_access_security_group #=> String
resp.nodegroup.disk_size #=> Integer
resp.nodegroup.health.issues #=> Array
resp.nodegroup.health.issues[0].code #=> String, one of "AutoScalingGroupNotFound", "AutoScalingGroupInvalidConfiguration", "Ec2SecurityGroupNotFound", "Ec2SecurityGroupDeletionFailure", "Ec2LaunchTemplateNotFound", "Ec2LaunchTemplateVersionMismatch", "Ec2SubnetNotFound", "Ec2SubnetInvalidConfiguration", "IamInstanceProfileNotFound", "IamLimitExceeded", "IamNodeRoleNotFound", "NodeCreationFailure", "AsgInstanceLaunchFailures", "InstanceLimitExceeded", "InsufficientFreeAddresses", "AccessDenied", "InternalFailure"
resp.nodegroup.health.issues[0].message #=> String
resp.nodegroup.health.issues[0].resource_ids #=> Array
resp.nodegroup.health.issues[0].resource_ids[0] #=> String
resp.nodegroup.tags #=> Hash
resp.nodegroup.tags["TagKey"] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :cluster_name (required, String)

    The name of the Amazon EKS cluster that is associated with your node group.

  • :nodegroup_name (required, String)

    The name of the node group to delete.

Returns:

See Also:



1056
1057
1058
1059
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1056

def delete_nodegroup(params = {}, options = {})
  req = build_request(:delete_nodegroup, params)
  req.send_request(options)
end

#describe_cluster(params = {}) ⇒ 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.

The following waiters are defined for this operation (see #wait_until for detailed usage):

  • cluster_active
  • cluster_deleted

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.cluster_security_group_id #=> String
resp.cluster.resources_vpc_config.vpc_id #=> String
resp.cluster.resources_vpc_config.endpoint_public_access #=> Boolean
resp.cluster.resources_vpc_config.endpoint_private_access #=> Boolean
resp.cluster.resources_vpc_config.public_access_cidrs #=> Array
resp.cluster.resources_vpc_config.public_access_cidrs[0] #=> String
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 #=> Boolean
resp.cluster.identity.oidc.issuer #=> String
resp.cluster.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "FAILED", "UPDATING"
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
resp.cluster.encryption_config #=> Array
resp.cluster.encryption_config[0].resources #=> Array
resp.cluster.encryption_config[0].resources[0] #=> String
resp.cluster.encryption_config[0].provider.key_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :name (required, String)

    The name of the cluster to describe.

Returns:

See Also:



1169
1170
1171
1172
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1169

def describe_cluster(params = {}, options = {})
  req = build_request(:describe_cluster, params)
  req.send_request(options)
end

#describe_fargate_profile(params = {}) ⇒ Types::DescribeFargateProfileResponse

Returns descriptive information about an AWS Fargate profile.

Examples:

Request syntax with placeholder values


resp = client.describe_fargate_profile({
  cluster_name: "String", # required
  fargate_profile_name: "String", # required
})

Response structure


resp.fargate_profile.fargate_profile_name #=> String
resp.fargate_profile.fargate_profile_arn #=> String
resp.fargate_profile.cluster_name #=> String
resp.fargate_profile.created_at #=> Time
resp.fargate_profile.pod_execution_role_arn #=> String
resp.fargate_profile.subnets #=> Array
resp.fargate_profile.subnets[0] #=> String
resp.fargate_profile.selectors #=> Array
resp.fargate_profile.selectors[0].namespace #=> String
resp.fargate_profile.selectors[0].labels #=> Hash
resp.fargate_profile.selectors[0].labels["String"] #=> String
resp.fargate_profile.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "CREATE_FAILED", "DELETE_FAILED"
resp.fargate_profile.tags #=> Hash
resp.fargate_profile.tags["TagKey"] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :cluster_name (required, String)

    The name of the Amazon EKS cluster associated with the Fargate profile.

  • :fargate_profile_name (required, String)

    The name of the Fargate profile to describe.

Returns:

See Also:



1215
1216
1217
1218
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1215

def describe_fargate_profile(params = {}, options = {})
  req = build_request(:describe_fargate_profile, params)
  req.send_request(options)
end

#describe_nodegroup(params = {}) ⇒ Types::DescribeNodegroupResponse

Returns descriptive information about an Amazon EKS node group.

The following waiters are defined for this operation (see #wait_until for detailed usage):

  • nodegroup_active
  • nodegroup_deleted

Examples:

Request syntax with placeholder values


resp = client.describe_nodegroup({
  cluster_name: "String", # required
  nodegroup_name: "String", # required
})

Response structure


resp.nodegroup.nodegroup_name #=> String
resp.nodegroup.nodegroup_arn #=> String
resp.nodegroup.cluster_name #=> String
resp.nodegroup.version #=> String
resp.nodegroup.release_version #=> String
resp.nodegroup.created_at #=> Time
resp.nodegroup.modified_at #=> Time
resp.nodegroup.status #=> String, one of "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATE_FAILED", "DELETE_FAILED", "DEGRADED"
resp.nodegroup.scaling_config.min_size #=> Integer
resp.nodegroup.scaling_config.max_size #=> Integer
resp.nodegroup.scaling_config.desired_size #=> Integer
resp.nodegroup.instance_types #=> Array
resp.nodegroup.instance_types[0] #=> String
resp.nodegroup.subnets #=> Array
resp.nodegroup.subnets[0] #=> String
resp.nodegroup.remote_access.ec2_ssh_key #=> String
resp.nodegroup.remote_access.source_security_groups #=> Array
resp.nodegroup.remote_access.source_security_groups[0] #=> String
resp.nodegroup.ami_type #=> String, one of "AL2_x86_64", "AL2_x86_64_GPU"
resp.nodegroup.node_role #=> String
resp.nodegroup.labels #=> Hash
resp.nodegroup.labels["labelKey"] #=> String
resp.nodegroup.resources.auto_scaling_groups #=> Array
resp.nodegroup.resources.auto_scaling_groups[0].name #=> String
resp.nodegroup.resources.remote_access_security_group #=> String
resp.nodegroup.disk_size #=> Integer
resp.nodegroup.health.issues #=> Array
resp.nodegroup.health.issues[0].code #=> String, one of "AutoScalingGroupNotFound", "AutoScalingGroupInvalidConfiguration", "Ec2SecurityGroupNotFound", "Ec2SecurityGroupDeletionFailure", "Ec2LaunchTemplateNotFound", "Ec2LaunchTemplateVersionMismatch", "Ec2SubnetNotFound", "Ec2SubnetInvalidConfiguration", "IamInstanceProfileNotFound", "IamLimitExceeded", "IamNodeRoleNotFound", "NodeCreationFailure", "AsgInstanceLaunchFailures", "InstanceLimitExceeded", "InsufficientFreeAddresses", "AccessDenied", "InternalFailure"
resp.nodegroup.health.issues[0].message #=> String
resp.nodegroup.health.issues[0].resource_ids #=> Array
resp.nodegroup.health.issues[0].resource_ids[0] #=> String
resp.nodegroup.tags #=> Hash
resp.nodegroup.tags["TagKey"] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :cluster_name (required, String)

    The name of the Amazon EKS cluster associated with the node group.

  • :nodegroup_name (required, String)

    The name of the node group to describe.

Returns:

See Also:



1285
1286
1287
1288
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1285

def describe_nodegroup(params = {}, options = {})
  req = build_request(:describe_nodegroup, params)
  req.send_request(options)
end

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

Returns descriptive information about an update against your Amazon EKS cluster or associated managed node group.

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
  nodegroup_name: "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", "ConfigUpdate"
resp.update.params #=> Array
resp.update.params[0].type #=> String, one of "Version", "PlatformVersion", "EndpointPrivateAccess", "EndpointPublicAccess", "ClusterLogging", "DesiredSize", "LabelsToAdd", "LabelsToRemove", "MaxSize", "MinSize", "ReleaseVersion", "PublicAccessCidrs"
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", "NodeCreationFailure", "PodEvictionFailure", "InsufficientFreeAddresses"
resp.update.errors[0].error_message #=> String
resp.update.errors[0].resource_ids #=> Array
resp.update.errors[0].resource_ids[0] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :name (required, String)

    The name of the Amazon EKS cluster associated with the update.

  • :update_id (required, String)

    The ID of the update to describe.

  • :nodegroup_name (String)

    The name of the Amazon EKS node group associated with the update.

Returns:

See Also:



1337
1338
1339
1340
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1337

def describe_update(params = {}, options = {})
  req = build_request(:describe_update, params)
  req.send_request(options)
end

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

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

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

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

Parameters:

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

    ({})

Options Hash (params):

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



1407
1408
1409
1410
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1407

def list_clusters(params = {}, options = {})
  req = build_request(:list_clusters, params)
  req.send_request(options)
end

#list_fargate_profiles(params = {}) ⇒ Types::ListFargateProfilesResponse

Lists the AWS Fargate profiles associated with the specified cluster in your AWS account in the specified Region.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :cluster_name (required, String)

    The name of the Amazon EKS cluster that you would like to listFargate profiles in.

  • :max_results (Integer)

    The maximum number of Fargate profile results returned by ListFargateProfiles in paginated output. When you use this parameter, ListFargateProfiles 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 ListFargateProfiles request with the returned nextToken value. This value can be between 1 and 100. If you don't use this parameter, ListFargateProfiles returns up to 100 results and a nextToken value if applicable.

  • :next_token (String)

    The nextToken value returned from a previous paginated ListFargateProfiles 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.

Returns:

See Also:



1462
1463
1464
1465
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1462

def list_fargate_profiles(params = {}, options = {})
  req = build_request(:list_fargate_profiles, params)
  req.send_request(options)
end

#list_nodegroups(params = {}) ⇒ Types::ListNodegroupsResponse

Lists the Amazon EKS managed node groups associated with the specified cluster in your AWS account in the specified Region. Self-managed node groups are not listed.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :cluster_name (required, String)

    The name of the Amazon EKS cluster that you would like to list node groups in.

  • :max_results (Integer)

    The maximum number of node group results returned by ListNodegroups in paginated output. When you use this parameter, ListNodegroups 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 ListNodegroups request with the returned nextToken value. This value can be between 1 and 100. If you don't use this parameter, ListNodegroups returns up to 100 results and a nextToken value if applicable.

  • :next_token (String)

    The nextToken value returned from a previous paginated ListNodegroups 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.

Returns:

See Also:



1516
1517
1518
1519
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1516

def list_nodegroups(params = {}, options = {})
  req = build_request(:list_nodegroups, params)
  req.send_request(options)
end

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

List the tags for an Amazon EKS resource.

Examples:

Example: To list tags for a cluster


# This example lists all of the tags for the `beta` cluster.

resp = client.list_tags_for_resource({
  resource_arn: "arn:aws:eks:us-west-2:012345678910:cluster/beta", 
})

resp.to_h outputs the following:
{
  tags: {
    "aws:tag:domain" => "beta", 
  }, 
}

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :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 and managed node groups.

Returns:

See Also:



1563
1564
1565
1566
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1563

def list_tags_for_resource(params = {}, options = {})
  req = build_request(:list_tags_for_resource, params)
  req.send_request(options)
end

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

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

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


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

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :name (required, String)

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

  • :nodegroup_name (String)

    The name of the Amazon EKS managed node group 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:



1619
1620
1621
1622
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1619

def list_updates(params = {}, options = {})
  req = build_request(:list_updates, params)
  req.send_request(options)
end

#tag_resource(params = {}) ⇒ 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. Tags that you create for Amazon EKS resources do not propagate to any other resources associated with the cluster. For example, if you tag a cluster with this operation, that tag does not automatically propagate to the subnets and worker nodes associated with the cluster.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :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 and managed node groups.

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



1656
1657
1658
1659
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1656

def tag_resource(params = {}, options = {})
  req = build_request(:tag_resource, params)
  req.send_request(options)
end

#untag_resource(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :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 and managed node groups.

  • :tag_keys (required, Array<String>)

    The keys of the tags to be removed.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1684
1685
1686
1687
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1684

def untag_resource(params = {}, options = {})
  req = build_request(:untag_resource, params)
  req.send_request(options)
end

#update_cluster_config(params = {}) ⇒ 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,
    public_access_cidrs: ["String"],
  },
  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", "ConfigUpdate"
resp.update.params #=> Array
resp.update.params[0].type #=> String, one of "Version", "PlatformVersion", "EndpointPrivateAccess", "EndpointPublicAccess", "ClusterLogging", "DesiredSize", "LabelsToAdd", "LabelsToRemove", "MaxSize", "MinSize", "ReleaseVersion", "PublicAccessCidrs"
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", "NodeCreationFailure", "PodEvictionFailure", "InsufficientFreeAddresses"
resp.update.errors[0].error_message #=> String
resp.update.errors[0].resource_ids #=> Array
resp.update.errors[0].resource_ids[0] #=> String

Parameters:

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

    ({})

Options Hash (params):

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

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



1804
1805
1806
1807
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1804

def update_cluster_config(params = {}, options = {})
  req = build_request(:update_cluster_config, params)
  req.send_request(options)
end

#update_cluster_version(params = {}) ⇒ 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.

If your cluster has managed node groups attached to it, all of your node groups’ Kubernetes versions must match the cluster’s Kubernetes version in order to update the cluster to a new Kubernetes version.

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", "ConfigUpdate"
resp.update.params #=> Array
resp.update.params[0].type #=> String, one of "Version", "PlatformVersion", "EndpointPrivateAccess", "EndpointPublicAccess", "ClusterLogging", "DesiredSize", "LabelsToAdd", "LabelsToRemove", "MaxSize", "MinSize", "ReleaseVersion", "PublicAccessCidrs"
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", "NodeCreationFailure", "PodEvictionFailure", "InsufficientFreeAddresses"
resp.update.errors[0].error_message #=> String
resp.update.errors[0].resource_ids #=> Array
resp.update.errors[0].resource_ids[0] #=> String

Parameters:

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

    ({})

Options Hash (params):

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

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



1868
1869
1870
1871
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1868

def update_cluster_version(params = {}, options = {})
  req = build_request(:update_cluster_version, params)
  req.send_request(options)
end

#update_nodegroup_config(params = {}) ⇒ Types::UpdateNodegroupConfigResponse

Updates an Amazon EKS managed node group configuration. Your node group continues to function during the update. The response output includes an update ID that you can use to track the status of your node group update with the DescribeUpdate API operation. Currently you can update the Kubernetes labels for a node group or the scaling configuration.

Examples:

Request syntax with placeholder values


resp = client.update_nodegroup_config({
  cluster_name: "String", # required
  nodegroup_name: "String", # required
  labels: {
    add_or_update_labels: {
      "labelKey" => "labelValue",
    },
    remove_labels: ["String"],
  },
  scaling_config: {
    min_size: 1,
    max_size: 1,
    desired_size: 1,
  },
  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", "ConfigUpdate"
resp.update.params #=> Array
resp.update.params[0].type #=> String, one of "Version", "PlatformVersion", "EndpointPrivateAccess", "EndpointPublicAccess", "ClusterLogging", "DesiredSize", "LabelsToAdd", "LabelsToRemove", "MaxSize", "MinSize", "ReleaseVersion", "PublicAccessCidrs"
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", "NodeCreationFailure", "PodEvictionFailure", "InsufficientFreeAddresses"
resp.update.errors[0].error_message #=> String
resp.update.errors[0].resource_ids #=> Array
resp.update.errors[0].resource_ids[0] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :cluster_name (required, String)

    The name of the Amazon EKS cluster that the managed node group resides in.

  • :nodegroup_name (required, String)

    The name of the managed node group to update.

  • :labels (Types::UpdateLabelsPayload)

    The Kubernetes labels to be applied to the nodes in the node group after the update.

  • :scaling_config (Types::NodegroupScalingConfig)

    The scaling configuration details for the Auto Scaling group after the update.

  • :client_request_token (String)

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



1944
1945
1946
1947
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 1944

def update_nodegroup_config(params = {}, options = {})
  req = build_request(:update_nodegroup_config, params)
  req.send_request(options)
end

#update_nodegroup_version(params = {}) ⇒ Types::UpdateNodegroupVersionResponse

Updates the Kubernetes version or AMI version of an Amazon EKS managed node group.

You can update to the latest available AMI version of a node group's current Kubernetes version by not specifying a Kubernetes version in the request. You can update to the latest AMI version of your cluster's current Kubernetes version by specifying your cluster's Kubernetes version in the request. For more information, see Amazon EKS-Optimized Linux AMI Versions in the Amazon EKS User Guide.

You cannot roll back a node group to an earlier Kubernetes version or AMI version.

When a node in a managed node group is terminated due to a scaling action or update, the pods in that node are drained first. Amazon EKS attempts to drain the nodes gracefully and will fail if it is unable to do so. You can force the update if Amazon EKS is unable to drain the nodes as a result of a pod disruption budget issue.

Examples:

Request syntax with placeholder values


resp = client.update_nodegroup_version({
  cluster_name: "String", # required
  nodegroup_name: "String", # required
  version: "String",
  release_version: "String",
  force: 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", "ConfigUpdate"
resp.update.params #=> Array
resp.update.params[0].type #=> String, one of "Version", "PlatformVersion", "EndpointPrivateAccess", "EndpointPublicAccess", "ClusterLogging", "DesiredSize", "LabelsToAdd", "LabelsToRemove", "MaxSize", "MinSize", "ReleaseVersion", "PublicAccessCidrs"
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", "NodeCreationFailure", "PodEvictionFailure", "InsufficientFreeAddresses"
resp.update.errors[0].error_message #=> String
resp.update.errors[0].resource_ids #=> Array
resp.update.errors[0].resource_ids[0] #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :cluster_name (required, String)

    The name of the Amazon EKS cluster that is associated with the managed node group to update.

  • :nodegroup_name (required, String)

    The name of the managed node group to update.

  • :version (String)

    The Kubernetes version to update to. If no version is specified, then the Kubernetes version of the node group does not change. You can specify the Kubernetes version of the cluster to update the node group to the latest AMI version of the cluster's Kubernetes version.

  • :release_version (String)

    The AMI version of the Amazon EKS-optimized AMI to use for the update. By default, the latest available AMI version for the node group's Kubernetes version is used. For more information, see Amazon EKS-Optimized Linux AMI Versions in the Amazon EKS User Guide.

  • :force (Boolean)

    Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue. If an update fails because pods could not be drained, you can force the update after it fails to terminate the old node whether or not any pods are running on the node.

  • :client_request_token (String)

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



2043
2044
2045
2046
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 2043

def update_nodegroup_version(params = {}, options = {})
  req = build_request(:update_nodegroup_version, params)
  req.send_request(options)
end

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

Polls an API operation until a resource enters a desired state.

Basic Usage

A waiter will call an API operation until:

  • It is successful
  • It enters a terminal state
  • It makes the maximum number of attempts

In between attempts, the waiter will sleep.

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

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.

# poll for ~25 seconds
client.wait_until(waiter_name, params, {
  max_attempts: 5,
  delay: 5,
})

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(waiter_name, params, {

  # disable max attempts
  max_attempts: nil,

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

Handling Errors

When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.

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

Valid Waiters

The following table lists the valid waiter names, the operations they call, and the default :delay and :max_attempts values.

waiter_name params :delay :max_attempts
cluster_active #describe_cluster 30 40
cluster_deleted #describe_cluster 30 40
nodegroup_active #describe_nodegroup 30 80
nodegroup_deleted #describe_nodegroup 30 40

Parameters:

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

    ({})

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

    ({})

Options Hash (options):

  • :max_attempts (Integer)
  • :delay (Integer)
  • :before_attempt (Proc)
  • :before_wait (Proc)

Yields:

  • (w.waiter)

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.



2156
2157
2158
2159
2160
# File 'gems/aws-sdk-eks/lib/aws-sdk-eks/client.rb', line 2156

def wait_until(waiter_name, params = {}, options = {})
  w = waiter(waiter_name, options)
  yield(w.waiter) if block_given? # deprecated
  w.wait(params)
end