Class CfnCluster

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:42.647Z") @Stability(Stable) public class CfnCluster extends CfnResource implements IInspectable
A CloudFormation AWS::MSK::Cluster.

Creates a new MSK cluster. The following Python 3.6 examples shows how you can create a cluster that's distributed over two Availability Zones. Before you run this Python script, replace the example subnet and security-group IDs with the IDs of your subnets and security group. When you create an MSK cluster, its brokers get evenly distributed over a number of Availability Zones that's equal to the number of subnets that you specify in the BrokerNodeGroupInfo parameter. In this example, you can add a third subnet to get a cluster that's distributed over three Availability Zones.

 import boto3 client = boto3.client('kafka') response = client.create_cluster( BrokerNodeGroupInfo={ 'BrokerAZDistribution': 'DEFAULT', 'ClientSubnets': [ 'subnet-012345678901fedcba', 'subnet-9876543210abcdef01' ], 'InstanceType': 'kafka.m5.large', 'SecurityGroups': [ 'sg-012345abcdef789789' ] }, ClusterName='SalesCluster', EncryptionInfo={ 'EncryptionInTransit': { 'ClientBroker': 'TLS_PLAINTEXT', 'InCluster': True } }, EnhancedMonitoring='PER_TOPIC_PER_BROKER', KafkaVersion='2.2.1', NumberOfBrokerNodes=2
 ) print(response)
 

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.msk.*;
 CfnCluster cfnCluster = CfnCluster.Builder.create(this, "MyCfnCluster")
         .brokerNodeGroupInfo(BrokerNodeGroupInfoProperty.builder()
                 .clientSubnets(List.of("clientSubnets"))
                 .instanceType("instanceType")
                 // the properties below are optional
                 .brokerAzDistribution("brokerAzDistribution")
                 .connectivityInfo(ConnectivityInfoProperty.builder()
                         .publicAccess(PublicAccessProperty.builder()
                                 .type("type")
                                 .build())
                         .vpcConnectivity(VpcConnectivityProperty.builder()
                                 .clientAuthentication(VpcConnectivityClientAuthenticationProperty.builder()
                                         .sasl(VpcConnectivitySaslProperty.builder()
                                                 .iam(VpcConnectivityIamProperty.builder()
                                                         .enabled(false)
                                                         .build())
                                                 .scram(VpcConnectivityScramProperty.builder()
                                                         .enabled(false)
                                                         .build())
                                                 .build())
                                         .tls(VpcConnectivityTlsProperty.builder()
                                                 .enabled(false)
                                                 .build())
                                         .build())
                                 .build())
                         .build())
                 .securityGroups(List.of("securityGroups"))
                 .storageInfo(StorageInfoProperty.builder()
                         .ebsStorageInfo(EBSStorageInfoProperty.builder()
                                 .provisionedThroughput(ProvisionedThroughputProperty.builder()
                                         .enabled(false)
                                         .volumeThroughput(123)
                                         .build())
                                 .volumeSize(123)
                                 .build())
                         .build())
                 .build())
         .clusterName("clusterName")
         .kafkaVersion("kafkaVersion")
         .numberOfBrokerNodes(123)
         // the properties below are optional
         .clientAuthentication(ClientAuthenticationProperty.builder()
                 .sasl(SaslProperty.builder()
                         .iam(IamProperty.builder()
                                 .enabled(false)
                                 .build())
                         .scram(ScramProperty.builder()
                                 .enabled(false)
                                 .build())
                         .build())
                 .tls(TlsProperty.builder()
                         .certificateAuthorityArnList(List.of("certificateAuthorityArnList"))
                         .enabled(false)
                         .build())
                 .unauthenticated(UnauthenticatedProperty.builder()
                         .enabled(false)
                         .build())
                 .build())
         .configurationInfo(ConfigurationInfoProperty.builder()
                 .arn("arn")
                 .revision(123)
                 .build())
         .currentVersion("currentVersion")
         .encryptionInfo(EncryptionInfoProperty.builder()
                 .encryptionAtRest(EncryptionAtRestProperty.builder()
                         .dataVolumeKmsKeyId("dataVolumeKmsKeyId")
                         .build())
                 .encryptionInTransit(EncryptionInTransitProperty.builder()
                         .clientBroker("clientBroker")
                         .inCluster(false)
                         .build())
                 .build())
         .enhancedMonitoring("enhancedMonitoring")
         .loggingInfo(LoggingInfoProperty.builder()
                 .brokerLogs(BrokerLogsProperty.builder()
                         .cloudWatchLogs(CloudWatchLogsProperty.builder()
                                 .enabled(false)
                                 // the properties below are optional
                                 .logGroup("logGroup")
                                 .build())
                         .firehose(FirehoseProperty.builder()
                                 .enabled(false)
                                 // the properties below are optional
                                 .deliveryStream("deliveryStream")
                                 .build())
                         .s3(S3Property.builder()
                                 .enabled(false)
                                 // the properties below are optional
                                 .bucket("bucket")
                                 .prefix("prefix")
                                 .build())
                         .build())
                 .build())
         .openMonitoring(OpenMonitoringProperty.builder()
                 .prometheus(PrometheusProperty.builder()
                         .jmxExporter(JmxExporterProperty.builder()
                                 .enabledInBroker(false)
                                 .build())
                         .nodeExporter(NodeExporterProperty.builder()
                                 .enabledInBroker(false)
                                 .build())
                         .build())
                 .build())
         .storageMode("storageMode")
         .tags(Map.of(
                 "tagsKey", "tags"))
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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 new AWS::MSK::Cluster.

      Parameters:
      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.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Create tags when creating the cluster.
    • getBrokerNodeGroupInfo

      @Stability(Stable) @NotNull public Object getBrokerNodeGroupInfo()
      Information about the broker nodes in the cluster.
    • setBrokerNodeGroupInfo

      @Stability(Stable) public void setBrokerNodeGroupInfo(@NotNull CfnCluster.BrokerNodeGroupInfoProperty value)
      Information about the broker nodes in the cluster.
    • setBrokerNodeGroupInfo

      @Stability(Stable) public void setBrokerNodeGroupInfo(@NotNull IResolvable value)
      Information about the broker nodes in the cluster.
    • getClusterName

      @Stability(Stable) @NotNull public String getClusterName()
      The name of the cluster.
    • setClusterName

      @Stability(Stable) public void setClusterName(@NotNull String value)
      The name of the cluster.
    • getKafkaVersion

      @Stability(Stable) @NotNull public String getKafkaVersion()
      The version of Apache Kafka.

      You can use Amazon MSK to create clusters that use Apache Kafka versions 1.1.1 and 2.2.1.

    • setKafkaVersion

      @Stability(Stable) public void setKafkaVersion(@NotNull String value)
      The version of Apache Kafka.

      You can use Amazon MSK to create clusters that use Apache Kafka versions 1.1.1 and 2.2.1.

    • getNumberOfBrokerNodes

      @Stability(Stable) @NotNull public Number getNumberOfBrokerNodes()
      The number of broker nodes in the cluster.
    • setNumberOfBrokerNodes

      @Stability(Stable) public void setNumberOfBrokerNodes(@NotNull Number value)
      The number of broker nodes in the cluster.
    • getClientAuthentication

      @Stability(Stable) @Nullable public Object getClientAuthentication()
      Includes all client authentication related information.
    • setClientAuthentication

      @Stability(Stable) public void setClientAuthentication(@Nullable IResolvable value)
      Includes all client authentication related information.
    • setClientAuthentication

      @Stability(Stable) public void setClientAuthentication(@Nullable CfnCluster.ClientAuthenticationProperty value)
      Includes all client authentication related information.
    • getConfigurationInfo

      @Stability(Stable) @Nullable public Object getConfigurationInfo()
      Represents the configuration that you want MSK to use for the cluster.
    • setConfigurationInfo

      @Stability(Stable) public void setConfigurationInfo(@Nullable IResolvable value)
      Represents the configuration that you want MSK to use for the cluster.
    • setConfigurationInfo

      @Stability(Stable) public void setConfigurationInfo(@Nullable CfnCluster.ConfigurationInfoProperty value)
      Represents the configuration that you want MSK to use for the cluster.
    • getCurrentVersion

      @Stability(Stable) @Nullable public String getCurrentVersion()
      The version of the cluster that you want to update.
    • setCurrentVersion

      @Stability(Stable) public void setCurrentVersion(@Nullable String value)
      The version of the cluster that you want to update.
    • getEncryptionInfo

      @Stability(Stable) @Nullable public Object getEncryptionInfo()
      Includes all encryption-related information.
    • setEncryptionInfo

      @Stability(Stable) public void setEncryptionInfo(@Nullable IResolvable value)
      Includes all encryption-related information.
    • setEncryptionInfo

      @Stability(Stable) public void setEncryptionInfo(@Nullable CfnCluster.EncryptionInfoProperty value)
      Includes all encryption-related information.
    • getEnhancedMonitoring

      @Stability(Stable) @Nullable public String getEnhancedMonitoring()
      Specifies the level of monitoring for the MSK cluster.

      The possible values are DEFAULT , PER_BROKER , and PER_TOPIC_PER_BROKER .

    • setEnhancedMonitoring

      @Stability(Stable) public void setEnhancedMonitoring(@Nullable String value)
      Specifies the level of monitoring for the MSK cluster.

      The possible values are DEFAULT , PER_BROKER , and PER_TOPIC_PER_BROKER .

    • getLoggingInfo

      @Stability(Stable) @Nullable public Object getLoggingInfo()
      Logging Info details.
    • setLoggingInfo

      @Stability(Stable) public void setLoggingInfo(@Nullable IResolvable value)
      Logging Info details.
    • setLoggingInfo

      @Stability(Stable) public void setLoggingInfo(@Nullable CfnCluster.LoggingInfoProperty value)
      Logging Info details.
    • getOpenMonitoring

      @Stability(Stable) @Nullable public Object getOpenMonitoring()
      The settings for open monitoring.
    • setOpenMonitoring

      @Stability(Stable) public void setOpenMonitoring(@Nullable IResolvable value)
      The settings for open monitoring.
    • setOpenMonitoring

      @Stability(Stable) public void setOpenMonitoring(@Nullable CfnCluster.OpenMonitoringProperty value)
      The settings for open monitoring.
    • getStorageMode

      @Stability(Stable) @Nullable public String getStorageMode()
      This controls storage mode for supported storage tiers.
    • setStorageMode

      @Stability(Stable) public void setStorageMode(@Nullable String value)
      This controls storage mode for supported storage tiers.