Class CfnCluster
- All Implemented Interfaces:
IInspectable,IClusterRef,IEnvironmentAware,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
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 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.
The cluster control plane is provisioned across multiple Availability Zones and fronted by an ELB 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 kubectl exec , logs , and proxy data flows).
Amazon EKS nodes run in your AWS 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.
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. The endpoint domain name and IP address family depends on the value of the ipFamily for the cluster. 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 CloudWatch Pricing .
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 Allowing users to access your cluster and Launching Amazon EKS nodes in the Amazon EKS User Guide .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.eks.*;
CfnCluster cfnCluster = CfnCluster.Builder.create(this, "MyCfnCluster")
.resourcesVpcConfig(ResourcesVpcConfigProperty.builder()
.subnetIds(List.of("subnetIds"))
// the properties below are optional
.endpointPrivateAccess(false)
.endpointPublicAccess(false)
.publicAccessCidrs(List.of("publicAccessCidrs"))
.securityGroupIds(List.of("securityGroupIds"))
.build())
.roleArn("roleArn")
// the properties below are optional
.accessConfig(AccessConfigProperty.builder()
.authenticationMode("authenticationMode")
.bootstrapClusterCreatorAdminPermissions(false)
.build())
.bootstrapSelfManagedAddons(false)
.computeConfig(ComputeConfigProperty.builder()
.enabled(false)
.nodePools(List.of("nodePools"))
.nodeRoleArn("nodeRoleArn")
.build())
.controlPlaneScalingConfig(ControlPlaneScalingConfigProperty.builder()
.tier("tier")
.build())
.deletionProtection(false)
.encryptionConfig(List.of(EncryptionConfigProperty.builder()
.provider(ProviderProperty.builder()
.keyArn("keyArn")
.build())
.resources(List.of("resources"))
.build()))
.force(false)
.kubernetesNetworkConfig(KubernetesNetworkConfigProperty.builder()
.elasticLoadBalancing(ElasticLoadBalancingProperty.builder()
.enabled(false)
.build())
.ipFamily("ipFamily")
.serviceIpv4Cidr("serviceIpv4Cidr")
.serviceIpv6Cidr("serviceIpv6Cidr")
.build())
.logging(LoggingProperty.builder()
.clusterLogging(ClusterLoggingProperty.builder()
.enabledTypes(List.of(LoggingTypeConfigProperty.builder()
.type("type")
.build()))
.build())
.build())
.name("name")
.outpostConfig(OutpostConfigProperty.builder()
.controlPlaneInstanceType("controlPlaneInstanceType")
.outpostArns(List.of("outpostArns"))
// the properties below are optional
.controlPlanePlacement(ControlPlanePlacementProperty.builder()
.groupName("groupName")
.build())
.build())
.remoteNetworkConfig(RemoteNetworkConfigProperty.builder()
.remoteNodeNetworks(List.of(RemoteNodeNetworkProperty.builder()
.cidrs(List.of("cidrs"))
.build()))
// the properties below are optional
.remotePodNetworks(List.of(RemotePodNetworkProperty.builder()
.cidrs(List.of("cidrs"))
.build()))
.build())
.storageConfig(StorageConfigProperty.builder()
.blockStorage(BlockStorageProperty.builder()
.enabled(false)
.build())
.build())
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.upgradePolicy(UpgradePolicyProperty.builder()
.supportType("supportType")
.build())
.version("version")
.zonalShiftConfig(ZonalShiftConfigProperty.builder()
.enabled(false)
.build())
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe access configuration for the cluster.static interfaceIndicates the current configuration of the block storage capability on your EKS Auto Mode cluster.static final classA fluent builder forCfnCluster.static interfaceThe cluster control plane logging configuration for your cluster.static interfaceIndicates the current configuration of the compute capability on your EKS Auto Mode cluster.static interfaceThe placement configuration for all the control plane instances of your local Amazon EKS cluster on an AWS Outpost.static interfaceThe control plane scaling tier configuration.static interfaceIndicates the current configuration of the load balancing capability on your EKS Auto Mode cluster.static interfaceThe encryption configuration for the cluster.static interfaceThe Kubernetes network configuration for the cluster.static interfaceEnable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs.static interfaceThe enabled logging type.static interfaceThe configuration of your local Amazon EKS cluster on an AWS Outpost.static interfaceIdentifies the AWS Key Management Service ( AWS ) key used to encrypt the secrets.static interfaceThe configuration in the cluster for EKS Hybrid Nodes.static interfaceA network CIDR that can contain hybrid nodes.static interfaceA network CIDR that can contain pods that run Kubernetes webhooks on hybrid nodes.static interfaceAn object representing the VPC configuration to use for an Amazon EKS cluster.static interfaceRequest to update the configuration of the storage capability of your EKS Auto Mode cluster.static interfaceThe support policy to use for the cluster.static interfaceThe configuration for zonal shift for the cluster.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.eks.IClusterRef
IClusterRef.Jsii$Default, IClusterRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnCluster(software.amazon.jsii.JsiiObjectRef objRef) CfnCluster(software.constructs.Construct scope, String id, CfnClusterProps props) Create a newAWS::EKS::Cluster. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForCluster(IClusterRef resource) static IClusterReffromClusterArn(software.constructs.Construct scope, String id, String arn) Creates a new IClusterRef from an ARN.static IClusterReffromClusterName(software.constructs.Construct scope, String id, String clusterName) Creates a new IClusterRef from a clusterName.The access configuration for the cluster.The ARN of the cluster, such asarn:aws:eks:us-west-2:666666666666:cluster/prod.Thecertificate-authority-datafor your cluster.The cluster security group that was created by Amazon EKS for the cluster.Amazon Resource Name (ARN) or alias of the customer master key (CMK).The endpoint for your Kubernetes API server, such ashttps://5E1D0CEXAMPLEA591B746AFC5AB30262---yl4---us-west-2---eks.amazonaws.com.rproxy.govskope.ca.The ID of your local Amazon EKS cluster on an AWS Outpost.The CIDR block that Kubernetes Service IP addresses are assigned from if you created a1.21or later cluster with version>1.10.1or later of the Amazon VPC CNI add-on and specifiedipv6for ipFamily when you created the cluster.The issuer URL for the OIDC identity provider of the cluster, such ashttps://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B716D3041E.If you set this value toFalsewhen creating a cluster, the default networking add-ons will not be installed.A reference to a Cluster resource.Indicates the current configuration of the compute capability on your EKS Auto Mode cluster.The control plane scaling tier configuration.The current deletion protection setting for the cluster.The encryption configuration for the cluster.getForce()Set this value totrueto override upgrade-blocking readiness checks when updating a cluster.The Kubernetes network configuration for the cluster.The logging configuration for your cluster.getName()The unique name to give to your cluster.An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.The configuration in the cluster for EKS Hybrid Nodes.The VPC configuration that's used by the cluster control plane.The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.Indicates the current configuration of the block storage capability on your EKS Auto Mode cluster.getTags()Tag Manager which manages the tags for this resource.The metadata that you apply to the cluster to assist with categorization and organization.This value indicates if extended support is enabled or disabled for the cluster.The desired Kubernetes version for your cluster.The configuration for zonal shift for the cluster.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnCluster.renderProperties(Map<String, Object> props) voidsetAccessConfig(IResolvable value) The access configuration for the cluster.voidThe access configuration for the cluster.voidIf you set this value toFalsewhen creating a cluster, the default networking add-ons will not be installed.voidIf you set this value toFalsewhen creating a cluster, the default networking add-ons will not be installed.voidsetComputeConfig(IResolvable value) Indicates the current configuration of the compute capability on your EKS Auto Mode cluster.voidIndicates the current configuration of the compute capability on your EKS Auto Mode cluster.voidThe control plane scaling tier configuration.voidThe control plane scaling tier configuration.voidsetDeletionProtection(Boolean value) The current deletion protection setting for the cluster.voidsetDeletionProtection(IResolvable value) The current deletion protection setting for the cluster.voidsetEncryptionConfig(List<Object> value) The encryption configuration for the cluster.voidsetEncryptionConfig(IResolvable value) The encryption configuration for the cluster.voidSet this value totrueto override upgrade-blocking readiness checks when updating a cluster.voidsetForce(IResolvable value) Set this value totrueto override upgrade-blocking readiness checks when updating a cluster.voidThe Kubernetes network configuration for the cluster.voidThe Kubernetes network configuration for the cluster.voidsetLogging(IResolvable value) The logging configuration for your cluster.voidThe logging configuration for your cluster.voidThe unique name to give to your cluster.voidsetOutpostConfig(IResolvable value) An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.voidAn object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.voidThe configuration in the cluster for EKS Hybrid Nodes.voidThe configuration in the cluster for EKS Hybrid Nodes.voidsetResourcesVpcConfig(IResolvable value) The VPC configuration that's used by the cluster control plane.voidThe VPC configuration that's used by the cluster control plane.voidsetRoleArn(String value) The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.voidsetStorageConfig(IResolvable value) Indicates the current configuration of the block storage capability on your EKS Auto Mode cluster.voidIndicates the current configuration of the block storage capability on your EKS Auto Mode cluster.voidsetTagsRaw(List<CfnTag> value) The metadata that you apply to the cluster to assist with categorization and organization.voidsetUpgradePolicy(IResolvable value) This value indicates if extended support is enabled or disabled for the cluster.voidThis value indicates if extended support is enabled or disabled for the cluster.voidsetVersion(String value) The desired Kubernetes version for your cluster.voidsetZonalShiftConfig(IResolvable value) The configuration for zonal shift for the cluster.voidThe configuration for zonal shift for the cluster.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnCluster
protected CfnCluster(software.amazon.jsii.JsiiObjectRef objRef) -
CfnCluster
protected CfnCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnCluster
@Stability(Stable) public CfnCluster(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnClusterProps props) Create a newAWS::EKS::Cluster.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForCluster
- Parameters:
resource- This parameter is required.
-
fromClusterArn
@Stability(Stable) @NotNull public static IClusterRef fromClusterArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String arn) Creates a new IClusterRef from an ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.arn- This parameter is required.
-
fromClusterName
@Stability(Stable) @NotNull public static IClusterRef fromClusterName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String clusterName) Creates a new IClusterRef from a clusterName.- Parameters:
scope- This parameter is required.id- This parameter is required.clusterName- This parameter is required.
-
isCfnCluster
Checks whether the given object is a CfnCluster.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The ARN of the cluster, such asarn:aws:eks:us-west-2:666666666666:cluster/prod. -
getAttrCertificateAuthorityData
Thecertificate-authority-datafor your cluster. -
getAttrClusterSecurityGroupId
The cluster security group that was created by Amazon EKS for the cluster.Managed node groups use this security group for control plane to data plane communication.
This parameter is only returned by Amazon EKS clusters that support managed node groups. For more information, see Managed node groups in the Amazon EKS User Guide .
-
getAttrEncryptionConfigKeyArn
Amazon Resource Name (ARN) or alias of the customer master key (CMK). -
getAttrEndpoint
The endpoint for your Kubernetes API server, such ashttps://5E1D0CEXAMPLEA591B746AFC5AB30262.yl4.us-west-2.eks.amazonaws.com. -
getAttrId
The ID of your local Amazon EKS cluster on an AWS Outpost.This property isn't available for an Amazon EKS cluster on the AWS cloud.
-
getAttrKubernetesNetworkConfigServiceIpv6Cidr
The CIDR block that Kubernetes Service IP addresses are assigned from if you created a1.21or later cluster with version>1.10.1or later of the Amazon VPC CNI add-on and specifiedipv6for ipFamily when you created the cluster. Kubernetes assigns Service addresses from the unique local address range (fc00::/7) because you can't specify a customIPv6CIDR block when you create the cluster. -
getAttrOpenIdConnectIssuerUrl
The issuer URL for the OIDC identity provider of the cluster, such ashttps://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B716D3041E. If you need to removehttps://from this output value, you can include the following code in your template.!Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]] -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getClusterRef
A reference to a Cluster resource.- Specified by:
getClusterRefin interfaceIClusterRef
-
getTags
Tag Manager which manages the tags for this resource. -
getResourcesVpcConfig
The VPC configuration that's used by the cluster control plane.Returns union: either
IResolvableorCfnCluster.ResourcesVpcConfigProperty -
setResourcesVpcConfig
The VPC configuration that's used by the cluster control plane. -
setResourcesVpcConfig
@Stability(Stable) public void setResourcesVpcConfig(@NotNull CfnCluster.ResourcesVpcConfigProperty value) The VPC configuration that's used by the cluster control plane. -
getRoleArn
The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. -
setRoleArn
The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. -
getAccessConfig
The access configuration for the cluster.Returns union: either
IResolvableorCfnCluster.AccessConfigProperty -
setAccessConfig
The access configuration for the cluster. -
setAccessConfig
The access configuration for the cluster. -
getBootstrapSelfManagedAddons
If you set this value toFalsewhen creating a cluster, the default networking add-ons will not be installed.Returns union: either
BooleanorIResolvable -
setBootstrapSelfManagedAddons
If you set this value toFalsewhen creating a cluster, the default networking add-ons will not be installed. -
setBootstrapSelfManagedAddons
If you set this value toFalsewhen creating a cluster, the default networking add-ons will not be installed. -
getComputeConfig
Indicates the current configuration of the compute capability on your EKS Auto Mode cluster.Returns union: either
IResolvableorCfnCluster.ComputeConfigProperty -
setComputeConfig
Indicates the current configuration of the compute capability on your EKS Auto Mode cluster. -
setComputeConfig
Indicates the current configuration of the compute capability on your EKS Auto Mode cluster. -
getControlPlaneScalingConfig
The control plane scaling tier configuration.Returns union: either
IResolvableorCfnCluster.ControlPlaneScalingConfigProperty -
setControlPlaneScalingConfig
The control plane scaling tier configuration. -
setControlPlaneScalingConfig
@Stability(Stable) public void setControlPlaneScalingConfig(@Nullable CfnCluster.ControlPlaneScalingConfigProperty value) The control plane scaling tier configuration. -
getDeletionProtection
The current deletion protection setting for the cluster.Returns union: either
BooleanorIResolvable -
setDeletionProtection
The current deletion protection setting for the cluster. -
setDeletionProtection
The current deletion protection setting for the cluster. -
getEncryptionConfig
The encryption configuration for the cluster.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnCluster.EncryptionConfigProperty> -
setEncryptionConfig
The encryption configuration for the cluster. -
setEncryptionConfig
The encryption configuration for the cluster. -
getForce
Set this value totrueto override upgrade-blocking readiness checks when updating a cluster.Returns union: either
BooleanorIResolvable -
setForce
Set this value totrueto override upgrade-blocking readiness checks when updating a cluster. -
setForce
Set this value totrueto override upgrade-blocking readiness checks when updating a cluster. -
getKubernetesNetworkConfig
The Kubernetes network configuration for the cluster.Returns union: either
IResolvableorCfnCluster.KubernetesNetworkConfigProperty -
setKubernetesNetworkConfig
The Kubernetes network configuration for the cluster. -
setKubernetesNetworkConfig
@Stability(Stable) public void setKubernetesNetworkConfig(@Nullable CfnCluster.KubernetesNetworkConfigProperty value) The Kubernetes network configuration for the cluster. -
getLogging
The logging configuration for your cluster.Returns union: either
IResolvableorCfnCluster.LoggingProperty -
setLogging
The logging configuration for your cluster. -
setLogging
The logging configuration for your cluster. -
getName
The unique name to give to your cluster. -
setName
The unique name to give to your cluster. -
getOutpostConfig
An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.Returns union: either
IResolvableorCfnCluster.OutpostConfigProperty -
setOutpostConfig
An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost. -
setOutpostConfig
An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost. -
getRemoteNetworkConfig
The configuration in the cluster for EKS Hybrid Nodes.Returns union: either
IResolvableorCfnCluster.RemoteNetworkConfigProperty -
setRemoteNetworkConfig
The configuration in the cluster for EKS Hybrid Nodes. -
setRemoteNetworkConfig
@Stability(Stable) public void setRemoteNetworkConfig(@Nullable CfnCluster.RemoteNetworkConfigProperty value) The configuration in the cluster for EKS Hybrid Nodes. -
getStorageConfig
Indicates the current configuration of the block storage capability on your EKS Auto Mode cluster.Returns union: either
IResolvableorCfnCluster.StorageConfigProperty -
setStorageConfig
Indicates the current configuration of the block storage capability on your EKS Auto Mode cluster. -
setStorageConfig
Indicates the current configuration of the block storage capability on your EKS Auto Mode cluster. -
getTagsRaw
The metadata that you apply to the cluster to assist with categorization and organization. -
setTagsRaw
The metadata that you apply to the cluster to assist with categorization and organization. -
getUpgradePolicy
This value indicates if extended support is enabled or disabled for the cluster.Returns union: either
IResolvableorCfnCluster.UpgradePolicyProperty -
setUpgradePolicy
This value indicates if extended support is enabled or disabled for the cluster. -
setUpgradePolicy
This value indicates if extended support is enabled or disabled for the cluster. -
getVersion
The desired Kubernetes version for your cluster. -
setVersion
The desired Kubernetes version for your cluster. -
getZonalShiftConfig
The configuration for zonal shift for the cluster.Returns union: either
IResolvableorCfnCluster.ZonalShiftConfigProperty -
setZonalShiftConfig
The configuration for zonal shift for the cluster. -
setZonalShiftConfig
@Stability(Stable) public void setZonalShiftConfig(@Nullable CfnCluster.ZonalShiftConfigProperty value) The configuration for zonal shift for the cluster.
-