All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::Memcache::Instance

Last Updated:Jun 16, 2026

Creates a Memcache instance.

Syntax

{
  "Type": "ALIYUN::Memcache::Instance",
  "Properties": {
    "VpcId": String,
    "Capacity": Integer,
    "ResourceGroupId": String,
    "BackupPolicy": Map,
    "CouponNo": String,
    "AutoRenewPeriod": String,
    "AutoUseCoupon": String,
    "ZoneId": String,
    "InstanceName": String,
    "AutoRenew": String,
    "InstanceClass": String,
    "VpcPasswordFree": Boolean,
    "VSwitchId": String,
    "ChargeType": String,
    "Period": String,
    "NetworkType": String,
    "Password": String,
    "Config": String,
    "PrivateIpAddress": String
  }
}

Properties

Property Name

Type

Required

Update allowed

Description

Constraints

VpcId

String

No

No

The ID of the virtual private cloud (VPC).

None

Capacity

Integer

No

No

The capacity of the instance.

You must specify either the Capacity or InstanceClass property. For more information, see Instance types.

Unit: MB.

ResourceGroupId

String

No

No

The ID of the resource group.

None

BackupPolicy

Map

No

Yes

The backup policy.

For more information, see BackupPolicy properties.

CouponNo

String

No

No

The coupon code.

The default value is youhuiquan_promotion_option_id_for_blank.

AutoRenewPeriod

String

No

No

The auto-renewal cycle.

Valid values:

  • 1

  • 2

  • 3

  • 6

  • 12

Unit: months.

Note

This parameter is required when AutoRenew is set to true.

AutoUseCoupon

String

No

No

Specifies whether to use a coupon.

Valid values:

  • true

  • false (default)

ZoneId

String

No

No

The ID of the zone.

None

InstanceName

String

No

Yes

The name of the instance.

The name must be 2 to 128 characters in length. It must start with a letter. It cannot contain spaces or the following special characters:

@/:=”<>{[]}

AutoRenew

String

No

No

Specifies whether to enable auto-renewal.

Valid values:

  • true

  • false (default)

InstanceClass

String

No

No

The instance type.

You must specify either the Capacity or InstanceClass property. For more information, see Instance types.

VpcPasswordFree

Boolean

No

No

Specifies whether to enable passwordless access to the instance in a VPC.

None

VSwitchId

String

No

No

The ID of the vSwitch.

None

ChargeType

String

No

No

The billing method.

Valid values:

  • PrePaid: subscription.

  • PostPaid (default): pay-as-you-go.

Period

String

No

No

The billing cycle.

Valid values:

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 12

  • 24

  • 36

Unit: months.

This parameter is required when ChargeType is set to PrePaid. This parameter is not supported when ChargeType is set to PostPaid.

NetworkType

String

No

No

The network type.

Valid values:

  • CLASSIC (default): classic network.

  • Virtual Private Cloud (VPC).

Password

String

No

No

The password of the instance.

The password must be 8 to 32 characters in length. It must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. The supported special characters are:

!@#$%^&*()_+-=

Config

String

No

No

The detailed configuration of the instance.

The value is a JSON-formatted string.

PrivateIpAddress

String

No

No

The private IP address of the instance.

The private IP address must be within the CIDR block of the vSwitch to which the instance belongs.

BackupPolicy syntax

"BackupPolicy": {
  "PreferredBackupTime": String,
  "EnableBackupLog": Integer,
  "PreferredBackupPeriod": String
}

BackupPolicy properties

Property Name

Type

Required

Update allowed

Description

Constraints

PreferredBackupTime

String

Yes

Yes

The backup time window.

Format: HH:mmZ-HH:mmZ.

EnableBackupLog

Integer

No

Yes

Specifies whether to enable incremental backup.

Valid values:

  • 1: enabled.

  • 0 (default): disabled.

PreferredBackupPeriod

String

Yes

Yes

The backup cycle.

Valid values:

  • Monday

  • Tuesday

  • Wednesday

  • Thursday

  • Friday

  • Saturday

  • Sunday

Return value

Fn::GetAtt

  • InstanceId: The ID of the instance.

  • InstanceName: The name of the instance.

  • ConnectionDomain: The endpoint of the instance.

  • Port: The port of the instance.

  • QPS: The number of queries per second (QPS).

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Description:
  en: 'Alibaba Cloud ROS Sample Template: Create a VPC type memcache instance.'
  zh-cn: 'Alibaba Cloud Resource Orchestration Service sample template: Create a VPC-type Memcache instance.'
Parameters:
  ZoneId:
    Type: String
    Description:
      zh-cn: The zone where you want to create the instance. Make sure that the zone supports the creation of Memcache instances.
      en: Create an Availability Zone for an instance to ensure that the Availability Zone supports the creation of Memcache resource specifications.
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    Label:
      en: Zone ID
      zh-cn: Zone
  VPC:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description:
      zh-cn: The ID of an existing VPC. You can find the ID in the VPC console.
      en: Please search the ID starts with (vpc-xxx)from console-Virtual Private Cloud
    Label:
      zh-cn: Existing VPC Instance ID
      en: Existing VPC Instance ID
  VSwitch:
    AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    Type: String
    Description:
      zh-cn: The ID of an existing vSwitch. You can find the ID in the VPC console under VSwitches.
      en: Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual Private Cloud-VSwitches
    Label:
      zh-cn: vSwitch ID
      en: Existing VSwitch ID
    AssociationPropertyMetadata:
      VpcId: VPC
      ZoneId: ZoneId
  InstanceClass:
    Type: String
    Description:
      en: Instance specifications
      zh-cn: Instance Type
    Default: memcache.master.small.default
    Label:
      zh-cn: Instance Type
      en: Instance Type
  Password:
    Type: String
    Description:
      en: 'Length 8~32 characters, can contain size letters, Numbers and special symbols, including the following: !@#$%^&*()_+-='
      zh-cn: 'The password must be 8 to 32 characters in length and can contain uppercase letters, lowercase letters, digits, and special characters, including the following: !@#$%^&*()_+-='
    ConstraintDescription:
      en: '8~32 characters, can contain size letters, Numbers and special symbols, including the following: !@#$%^&*()_+-='
      zh-cn: '8 to 32 characters. It can contain uppercase letters, lowercase letters, digits, and special characters, including the following: !@#$%^&*()_+-='
    MaxLength: 32
    MinLength: 8
    NoEcho: true
    Label:
      en: Instance Password
      zh-cn: Instance Password
Resources:
  MemcacheInstance:
    Type: ALIYUN::Memcache::Instance
    Properties:
      VpcId:
        Ref: VPC
      VSwitchId:
        Ref: VSwitch
      InstanceClass:
        Ref: InstanceClass
      NetworkType: VPC
      Password:
        Ref: Password
      ZoneId:
        Ref: ZoneId
Outputs:
  ConnectionDomain:
    Description: The internal endpoint.
    Value:
      Fn::GetAtt:
        - MemcacheInstance
        - ConnectionDomain
  InstanceId:
    Value:
      Fn::GetAtt:
        - MemcacheInstance
        - InstanceId
  QPS:
    Value:
      Fn::GetAtt:
        - MemcacheInstance
        - QPS
  Port:
    Value:
      Fn::GetAtt:
        - MemcacheInstance
        - Port

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "en": "Alibaba Cloud ROS Sample Template: Create a VPC type memcache instance.",
    "zh-cn": "Alibaba Cloud Resource Orchestration Service sample template: Create a VPC-type Memcache instance."
  },
  "Parameters": {
    "ZoneId": {
      "Type": "String",
      "Description": {
        "zh-cn": "The zone where you want to create the instance. Make sure that the zone supports the creation of Memcache instances.",
        "en": "Create an Availability Zone for an instance to ensure that the Availability Zone supports the creation of Memcache resource specifications."
      },
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "Label": {
        "en": "Zone ID",
        "zh-cn": "Zone"
      }
    },
    "VPC": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "zh-cn": "The ID of an existing VPC. You can find the ID in the VPC console.",
        "en": "Please search the ID starts with (vpc-xxx)from console-Virtual Private Cloud"
      },
      "Label": {
        "zh-cn": "Existing VPC Instance ID",
        "en": "Existing VPC Instance ID"
      }
    },
    "VSwitch": {
      "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
      "Type": "String",
      "Description": {
        "zh-cn": "The ID of an existing vSwitch. You can find the ID in the VPC console under VSwitches.",
        "en": "Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual Private Cloud-VSwitches"
      },
      "Label": {
        "zh-cn": "vSwitch ID",
        "en": "Existing VSwitch ID"
      },
      "AssociationPropertyMetadata": {
        "VpcId": "VPC",
        "ZoneId": "ZoneId"
      }
    },
    "InstanceClass": {
      "Type": "String",
      "Description": {
        "en": "Instance specifications",
        "zh-cn": "Instance Type"
      },
      "Default": "memcache.master.small.default",
      "Label": {
        "zh-cn": "Instance Type",
        "en": "Instance Type"
      }
    },
    "Password": {
      "Type": "String",
      "Description": {
        "en": "Length 8~32 characters, can contain size letters, Numbers and special symbols, including the following: !@#$%^&*()_+-=",
        "zh-cn": "The password must be 8 to 32 characters in length and can contain uppercase letters, lowercase letters, digits, and special characters, including the following: !@#$%^&*()_+-="
      },
      "ConstraintDescription": {
        "en": "8~32 characters, can contain size letters, Numbers and special symbols, including the following: !@#$%^&*()_+-=",
        "zh-cn": "8 to 32 characters. It can contain uppercase letters, lowercase letters, digits, and special characters, including the following: !@#$%^&*()_+-="
      },
      "MaxLength": 32,
      "MinLength": 8,
      "NoEcho": true,
      "Label": {
        "en": "Instance Password",
        "zh-cn": "Instance Password"
      }
    }
  },
  "Resources": {
    "MemcacheInstance": {
      "Type": "ALIYUN::Memcache::Instance",
      "Properties": {
        "VpcId": {
          "Ref": "VPC"
        },
        "VSwitchId": {
          "Ref": "VSwitch"
        },
        "InstanceClass": {
          "Ref": "InstanceClass"
        },
        "NetworkType": "VPC",
        "Password": {
          "Ref": "Password"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        }
      }
    }
  },
  "Outputs": {
    "ConnectionDomain": {
      "Description": "The internal endpoint.",
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "ConnectionDomain"
        ]
      }
    },
    "InstanceId": {
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "InstanceId"
        ]
      }
    },
    "QPS": {
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "QPS"
        ]
      }
    },
    "Port": {
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "Port"
        ]
      }
    }
  }
}