@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:49.136Z") public class CfnCluster extends CfnResource implements IInspectable
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.legacy.*; 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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnCluster.Builder
A fluent builder for
CfnCluster . |
static interface |
CfnCluster.ClusterLoggingProperty
The cluster control plane logging configuration for your cluster.
|
static interface |
CfnCluster.ControlPlanePlacementProperty
The placement configuration for all the control plane instances of your local Amazon EKS cluster on an AWS Outpost.
|
static interface |
CfnCluster.EncryptionConfigProperty
The encryption configuration for the cluster.
|
static interface |
CfnCluster.KubernetesNetworkConfigProperty
The Kubernetes network configuration for the cluster.
|
static interface |
CfnCluster.LoggingProperty
Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs.
|
static interface |
CfnCluster.LoggingTypeConfigProperty
The enabled logging type.
|
static interface |
CfnCluster.OutpostConfigProperty
The configuration of your local Amazon EKS cluster on an AWS Outpost.
|
static interface |
CfnCluster.ProviderProperty
Identifies the AWS Key Management Service ( AWS KMS ) key used to encrypt the secrets.
|
static interface |
CfnCluster.ResourcesVpcConfigProperty
An object representing the VPC configuration to use for an Amazon EKS cluster.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnCluster(Construct scope,
java.lang.String id,
CfnClusterProps props)
Create a new `AWS::EKS::Cluster`.
|
protected |
CfnCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnCluster(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrArn()
The ARN of the cluster, such as `arn:aws:eks:us-west-2:666666666666:cluster/prod` .
|
java.lang.String |
getAttrCertificateAuthorityData()
The `certificate-authority-data` for your cluster.
|
java.lang.String |
getAttrClusterSecurityGroupId()
The cluster security group that was created by Amazon EKS for the cluster.
|
java.lang.String |
getAttrEncryptionConfigKeyArn()
Amazon Resource Name (ARN) or alias of the customer master key (CMK).
|
java.lang.String |
getAttrEndpoint()
The endpoint for your Kubernetes API server, such as `https://5E1D0CEXAMPLEA591B746AFC5AB30262.yl4.us-west-2.eks.amazonaws.com` .
|
java.lang.String |
getAttrId()
The ID of your local Amazon EKS cluster on an AWS Outpost.
|
java.lang.String |
getAttrKubernetesNetworkConfigServiceIpv6Cidr()
The CIDR block that Kubernetes Service IP addresses are assigned from if you created a `1.21` or later cluster with version `>1.10.1` or later of the Amazon VPC CNI add-on and specified `ipv6` for *ipFamily* when you created the cluster.
|
java.lang.String |
getAttrOpenIdConnectIssuerUrl()
The issuer URL for the OIDC identity provider.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.Object |
getEncryptionConfig()
The encryption configuration for the cluster.
|
java.lang.Object |
getKubernetesNetworkConfig()
The Kubernetes network configuration for the cluster.
|
java.lang.Object |
getLogging()
The logging configuration for your cluster.
|
java.lang.String |
getName()
The unique name to give to your cluster.
|
java.lang.Object |
getOutpostConfig()
An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.
|
java.lang.Object |
getResourcesVpcConfig()
The VPC configuration that's used by the cluster control plane.
|
java.lang.String |
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.
|
TagManager |
getTags()
The metadata that you apply to the cluster to assist with categorization and organization.
|
java.lang.String |
getVersion()
The desired Kubernetes version for your cluster.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setEncryptionConfig(IResolvable value)
The encryption configuration for the cluster.
|
void |
setEncryptionConfig(java.util.List<java.lang.Object> value)
The encryption configuration for the cluster.
|
void |
setKubernetesNetworkConfig(CfnCluster.KubernetesNetworkConfigProperty value)
The Kubernetes network configuration for the cluster.
|
void |
setKubernetesNetworkConfig(IResolvable value)
The Kubernetes network configuration for the cluster.
|
void |
setLogging(CfnCluster.LoggingProperty value)
The logging configuration for your cluster.
|
void |
setLogging(IResolvable value)
The logging configuration for your cluster.
|
void |
setName(java.lang.String value)
The unique name to give to your cluster.
|
void |
setOutpostConfig(CfnCluster.OutpostConfigProperty value)
An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.
|
void |
setOutpostConfig(IResolvable value)
An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.
|
void |
setResourcesVpcConfig(CfnCluster.ResourcesVpcConfigProperty value)
The VPC configuration that's used by the cluster control plane.
|
void |
setResourcesVpcConfig(IResolvable value)
The VPC configuration that's used by the cluster control plane.
|
void |
setRoleArn(java.lang.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(java.lang.String value)
The desired Kubernetes version for your cluster.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnCluster(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnCluster(Construct scope, java.lang.String id, CfnClusterProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrArn()
public java.lang.String getAttrCertificateAuthorityData()
public java.lang.String getAttrClusterSecurityGroupId()
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 .
public java.lang.String getAttrEncryptionConfigKeyArn()
public java.lang.String getAttrEndpoint()
public java.lang.String getAttrId()
This property isn't available for an Amazon EKS cluster on the AWS cloud.
public java.lang.String getAttrKubernetesNetworkConfigServiceIpv6Cidr()
public java.lang.String getAttrOpenIdConnectIssuerUrl()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
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.
public java.lang.Object getResourcesVpcConfig()
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.
public void setResourcesVpcConfig(IResolvable value)
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.
public void setResourcesVpcConfig(CfnCluster.ResourcesVpcConfigProperty value)
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.
public java.lang.String getRoleArn()
For more information, see Amazon EKS Service IAM Role in the Amazon EKS User Guide .
public void setRoleArn(java.lang.String value)
For more information, see Amazon EKS Service IAM Role in the Amazon EKS User Guide .
public java.lang.Object getEncryptionConfig()
public void setEncryptionConfig(IResolvable value)
public void setEncryptionConfig(java.util.List<java.lang.Object> value)
public java.lang.Object getKubernetesNetworkConfig()
public void setKubernetesNetworkConfig(IResolvable value)
public void setKubernetesNetworkConfig(CfnCluster.KubernetesNetworkConfigProperty value)
public java.lang.Object getLogging()
public void setLogging(IResolvable value)
public void setLogging(CfnCluster.LoggingProperty value)
public java.lang.String getName()
public void setName(java.lang.String value)
public java.lang.Object getOutpostConfig()
This object isn't available for clusters on the AWS cloud.
public void setOutpostConfig(IResolvable value)
This object isn't available for clusters on the AWS cloud.
public void setOutpostConfig(CfnCluster.OutpostConfigProperty value)
This object isn't available for clusters on the AWS cloud.
public java.lang.String getVersion()
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.
public void setVersion(java.lang.String value)
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.