Class CfnCluster
Creates a new MSK cluster.
Inherited Members
Namespace: Amazon.CDK.AWS.MSK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnCluster : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnCluster
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
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)
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-msk-cluster.html
CloudformationResource: AWS::MSK::Cluster
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.MSK;
var cfnCluster = new CfnCluster(this, "MyCfnCluster", new CfnClusterProps {
BrokerNodeGroupInfo = new BrokerNodeGroupInfoProperty {
ClientSubnets = new [] { "clientSubnets" },
InstanceType = "instanceType",
// the properties below are optional
BrokerAzDistribution = "brokerAzDistribution",
ConnectivityInfo = new ConnectivityInfoProperty {
PublicAccess = new PublicAccessProperty {
Type = "type"
},
VpcConnectivity = new VpcConnectivityProperty {
ClientAuthentication = new VpcConnectivityClientAuthenticationProperty {
Sasl = new VpcConnectivitySaslProperty {
Iam = new VpcConnectivityIamProperty {
Enabled = false
},
Scram = new VpcConnectivityScramProperty {
Enabled = false
}
},
Tls = new VpcConnectivityTlsProperty {
Enabled = false
}
}
}
},
SecurityGroups = new [] { "securityGroups" },
StorageInfo = new StorageInfoProperty {
EbsStorageInfo = new EBSStorageInfoProperty {
ProvisionedThroughput = new ProvisionedThroughputProperty {
Enabled = false,
VolumeThroughput = 123
},
VolumeSize = 123
}
}
},
ClusterName = "clusterName",
KafkaVersion = "kafkaVersion",
NumberOfBrokerNodes = 123,
// the properties below are optional
ClientAuthentication = new ClientAuthenticationProperty {
Sasl = new SaslProperty {
Iam = new IamProperty {
Enabled = false
},
Scram = new ScramProperty {
Enabled = false
}
},
Tls = new TlsProperty {
CertificateAuthorityArnList = new [] { "certificateAuthorityArnList" },
Enabled = false
},
Unauthenticated = new UnauthenticatedProperty {
Enabled = false
}
},
ConfigurationInfo = new ConfigurationInfoProperty {
Arn = "arn",
Revision = 123
},
CurrentVersion = "currentVersion",
EncryptionInfo = new EncryptionInfoProperty {
EncryptionAtRest = new EncryptionAtRestProperty {
DataVolumeKmsKeyId = "dataVolumeKmsKeyId"
},
EncryptionInTransit = new EncryptionInTransitProperty {
ClientBroker = "clientBroker",
InCluster = false
}
},
EnhancedMonitoring = "enhancedMonitoring",
LoggingInfo = new LoggingInfoProperty {
BrokerLogs = new BrokerLogsProperty {
CloudWatchLogs = new CloudWatchLogsProperty {
Enabled = false,
// the properties below are optional
LogGroup = "logGroup"
},
Firehose = new FirehoseProperty {
Enabled = false,
// the properties below are optional
DeliveryStream = "deliveryStream"
},
S3 = new S3Property {
Enabled = false,
// the properties below are optional
Bucket = "bucket",
Prefix = "prefix"
}
}
},
OpenMonitoring = new OpenMonitoringProperty {
Prometheus = new PrometheusProperty {
JmxExporter = new JmxExporterProperty {
EnabledInBroker = false
},
NodeExporter = new NodeExporterProperty {
EnabledInBroker = false
}
}
},
StorageMode = "storageMode",
Tags = new Dictionary<string, string> {
{ "tagsKey", "tags" }
}
});
Synopsis
Constructors
CfnCluster(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnCluster(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnCluster(Construct, String, ICfnClusterProps) |
Properties
AttrArn | |
BrokerNodeGroupInfo | Information about the broker nodes in the cluster. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
ClientAuthentication | VPC connection control settings for brokers. |
ClusterName | The name of the cluster. |
ConfigurationInfo | Represents the configuration that you want MSK to use for the cluster. |
CurrentVersion | The version of the cluster that you want to update. |
EncryptionInfo | Includes all encryption-related information. |
EnhancedMonitoring | Specifies the level of monitoring for the MSK cluster. |
KafkaVersion | The version of Apache Kafka. |
LoggingInfo | Logging Info details. |
NumberOfBrokerNodes | The number of broker nodes in the cluster. |
OpenMonitoring | The settings for open monitoring. |
StorageMode | This controls storage mode for supported storage tiers. |
Tags | Tag Manager which manages the tags for this resource. |
TagsRaw | Create tags when creating the cluster. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnCluster(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnCluster(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnCluster(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnCluster(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnCluster(Construct, String, ICfnClusterProps)
public CfnCluster(Construct scope, string id, ICfnClusterProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnClusterProps
Resource properties.
Properties
AttrArn
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Arn
BrokerNodeGroupInfo
Information about the broker nodes in the cluster.
public virtual object BrokerNodeGroupInfo { get; set; }
Property Value
System.Object
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
ClientAuthentication
VPC connection control settings for brokers.
public virtual object ClientAuthentication { get; set; }
Property Value
System.Object
ClusterName
The name of the cluster.
public virtual string ClusterName { get; set; }
Property Value
System.String
ConfigurationInfo
Represents the configuration that you want MSK to use for the cluster.
public virtual object ConfigurationInfo { get; set; }
Property Value
System.Object
CurrentVersion
The version of the cluster that you want to update.
public virtual string CurrentVersion { get; set; }
Property Value
System.String
EncryptionInfo
Includes all encryption-related information.
public virtual object EncryptionInfo { get; set; }
Property Value
System.Object
EnhancedMonitoring
Specifies the level of monitoring for the MSK cluster.
public virtual string EnhancedMonitoring { get; set; }
Property Value
System.String
KafkaVersion
The version of Apache Kafka.
public virtual string KafkaVersion { get; set; }
Property Value
System.String
LoggingInfo
Logging Info details.
public virtual object LoggingInfo { get; set; }
Property Value
System.Object
NumberOfBrokerNodes
The number of broker nodes in the cluster.
public virtual double NumberOfBrokerNodes { get; set; }
Property Value
System.Double
OpenMonitoring
The settings for open monitoring.
public virtual object OpenMonitoring { get; set; }
Property Value
System.Object
StorageMode
This controls storage mode for supported storage tiers.
public virtual string StorageMode { get; set; }
Property Value
System.String
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
Create tags when creating the cluster.
public virtual IDictionary<string, string> TagsRaw { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>