StartInstance - Deploy an instance

更新时间: 2026-05-15 19:28:25

Before you can use an ApsaraMQ for Kafka instance to send and receive messages, you must purchase and deploy it.

API

Note

The rate limit for this operation is 2 queries per second (QPS) per user.

Debugging

You can call this operation directly in OpenAPI Explorer. OpenAPI Explorer simplifies the process by automatically calculating signatures and generating SDK code examples.

Authorization

The following table describes the authorization information for this operation. You can add the action in the Action element of a RAM policy statement to grant a RAM user or RAM role permissions to call this operation.

  • Operation: The specific permission.

  • Access level: The access level of the operation. Valid values: Write, Read, and List.

  • Resource type: The resource type that the operation supports. The following rules apply:

    • Required resource types are highlighted.

    • For operations that do not support resource-level authorization, the value is All resources.

  • Condition key: The condition keys that the cloud service defines.

  • Associated operation: Other permissions required for the operation to succeed. To ensure this operation succeeds, you must also grant the permissions for the associated operations.

Actions

Access level

Resource type

Condition key

Associated operation

alikafka:StartInstance

Write

All resources

*

  • alikafka:DeployModule

  • alikafka:SpecType

  • alikafka:Acl

  • alikafka:DiskEncryption

None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The ID of the instance.

alikafka_post-cn-v0h1fgs2****

RegionId

string

Yes

The ID of the region where the instance is deployed.

cn-hangzhou

VpcId

string

Yes

The ID of the virtual private cloud (VPC) in which the instance is deployed.

vpc-bp1r4eg3yrxmygv****

VSwitchId

string

Yes

The ID of the vSwitch to which the instance is deployed.

vsw-bp1j3sg5979fstnpl****

DeployModule

string

Yes

The deployment mode of the instance. This parameter is required for reserved instances but is optional for serverless instances and ApsaraMQ for Confluent instances. Valid values:

  • vpc: The instance is a VPC-only instance.

  • eip: The instance is an Internet and VPC instance.

The deployment mode must be consistent with the instance type. For a VPC-only instance, set this parameter to vpc. For an Internet and VPC instance, set this parameter to eip.

vpc

ZoneId

string

No

The ID of the zone in which the instance is deployed.

  • The zone must be the same as the zone of the vSwitch.

  • The value can be in the zoneX or RegionId-X format. For example, you can set the value to zonea or cn-hangzhou-k.

Note

If resources in the specified zone are insufficient, the instance may be deployed in another zone.

cn-hangzhou-k

IsEipInner

boolean

No

Specifies whether to enable access over the internet. Valid values:

  • true: The instance is an Internet and VPC instance.

  • false: The instance is a VPC-only instance.

The value of this parameter must be consistent with the instance type. For example, if the instance is a VPC-only instance, you must set this parameter to false.

false

IsSetUserAndPassword

boolean

No

Specifies whether to set a new username and password. Valid values:

  • true: sets a new username and password.

  • false: does not set a new username and password.

This parameter is applicable only to Internet and VPC instances.

false

Username

string

No

The username.

  • This parameter applies only to reserved and serverless instances that are configured for Internet and VPC access.

  • For ApsaraMQ for Confluent instances, you can set this parameter only to root or leave it empty.

Default value: username for reserved instances and serverless instances, and root for ApsaraMQ for Confluent instances.

username

Password

string

No

The password.

  • This parameter is applicable only to reserved and serverless instances that are configured for Internet and VPC access.

  • For ApsaraMQ for Confluent instances, this parameter is required. The password must be 8 to 32 characters long and contain characters from at least three of the following types: uppercase letters, lowercase letters, digits, and special characters. The special characters are !@#$%^&*()_+-=.

password

Name

string

No

The name of the instance.

Note

The instance name must be unique within the region.

newInstanceName

CrossZone

boolean

No

Specifies whether to deploy the instance across zones.

  • true: The instance is deployed across zones.

  • false: The instance is not deployed across zones.

Default value: true.

false

SecurityGroup

string

No

The ID of the security group for the instance.

If you do not specify this parameter, ApsaraMQ for Kafka automatically configures a security group for your instance. To specify a security group, you must first create one. For more information, see Create a security group.

sg-bp13wfx7kz9pko****

ServiceVersion

string

No

The version of the ApsaraMQ for Kafka instance to be deployed.

  • For a reserved instance, you can set the value to 2.2.0 or 2.6.2.

  • For a serverless instance, you can set the value to 3.3.1.

  • For an ApsaraMQ for Confluent instance, you can set the value to 7.4.0.

Default values:

  • reserved instance: 2.2.0

  • serverless instance: 3.3.1

  • ApsaraMQ for Confluent instance: 7.4.0

reserved instance: 2.2.0 serverless instance: 3.3.1 ApsaraMQ for Confluent instance: 7.4.0

Config

string

No

The initial configurations for the ApsaraMQ for Kafka instance. The configurations must be a valid JSON string. If you omit this parameter, no initial configurations are set.

Note
  • You cannot specify the Config parameter when you deploy an ApsaraMQ for Confluent instance.

  • The enable.acl configuration is not supported for instance versions earlier than 2.2.0. You can enable ACL only for Professional Edition instances and serverless instances.

The Config parameter supports the following configurations:

  • enable.vpc_sasl_ssl: Specifies whether to enable VPC transmission encryption. Valid values:

    • true: enables VPC transmission encryption. If you enable this feature, you must also enable ACL.

    • false: disables VPC transmission encryption. This is the default value.

  • enable.acl: Specifies whether to enable ACL. Valid values:

    • true: enables ACL.

    • false: disables ACL. This is the default value.

  • kafka.log.retention.hours: The maximum retention period of messages if disk capacity is sufficient. Unit: hours. The value must be an integer from 24 to 480. Default value: 72. If disk capacity is insufficient (disk usage reaches 85%), older messages are deleted early to ensure service availability.

  • kafka.message.max.bytes: The maximum size of messages that ApsaraMQ for Kafka can send and receive. Unit: bytes. The value must be an integer from 1,048,576 to 10,485,760. Default value: 1048576. Before you change this configuration, ensure that the new value is compatible with the corresponding configurations on your producer and consumer clients.

{"kafka.log.retention.hours":"33"}

KMSKeyId

string

No

The ID of a key for cloud disk encryption in the same region. You can view the key ID in the Key Management Service (KMS) console or create a new key. For more information, see Create a CMK.

If you specify this parameter, cloud disk encryption is enabled for the instance. This setting cannot be changed after deployment. When you call this operation, the system checks if the AliyunServiceRoleForAlikafkaInstanceEncryption service-linked role exists. If not, the system automatically creates it. For more information, see Service-linked roles for ApsaraMQ for Kafka.

Note

You cannot specify a KMSKeyId when you deploy a serverless instance.

0d24xxxx-da7b-4786-b981-9a164dxxxxxx

Notifier

string

No

The alert contact.

Mr. Wang

UserPhoneNum

string

No

The mobile phone number of the alert contact.

1581234****

SelectedZones

string

No

A two-dimensional array that specifies the candidate primary and secondary zones for deployment. Both custom codes (for example, zone{zone}) and standard codes (for example, cn-RegionID-{zone}) are supported.

  • If you want to deploy the instance across zones (isCrossZone=true), and the candidate primary zones are Zone H and Zone F and the candidate secondary zone is Zone K, you can set this parameter to [[\"zoneh\",\"zonef\"],[\"zonek\"]].

    Note

    If you specify multiple zones for the primary or secondary zone, a zone is selected from the provided list at random. For example, if you set the parameter to [[\"zoneh\",\"zonef\"],[\"zonek\"]], the final primary zone is Zone H or Zone F, and the secondary zone is Zone K.

  • If you do not want to deploy the instance across zones (isCrossZone=false) and want to deploy the instance in Zone K, you can set this parameter to [[\"zonek\"],[]]. You must still pass two arrays, but the second array for the secondary zone candidate can be empty [].

[[\"zonel\"],[\"zonek\"]]

IsForceSelectedZones

boolean

No

Specifies whether to force deployment in the selected zones.

false

VSwitchIds

array

No

A list of vSwitch IDs for instance deployment. This parameter is required for reserved instances and serverless instances. ApsaraMQ for Confluent instances also support this parameter. For ApsaraMQ for Confluent instances, you must specify at least one of VSwitchIds and VSwitchId. If you specify both, VSwitchIds takes precedence.

string

No

The ID of the vSwitch.

["vsw-bp1j3sg5979fstnpl****", "vsw-2ze8rwvzn7yi3r88****"]

Response parameters

Parameter

Type

Description

Example

object

Code

integer

The response code. A value of 200 indicates that the request was successful.

200

Message

string

The response message.

operation success.

RequestId

string

The ID of the request.

ABA4A7FD-E10F-45C7-9774-A5236015****

Success

boolean

Indicates whether the call was successful.

true

Examples

Sample success response

JSON format

{
  "Code": 200,
  "Message": "operation success.",
  "RequestId": "ABA4A7FD-E10F-45C7-9774-A5236015****",
  "Success": true
}

Error codes

For a list of common error codes, see Common error codes.

Change history

Date

Change summary

Actions

August 15, 2024

Updated the API description.

View change details

February 27, 2024

Changed the request parameters.

View change details

October 9, 2023

Changed the request parameters.

View change details

上一篇: CreatePrePayOrder 下一篇: ModifyInstanceName
阿里云首页 云消息队列 Kafka 版 相关技术圈