Class CfnCluster
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::EKS::Cluster
.
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 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 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 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.
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 Managing Cluster Authentication 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 .encryptionConfig(List.of(EncryptionConfigProperty.builder() .provider(ProviderProperty.builder() .keyArn("keyArn") .build()) .resources(List.of("resources")) .build())) .kubernetesNetworkConfig(KubernetesNetworkConfigProperty.builder() .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()) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .version("version") .build();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnCluster
.static interface
The cluster control plane logging configuration for your cluster.static interface
The placement configuration for all the control plane instances of your local Amazon EKS cluster on an AWS Outpost.static interface
The encryption configuration for the cluster.static interface
The Kubernetes network configuration for the cluster.static interface
Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs.static interface
The enabled logging type.static interface
The configuration of your local Amazon EKS cluster on an AWS Outpost.static interface
Identifies the AWS Key Management Service ( AWS KMS ) key used to encrypt the secrets.static interface
An object representing the VPC configuration to use for an Amazon EKS cluster.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionCfnCluster
(Construct scope, String id, CfnClusterProps props) Create a newAWS::EKS::Cluster
.protected
CfnCluster
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnCluster
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe ARN of the cluster, such asarn:aws:eks:us-west-2:666666666666:cluster/prod
.Thecertificate-authority-data
for 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
.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.21
or later cluster with version>1.10.1
or later of the Amazon VPC CNI add-on and specifiedipv6
for ipFamily when you created the cluster.The issuer URL for the OIDC identity provider.The encryption configuration for the 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 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.getTags()
The metadata that you apply to the cluster to assist with categorization and organization.The desired Kubernetes version for your cluster.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setEncryptionConfig
(List<Object> value) The encryption configuration for the cluster.void
setEncryptionConfig
(IResolvable value) The encryption configuration for the cluster.void
The Kubernetes network configuration for the cluster.void
The Kubernetes network configuration for the cluster.void
setLogging
(IResolvable value) The logging configuration for your cluster.void
The logging configuration for your cluster.void
The unique name to give to your cluster.void
setOutpostConfig
(IResolvable value) An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.void
An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.void
setResourcesVpcConfig
(IResolvable value) The VPC configuration that's used by the cluster control plane.void
The VPC configuration that's used by the cluster control plane.void
setRoleArn
(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.void
setVersion
(String value) The desired Kubernetes version for your cluster.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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 Construct scope, @NotNull String id, @NotNull CfnClusterProps props) Create a newAWS::EKS::Cluster
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in 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-data
for 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.21
or later cluster with version>1.10.1
or later of the Amazon VPC CNI add-on and specifiedipv6
for ipFamily when you created the cluster. Kubernetes assigns Service addresses from the unique local address range (fc00::/7
) because you can't specify a customIPv6
CIDR block when you create the cluster. -
getAttrOpenIdConnectIssuerUrl
The issuer URL for the OIDC identity provider. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
The metadata that you 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. Cluster tags don't propagate to any other resources associated with the cluster.
You must have the
eks:TagResource
andeks:UntagResource
permissions for your IAM principal to manage the AWS CloudFormation stack. If you don't have these permissions, there might be unexpected behavior with stack-level tags propagating to the resource during resource creation and update. -
getResourcesVpcConfig
The VPC configuration that's 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.
Updates require replacement of the
SecurityGroupIds
andSubnetIds
sub-properties. -
setResourcesVpcConfig
The VPC configuration that's 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.
Updates require replacement of the
SecurityGroupIds
andSubnetIds
sub-properties. -
setResourcesVpcConfig
@Stability(Stable) public void setResourcesVpcConfig(@NotNull CfnCluster.ResourcesVpcConfigProperty value) The VPC configuration that's 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.
Updates require replacement of the
SecurityGroupIds
andSubnetIds
sub-properties. -
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.For more information, see Amazon EKS Service IAM Role in the Amazon EKS User Guide .
-
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.For more information, see Amazon EKS Service IAM Role in the Amazon EKS User Guide .
-
getEncryptionConfig
The encryption configuration for the cluster. -
setEncryptionConfig
The encryption configuration for the cluster. -
setEncryptionConfig
The encryption configuration for the cluster. -
getKubernetesNetworkConfig
The Kubernetes network configuration for the cluster. -
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. -
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.This object isn't available for clusters on the AWS cloud.
-
setOutpostConfig
An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.This object isn't available for clusters on the AWS cloud.
-
setOutpostConfig
An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.This object isn't available for clusters on the AWS cloud.
-
getVersion
The desired Kubernetes version for your cluster.If you don't specify a value here, the default version available in Amazon EKS is used.
The default version might not be the latest version available.
-
setVersion
The desired Kubernetes version for your cluster.If you don't specify a value here, the default version available in Amazon EKS is used.
The default version might not be the latest version available.
-