ALIYUN::KAFKA::Instance is used to create a Message Queue for Apache 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
  }
}

Properties

PropertyTypeRequiredEditableDescriptionConstraint
DeployTypeIntegerYesNoThe network in which you deploy the instance. Valid values:
  • 4: Internet and virtual private cloud (VPC)
  • 5: VPC
DiskTypeStringYesNoThe category of the disk. Valid values:
  • 0: ultra disk
  • 1: SSD
DeployOptionMapNoNoThe details of deployment options. For more information, see DeployOption properties.
EipMaxIntegerNoNoThe Internet traffic. This property is required when you set the DeployType property to 4.

Valid values: 1 to 160.

SpecTypeStringNoYesThe edition of the instance. Valid values:
  • normal: Standard Edition (High Write)
  • professional: Professional Edition (High Write)
  • professionalForHighRead: Professional Edition (High Read)
IoMaxIntegerNoYesThe peak traffic. You must specify the IoMax or IoMaxSpec property. If you specify both the properties, the value of the IoMaxSpec property takes precedence over the value of the IoMax property. We recommend that you specify only the IoMaxSpec property.

For more information about the valid values, see Billing.

IoMaxSpecStringNoYesThe traffic specification. You must specify the IoMax or IoMaxSpec property. If you specify both the properties, the value of the IoMaxSpec property takes precedence over the value of the IoMax property. We recommend that you specify only the IoMaxSpec property.

For more information about the valid values, see Billing.

DiskSizeIntegerYesYesThe size of the disk. Valid values: 500 to 96000.

Unit: GB.

TopicQuotaIntegerYesYesThe number of topics. Valid values: 50 to 79.
PayTypeStringNoNoThe billing cycle of the instance. Valid values:
  • Hour
  • Month
TagsListNoYesThe tags of the instance. You can add up to 20 tags.

For more information, see Tags properties.

DeletionForceBooleanNoYesSpecifies whether to force delete the instance. Default value: false. Valid values:
  • true: force deletes the instance.
  • false: does not force delete the instance.
OpenConnectorBooleanNoNoSpecifies whether to enable the connector. Default value: false. Valid values:
  • true: enables the connector.
  • false: disables the connector.
Note For more information about connectors, see Overview.

Tags syntax

"Tags": [
  {
    "Key": String,
    "Value": String
  }
]  

Tags properties

PropertyTypeRequiredEditableDescriptionConstraint
KeyStringYesNoThe key of the tag. The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.
ValueStringNoNoThe value of the tag. The tag value must be 0 to 128 characters in length, and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

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
}

DeployOption properties

PropertyTypeRequiredEditableDescriptionConstraint
IsEipInnerBooleanNoNoSpecifies whether the instance supports elastic IP addresses (EIPs). Default value: false. Valid values:
  • true: The instance supports EIPs.
  • false: The instance does not support EIPs.

You must specify the value of this property based on the instance type. If you use an Internet- and VPC-connected instance, set the IsEipInner property to true. If you use a VPC-connected instance, set the IsEipInner property to false.

DeployModuleStringYesNoThe deployment mode. Valid values:
  • vpc: VPC
  • eip: Internet and VPC
VpcIdStringNoNoThe ID of the VPC in which you deploy the instance. None.
ZoneIdStringNoNoThe ID of the zone in which you deploy the instance. None.
VSwitchIdStringYesNoThe ID of the vSwitch in which you deploy the instance. None.
SecurityGroupStringNoNoThe security group of the instance. If you do not specify this property, Message Queue for Apache Kafka automatically configures a security group for the instance.
NameStringNoNoThe name of the instance. None.
IsSetUserAndPasswordBooleanNoNoSpecifies whether to configure a new username and password. Only Internet- and VPC-connected instances are supported. Default value: false. Valid values:
  • true: configures a new username and password.
  • false: does not configure a new username or password.
UsernameStringNoNoThe 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.

PasswordStringNoNoThe password.

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.

ServiceVersionStringNoNoThe version of the Message Queue for Apache Kafka service that you deploy. Valid values:
  • 0.10.2
  • 2.2.0
ConfigMapNoNoThe initial configurations of the Message Queue for Apache Kafka service that you deploy. The value must be a valid JSON string. Valid values:
  • enable.vpc_sasl_ssl: specifies whether to enable VPC transmission encryption. Default value: false. Valid values:
    • true: enables VPC transmission encryption. If you enable VPC transmission encryption, you must also enable the access control list (ACL) feature.
    • false: disables VPC transmission encryption.
  • enable.acl: specifies whether to enable the ACL feature. Default value: false. Valid values:
    • true: enables the ACL feature.
    • false: disables the ACL feature.
  • kafka.log.retention.hours: the maximum retention period of messages when the disk capacity is sufficient.

    Valid values: 24 to 480.

    Default value: 72.

    Unit: hours.

    Note When the disk usage reaches 85%, the system considers that the disk capacity is insufficient. In this case, the system deletes messages in the order in which the messages are stored, from the earliest to the latest. This ensures service availability.
  • kafka.message.max.bytes: the maximum size of messages that Message Queue for Apache Kafka can send and receive.

    Valid values: 1048576 to 10485760.

    Default value: 1048576.

    Unit: byte.

    Note Before you modify the maximum message size, make sure that the new value matches the configurations on the producer and consumer.

Return values

Fn::GetAtt

  • InstanceId: the ID of the instance.
  • OrderId: the ID of the order.
  • name: the name of the instance.

Examples

  • YAMLformat

    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
  • JSONformat

    {
      "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"
            ]
          }
        }
      }
    }

To view more examples, visit Instance.json and Instance.yml. In the examples, the ALIYUN::KAFKA::Instance and ALIYUN::KAFKA::Topic resource types are used.