Class CfnCluster
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
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();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe broker logs configuration for this MSK cluster.static interfaceDescribes the setup to be used for the broker nodes in the cluster.static final classA fluent builder forCfnCluster.static interfaceIncludes all client authentication information.static interfaceDetails of the CloudWatch Logs destination for broker logs.static interfaceSpecifies the configuration to use for the brokers.static interfaceBroker access controls.static interfaceContains information about the EBS storage volumes attached to the broker nodes.static interfaceThe data-volume encryption details.static interfaceIncludes encryption-related information, such as the Amazon KMS key used for encrypting data at rest and whether you want MSK to encrypt your data in transit.static interfaceThe settings for encrypting data in transit.static interfaceFirehose details for BrokerLogs.static interfaceDetails for SASL/IAM client authentication.static interfaceIndicates whether you want to enable or disable the JMX Exporter.static interfaceYou can configure your MSK cluster to send broker logs to different destination types.static interfaceIndicates whether you want to enable or disable the Node Exporter.static interfaceJMX and Node monitoring for the MSK cluster.static interfacePrometheus settings for open monitoring.static interfaceContains information about provisioned throughput for EBS storage volumes attached to kafka broker nodes.static interfaceBroker access controls.static interfaceThe details of the Amazon S3 destination for broker logs.static interfaceDetails for client authentication using SASL.static interfaceDetails for SASL/SCRAM client authentication.static interfaceContains information about storage volumes attached to Amazon MSK broker nodes.static interfaceDetails for client authentication using TLS.static interfaceDetails for allowing no client authentication.static interfaceIncludes all client authentication information for VpcConnectivity.static interfaceDetails for SASL/IAM client authentication for VpcConnectivity.static interfaceVPC connection control settings for brokers.static interfaceDetails for client authentication using SASL for VpcConnectivity.static interfaceDetails for SASL/SCRAM client authentication for vpcConnectivity.static interfaceDetails for client authentication using TLS for vpcConnectivity.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnCluster(Construct scope, String id, CfnClusterProps props) Create a newAWS::MSK::Cluster.protectedCfnCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnCluster(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionInformation about the broker nodes in the cluster.Includes all client authentication related information.The name of the cluster.Represents the configuration that you want MSK to use for the cluster.The version of the cluster that you want to update.Includes all encryption-related information.Specifies the level of monitoring for the MSK cluster.The version of Apache Kafka.Logging Info details.The number of broker nodes in the cluster.The settings for open monitoring.This controls storage mode for supported storage tiers.getTags()Create tags when creating the cluster.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidInformation about the broker nodes in the cluster.voidInformation about the broker nodes in the cluster.voidIncludes all client authentication related information.voidIncludes all client authentication related information.voidsetClusterName(String value) The name of the cluster.voidsetConfigurationInfo(IResolvable value) Represents the configuration that you want MSK to use for the cluster.voidRepresents the configuration that you want MSK to use for the cluster.voidsetCurrentVersion(String value) The version of the cluster that you want to update.voidsetEncryptionInfo(IResolvable value) Includes all encryption-related information.voidIncludes all encryption-related information.voidsetEnhancedMonitoring(String value) Specifies the level of monitoring for the MSK cluster.voidsetKafkaVersion(String value) The version of Apache Kafka.voidsetLoggingInfo(IResolvable value) Logging Info details.voidLogging Info details.voidsetNumberOfBrokerNodes(Number value) The number of broker nodes in the cluster.voidsetOpenMonitoring(IResolvable value) The settings for open monitoring.voidThe settings for open monitoring.voidsetStorageMode(String value) This controls storage mode for supported storage tiers.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, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods 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.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::MSK::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:
inspectin 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
Create tags when creating the cluster. -
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
Information about the broker nodes in the cluster. -
getClusterName
The name of the cluster. -
setClusterName
The name of the cluster. -
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
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
The number of broker nodes in the cluster. -
setNumberOfBrokerNodes
The number of broker nodes in the cluster. -
getClientAuthentication
Includes all client authentication related information. -
setClientAuthentication
Includes all client authentication related information. -
setClientAuthentication
@Stability(Stable) public void setClientAuthentication(@Nullable CfnCluster.ClientAuthenticationProperty value) Includes all client authentication related information. -
getConfigurationInfo
Represents the configuration that you want MSK to use for the cluster. -
setConfigurationInfo
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
The version of the cluster that you want to update. -
setCurrentVersion
The version of the cluster that you want to update. -
getEncryptionInfo
Includes all encryption-related information. -
setEncryptionInfo
Includes all encryption-related information. -
setEncryptionInfo
Includes all encryption-related information. -
getEnhancedMonitoring
Specifies the level of monitoring for the MSK cluster.The possible values are
DEFAULT,PER_BROKER, andPER_TOPIC_PER_BROKER. -
setEnhancedMonitoring
Specifies the level of monitoring for the MSK cluster.The possible values are
DEFAULT,PER_BROKER, andPER_TOPIC_PER_BROKER. -
getLoggingInfo
Logging Info details. -
setLoggingInfo
Logging Info details. -
setLoggingInfo
Logging Info details. -
getOpenMonitoring
The settings for open monitoring. -
setOpenMonitoring
The settings for open monitoring. -
setOpenMonitoring
The settings for open monitoring. -
getStorageMode
This controls storage mode for supported storage tiers. -
setStorageMode
This controls storage mode for supported storage tiers.
-