UNPKG

@aws-sdk/client-eks

Version:

AWS SDK for JavaScript Eks Client for Node.js, Browser and React Native

365 lines (364 loc) 15.5 kB
import { Command as $Command } from "@smithy/smithy-client"; import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { EKSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EKSClient"; import { CreateClusterRequest, CreateClusterResponse } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link CreateClusterCommand}. */ export interface CreateClusterCommandInput extends CreateClusterRequest { } /** * @public * * The output of {@link CreateClusterCommand}. */ export interface CreateClusterCommandOutput extends CreateClusterResponse, __MetadataBearer { } declare const CreateClusterCommand_base: { new (input: CreateClusterCommandInput): import("@smithy/smithy-client").CommandImpl<CreateClusterCommandInput, CreateClusterCommandOutput, EKSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>; new (__0_0: CreateClusterCommandInput): import("@smithy/smithy-client").CommandImpl<CreateClusterCommandInput, CreateClusterCommandOutput, EKSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** * <p>Creates an Amazon EKS control plane.</p> * <p>The Amazon EKS control plane consists of control plane instances that run the Kubernetes * software, such as <code>etcd</code> and the API server. The control plane runs in an * account managed by Amazon Web Services, and the Kubernetes API is exposed by the Amazon EKS API server endpoint. * Each Amazon EKS cluster control plane is single tenant and unique. It runs on its own set of * Amazon EC2 instances.</p> * <p>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 nodes (for example, to support * <code>kubectl exec</code>, <code>logs</code>, and <code>proxy</code> data * flows).</p> * <p>Amazon EKS nodes run in your Amazon Web Services account and connect to your cluster's control plane over * the Kubernetes API server endpoint and a certificate file that is created for your * cluster.</p> * <p>You can use the <code>endpointPublicAccess</code> and * <code>endpointPrivateAccess</code> 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 <a href="https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html">Amazon EKS Cluster * Endpoint Access Control</a> in the <i> * <i>Amazon EKS User Guide</i> * </i>. </p> * <p>You can use the <code>logging</code> 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 <a href="https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html">Amazon EKS * Cluster Control Plane Logs</a> in the * <i> * <i>Amazon EKS User Guide</i> * </i>.</p> * <note> * <p>CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported * control plane logs. For more information, see <a href="http://aws.amazon.com/cloudwatch/pricing/">CloudWatch Pricing</a>.</p> * </note> * <p>In most cases, it takes several minutes to create a cluster. After you create an Amazon EKS * cluster, you must configure your Kubernetes tooling to communicate with the API server and * launch nodes into your cluster. For more information, see <a href="https://docs.aws.amazon.com/eks/latest/userguide/cluster-auth.html">Allowing users to * access your cluster</a> and <a href="https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html">Launching Amazon EKS * nodes</a> in the <i>Amazon EKS User Guide</i>.</p> * @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { EKSClient, CreateClusterCommand } from "@aws-sdk/client-eks"; // ES Modules import * // const { EKSClient, CreateClusterCommand } = require("@aws-sdk/client-eks"); // CommonJS import * const client = new EKSClient(config); * const input = { // CreateClusterRequest * name: "STRING_VALUE", // required * version: "STRING_VALUE", * roleArn: "STRING_VALUE", // required * resourcesVpcConfig: { // VpcConfigRequest * subnetIds: [ // StringList * "STRING_VALUE", * ], * securityGroupIds: [ * "STRING_VALUE", * ], * endpointPublicAccess: true || false, * endpointPrivateAccess: true || false, * publicAccessCidrs: [ * "STRING_VALUE", * ], * }, * kubernetesNetworkConfig: { // KubernetesNetworkConfigRequest * serviceIpv4Cidr: "STRING_VALUE", * ipFamily: "ipv4" || "ipv6", * elasticLoadBalancing: { // ElasticLoadBalancing * enabled: true || false, * }, * }, * logging: { // Logging * clusterLogging: [ // LogSetups * { // LogSetup * types: [ // LogTypes * "api" || "audit" || "authenticator" || "controllerManager" || "scheduler", * ], * enabled: true || false, * }, * ], * }, * clientRequestToken: "STRING_VALUE", * tags: { // TagMap * "<keys>": "STRING_VALUE", * }, * encryptionConfig: [ // EncryptionConfigList * { // EncryptionConfig * resources: [ * "STRING_VALUE", * ], * provider: { // Provider * keyArn: "STRING_VALUE", * }, * }, * ], * outpostConfig: { // OutpostConfigRequest * outpostArns: [ // required * "STRING_VALUE", * ], * controlPlaneInstanceType: "STRING_VALUE", // required * controlPlanePlacement: { // ControlPlanePlacementRequest * groupName: "STRING_VALUE", * }, * }, * accessConfig: { // CreateAccessConfigRequest * bootstrapClusterCreatorAdminPermissions: true || false, * authenticationMode: "API" || "API_AND_CONFIG_MAP" || "CONFIG_MAP", * }, * bootstrapSelfManagedAddons: true || false, * upgradePolicy: { // UpgradePolicyRequest * supportType: "STANDARD" || "EXTENDED", * }, * zonalShiftConfig: { // ZonalShiftConfigRequest * enabled: true || false, * }, * remoteNetworkConfig: { // RemoteNetworkConfigRequest * remoteNodeNetworks: [ // RemoteNodeNetworkList * { // RemoteNodeNetwork * cidrs: "<StringList>", * }, * ], * remotePodNetworks: [ // RemotePodNetworkList * { // RemotePodNetwork * cidrs: "<StringList>", * }, * ], * }, * computeConfig: { // ComputeConfigRequest * enabled: true || false, * nodePools: "<StringList>", * nodeRoleArn: "STRING_VALUE", * }, * storageConfig: { // StorageConfigRequest * blockStorage: { // BlockStorage * enabled: true || false, * }, * }, * }; * const command = new CreateClusterCommand(input); * const response = await client.send(command); * // { // CreateClusterResponse * // cluster: { // Cluster * // name: "STRING_VALUE", * // arn: "STRING_VALUE", * // createdAt: new Date("TIMESTAMP"), * // version: "STRING_VALUE", * // endpoint: "STRING_VALUE", * // roleArn: "STRING_VALUE", * // resourcesVpcConfig: { // VpcConfigResponse * // subnetIds: [ // StringList * // "STRING_VALUE", * // ], * // securityGroupIds: [ * // "STRING_VALUE", * // ], * // clusterSecurityGroupId: "STRING_VALUE", * // vpcId: "STRING_VALUE", * // endpointPublicAccess: true || false, * // endpointPrivateAccess: true || false, * // publicAccessCidrs: [ * // "STRING_VALUE", * // ], * // }, * // kubernetesNetworkConfig: { // KubernetesNetworkConfigResponse * // serviceIpv4Cidr: "STRING_VALUE", * // serviceIpv6Cidr: "STRING_VALUE", * // ipFamily: "ipv4" || "ipv6", * // elasticLoadBalancing: { // ElasticLoadBalancing * // enabled: true || false, * // }, * // }, * // logging: { // Logging * // clusterLogging: [ // LogSetups * // { // LogSetup * // types: [ // LogTypes * // "api" || "audit" || "authenticator" || "controllerManager" || "scheduler", * // ], * // enabled: true || false, * // }, * // ], * // }, * // identity: { // Identity * // oidc: { // OIDC * // issuer: "STRING_VALUE", * // }, * // }, * // status: "CREATING" || "ACTIVE" || "DELETING" || "FAILED" || "UPDATING" || "PENDING", * // certificateAuthority: { // Certificate * // data: "STRING_VALUE", * // }, * // clientRequestToken: "STRING_VALUE", * // platformVersion: "STRING_VALUE", * // tags: { // TagMap * // "<keys>": "STRING_VALUE", * // }, * // encryptionConfig: [ // EncryptionConfigList * // { // EncryptionConfig * // resources: [ * // "STRING_VALUE", * // ], * // provider: { // Provider * // keyArn: "STRING_VALUE", * // }, * // }, * // ], * // connectorConfig: { // ConnectorConfigResponse * // activationId: "STRING_VALUE", * // activationCode: "STRING_VALUE", * // activationExpiry: new Date("TIMESTAMP"), * // provider: "STRING_VALUE", * // roleArn: "STRING_VALUE", * // }, * // id: "STRING_VALUE", * // health: { // ClusterHealth * // issues: [ // ClusterIssueList * // { // ClusterIssue * // code: "AccessDenied" || "ClusterUnreachable" || "ConfigurationConflict" || "InternalFailure" || "ResourceLimitExceeded" || "ResourceNotFound" || "IamRoleNotFound" || "VpcNotFound" || "InsufficientFreeAddresses" || "Ec2ServiceNotSubscribed" || "Ec2SubnetNotFound" || "Ec2SecurityGroupNotFound" || "KmsGrantRevoked" || "KmsKeyNotFound" || "KmsKeyMarkedForDeletion" || "KmsKeyDisabled" || "StsRegionalEndpointDisabled" || "UnsupportedVersion" || "Other", * // message: "STRING_VALUE", * // resourceIds: "<StringList>", * // }, * // ], * // }, * // outpostConfig: { // OutpostConfigResponse * // outpostArns: "<StringList>", // required * // controlPlaneInstanceType: "STRING_VALUE", // required * // controlPlanePlacement: { // ControlPlanePlacementResponse * // groupName: "STRING_VALUE", * // }, * // }, * // accessConfig: { // AccessConfigResponse * // bootstrapClusterCreatorAdminPermissions: true || false, * // authenticationMode: "API" || "API_AND_CONFIG_MAP" || "CONFIG_MAP", * // }, * // upgradePolicy: { // UpgradePolicyResponse * // supportType: "STANDARD" || "EXTENDED", * // }, * // zonalShiftConfig: { // ZonalShiftConfigResponse * // enabled: true || false, * // }, * // remoteNetworkConfig: { // RemoteNetworkConfigResponse * // remoteNodeNetworks: [ // RemoteNodeNetworkList * // { // RemoteNodeNetwork * // cidrs: "<StringList>", * // }, * // ], * // remotePodNetworks: [ // RemotePodNetworkList * // { // RemotePodNetwork * // cidrs: "<StringList>", * // }, * // ], * // }, * // computeConfig: { // ComputeConfigResponse * // enabled: true || false, * // nodePools: "<StringList>", * // nodeRoleArn: "STRING_VALUE", * // }, * // storageConfig: { // StorageConfigResponse * // blockStorage: { // BlockStorage * // enabled: true || false, * // }, * // }, * // }, * // }; * * ``` * * @param CreateClusterCommandInput - {@link CreateClusterCommandInput} * @returns {@link CreateClusterCommandOutput} * @see {@link CreateClusterCommandInput} for command's `input` shape. * @see {@link CreateClusterCommandOutput} for command's `response` shape. * @see {@link EKSClientResolvedConfig | config} for EKSClient's `config` shape. * * @throws {@link ClientException} (client fault) * <p>These errors are usually caused by a client action. Actions can include using an * action or resource on behalf of an <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html">IAM principal</a> that doesn't have permissions to use * the action or resource or specifying an identifier that is not valid.</p> * * @throws {@link InvalidParameterException} (client fault) * <p>The specified parameter is invalid. Review the available parameters for the API * request.</p> * * @throws {@link ResourceInUseException} (client fault) * <p>The specified resource is in use.</p> * * @throws {@link ResourceLimitExceededException} (client fault) * <p>You have encountered a service limit on the specified resource.</p> * * @throws {@link ServerException} (server fault) * <p>These errors are usually caused by a server-side issue.</p> * * @throws {@link ServiceUnavailableException} (server fault) * <p>The service is unavailable. Back off and retry the operation.</p> * * @throws {@link UnsupportedAvailabilityZoneException} (client fault) * <p>At least one of your specified cluster subnets is in an Availability Zone that does not support * Amazon EKS. The exception output specifies the supported Availability Zones for your account, from which * you can choose subnets for your cluster.</p> * * @throws {@link EKSServiceException} * <p>Base exception class for all service exceptions from EKS service.</p> * * @public * @example To create a new cluster * ```javascript * // The following example creates an Amazon EKS cluster called prod. * const input = { * "version": "1.10", * "name": "prod", * "clientRequestToken": "1d2129a1-3d38-460a-9756-e5b91fddb951", * "resourcesVpcConfig": { * "securityGroupIds": [ * "sg-6979fe18" * ], * "subnetIds": [ * "subnet-6782e71e", * "subnet-e7e761ac" * ] * }, * "roleArn": "arn:aws:iam::012345678910:role/eks-service-role-AWSServiceRoleForAmazonEKS-J7ONKE3BQ4PI" * }; * const command = new CreateClusterCommand(input); * await client.send(command); * // example id: to-create-a-new-cluster-1527868185648 * ``` * */ export declare class CreateClusterCommand extends CreateClusterCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: CreateClusterRequest; output: CreateClusterResponse; }; sdk: { input: CreateClusterCommandInput; output: CreateClusterCommandOutput; }; }; }