ALIYUN::KAFKA::Instance is used to create an ApsaraMQ for Kafka instance.
Syntax
{
"Type": "ALIYUN::KAFKA::Instance",
"Properties": {
"DeployType": Integer,
"DiskType": String,
"DeployOption": Map,
"EipMax": Integer,
"SpecType": String,
"IoMax": Integer,
"IoMaxSpec": String,
"DiskSize": Integer,
"TopicQuota": Integer,
"PayType": String,
"Tags": List,
"DeletionForce": Boolean,
"OpenConnector": Boolean,
"PartitionNum": Integer,
"ServerlessConfig": Map
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
DeployType | Integer | Yes | No | The deployment type. | Valid values:
|
DiskType | String | No | No | The category of the disk. | Valid values:
|
DeployOption | Map | No | No | Details of the deployment options. | For more information, see DeployOption properties. |
EipMax | Integer | No | Yes | The Internet traffic. | You must specify this property when DeployType is set to 4. Valid values: 1 to 160. |
SpecType | String | No | Yes | The edition. | Valid values:
|
IoMax | Integer | No | Yes | The peak traffic. | You must specify one of the IoMax and IoMaxSpec properties. If you specify both the properties, the IoMaxSpec property takes precedence. We recommend that you specify only the IoMaxSpec property. For more information, see Billing overview. |
IoMaxSpec | String | No | Yes | The traffic specification. | You must specify one of the IoMax and IoMaxSpec properties. If you specify both the properties, the IoMaxSpec property takes precedence. We recommend that you specify only the IoMaxSpec property. For more information, see Billing overview. |
DiskSize | Integer | No | Yes | The disk size. | Valid values: 500 to 96000. Unit: GB. |
TopicQuota | Integer | No | Yes | The number of topics. | Valid values: 50 to 79. |
PayType | String | No | No | The billing method. | Valid values:
|
Tags | List | No | Yes | The tags. | You can add up to 20 tags. For more information, see Tags properties. |
DeletionForce | Boolean | No | Yes | Specifies whether to forcefully delete the instance. | Valid values:
|
OpenConnector | Boolean | No | No | Specifies whether to enable the connector feature. | Valid values:
Note For more information about connectors, see Overview. |
PartitionNum | Integer | No | Yes | The number of partitions. | The following rules apply:
For more information, see Billing overview. |
ServerlessConfig | Map | No | No | The parameters of the serverless instance. | You must specify this property when you create a serverless ApsaraMQ for Kafka V3 instance. For more information, see the "ServerlessConfig properties" section of this topic. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags properties
Property | Type | Required | Editable | Description | Constraint |
Key | String | Yes | No | The tag key. | The tag key must be 1 to 128 characters in length, and cannot contain |
Value | String | No | No | The tag value. | The tag value can be up to 128 characters in length, and cannot contain |
DeployOption syntax
"DeployOption": {
"IsEipInner": Boolean,
"VpcId": String,
"ZoneId": String,
"VSwitchId": String,
"SecurityGroup": String,
"DeployModule": String,
"Name": String,
"IsSetUserAndPassword": Boolean,
"Username": String,
"Password": String,
"ServiceVersion": String,
"Config": Map,
"Notifier": String,
"CrossZone": Boolean,
"UserPhoneNum": String,
"SelectedZones": List,
"VSwitchIds": List,
"KMSKeyId": String,
"IsForceSelectedZones": Boolean
}
DeployOption properties
Property | Type | Required | Editable | Description | Constraint |
IsEipInner | Boolean | No | No | Specifies whether the instance supports elastic IP addresses (EIPs). | Valid values:
The value of this property must match the type of the instance. The valid value for an Internet- and VPC-connected instance is true. The valid value for a VPC-connected instance is false. |
DeployModule | String | Yes | No | The deployment mode. | Valid values:
|
VpcId | String | No | No | The ID of the VPC in which you want to deploy the instance. | None. |
ZoneId | String | No | No | The ID of the zone in which you want to deploy the instance. | None. |
VSwitchId | String | Yes | No | The ID of the vSwitch to which the instance you want to deploy is connected. | None. |
SecurityGroup | String | No | No | The security group to which the instance belongs. | If you leave this property empty, ApsaraMQ for Kafka automatically configures a security group for the instance. |
Name | String | No | No | The instance name. | None. |
IsSetUserAndPassword | Boolean | No | No | Specifies whether to configure a new username and password. | Only Internet- and VPC-connected instances are supported. Valid values:
|
Username | String | No | No | The username. | Only Internet- and VPC-connected instances are supported. The username must be 8 to 40 characters in length, and can contain letters and digits. |
Password | String | No | No | The password that corresponds to the username. | Only Internet- and VPC-connected instances are supported. The password must be 8 to 40 characters in length, and must contain lowercase letters, uppercase letters, and digits. |
ServiceVersion | String | No | No | The version of the instance that you want to deploy. | Valid values:
|
Config | Map | No | No | The initial configurations of the instance that you want to deploy. | The value must be a valid JSON string. The value of this property includes the following fields:
|
Notifier | String | No | No | The alert contact. | None. |
CrossZone | Boolean | No | No | Specifies whether to deploy the instance across zones. | Valid values:
Default value: true. |
UserPhoneNum | String | No | No | The mobile phone number of the alert contact. | None. |
SelectedZones | List | No | No | The two-dimensional arrays that consist of the candidate set for primary zones and the candidate set for secondary zones. | Custom code in the
|
VSwitchIds | List | No | No | The IDs of the vSwitches to which the instance you want to deploy is connected. | You must specify this property for an ApsaraMQ for Kafka V2 or V3 instance. You must specify one of the VSwitchIds and VSwitchId properties for an ApsaraMQ for Confluent instance. If you specify both the properties for an ApsaraMQ for Confluent instance, the VSwitchIds property takes precedence. |
KMSKeyId | String | No | No | The ID of the key used for cloud disk encryption in the region where the instance resides. | You can obtain the ID of the key from the Key Management Service (KMS) console. You can also create a key. For more information, see Create a CMK. If you specify this property, encryption is enabled for the instance and cannot be disabled. When you use ALIYUN::KAFKA::Instance, the system checks whether the service-linked role AliyunServiceRoleForAlikafkaInstanceEncryption is created. If the service-linked role is not created, the system automatically creates the role. For more information, see Service-linked roles. |
IsForceSelectedZones | Boolean | No | No | Specifies whether to forcefully deploy the instance in the selected zones. | None. |
ServerlessConfig syntax
"ServerlessConfig": {
"ReservedPublishCapacity": Integer,
"ReservedSubscribeCapacity": Integer
}
ServerlessConfig properties
Property | Type | Required | Editable | Description | Constraint |
ReservedPublishCapacity | Integer | Yes | No | The traffic reserved for message publishing. | The value must be an integer. Minimum value: 60. |
ReservedSubscribeCapacity | Integer | Yes | No | The traffic reserved for message subscription. | The value must be an integer. Minimum value: 20. |
Return values
Fn::GetAtt
InstanceId: the instance ID.
OrderId: the order ID.
name: the instance name.
SslEndpoint: the SSL endpoint in the IP address format.
SaslDomainEndpoint: the Simple Authentication and Security Layer (SASL) endpoint in the domain name format.
SslDomainEndpoint: the SSL endpoint in the domain name format.
DomainEndpoint: the default endpoint in the domain name format.
Endpoint: the default endpoint in the IP address format.
Examples
YAML
format
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
VpcId:
Type: String
AssociationProperty: ALIYUN::ECS::VPC::VPCId
ZoneId:
Type: String
AssociationProperty: ALIYUN::ECS::ZoneId
VSwitchId:
Type: String
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VpcId}
ZoneId: ${ZoneId}
SecurityGroupId:
Type: String
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
VpcId: ${VpcId}
Resources:
Instance:
Type: ALIYUN::KAFKA::Instance
Properties:
DeployType: 5
SpecType: normal
PayType: Hour
DiskType: '1'
DeployOption:
VpcId:
Ref: VpcId
ZoneId:
Ref: ZoneId
VSwitchId:
Ref: VSwitchId
SecurityGroup:
Ref: SecurityGroupId
DeployModule: vpc
ServiceVersion: 0.10.2
Config:
kafka.log.retention.hours: '33'
DeletionForce: 'false'
DiskSize: 500
TopicQuota: 50
OpenConnector: 'false'
IoMaxSpec: alikafka.hw.2xlarge
Outputs:
InstanceId:
Description: 'Id of the instance. '
Value:
Fn::GetAtt:
- Instance
- InstanceId
OrderId:
Description: 'Id of the order. '
Value:
Fn::GetAtt:
- Instance
- OrderId
Name:
Description: Name of the instance.
Value:
Fn::GetAtt:
- Instance
- Name
JSON
format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"VpcId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
},
"ZoneId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::ZoneId"
},
"VSwitchId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}",
"ZoneId": "${ZoneId}"
}
},
"SecurityGroupId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}"
}
}
},
"Resources": {
"Instance": {
"Type": "ALIYUN::KAFKA::Instance",
"Properties": {
"DeployType": 5,
"SpecType": "normal",
"PayType": "Hour",
"DiskType": "1",
"DeployOption": {
"VpcId": {
"Ref": "VpcId"
},
"ZoneId": {
"Ref": "ZoneId"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"SecurityGroup": {
"Ref": "SecurityGroupId"
},
"DeployModule": "vpc",
"ServiceVersion": "0.10.2",
"Config": {
"kafka.log.retention.hours": "33"
}
},
"DeletionForce": "false",
"DiskSize": 500,
"TopicQuota": 50,
"OpenConnector": "false",
"IoMaxSpec": "alikafka.hw.2xlarge"
}
}
},
"Outputs": {
"InstanceId": {
"Description": "Id of the instance. ",
"Value": {
"Fn::GetAtt": [
"Instance",
"InstanceId"
]
}
},
"OrderId": {
"Description": "Id of the order. ",
"Value": {
"Fn::GetAtt": [
"Instance",
"OrderId"
]
}
},
"Name": {
"Description": "Name of the instance.",
"Value": {
"Fn::GetAtt": [
"Instance",
"Name"
]
}
}
}
}
For more examples, visit instance.yml. In the examples, the ALIYUN::KAFKA::Instance and ALIYUN::KAFKA::Topic resource types are used.