All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::Memcache::Instance

Last Updated:May 16, 2023

ALIYUN::MEMCACHE::Instance is used to create an ApsaraDB for Memcache (OCS) 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

Type

Required

Editable

Description

Constraint

VpcId

String

No

No

The virtual private cloud (VPC) ID.

None.

Capacity

Integer

No

No

The capacity of the instance.

You must specify one of the Capacity and InstanceClass properties.

Unit: MB.

ResourceGroupId

String

No

No

The ID of the resource group.

None.

BackupPolicy

Map

No

Yes

The backup policy of the instance.

For more information, see BackupPolicy properties.

CouponNo

String

No

No

The coupon code of the instance.

Default value: youhuiquan_promotion_option_id_for_blank.

AutoRenewPeriod

String

No

No

The auto-renewal cycle of the instance.

Valid values:

  • 1

  • 2

  • 3

  • 6

  • 12

Unit: month.

Note

This property must be specified when AutoRenew is set to true.

AutoUseCoupon

String

No

No

Specifies whether to use coupons.

Valid values:

  • true

  • false (default)

ZoneId

String

No

No

The zone ID.

None.

InstanceName

String

No

Yes

The name of the instance.

The name must be 2 to 128 characters in length. The name must start with a letter. The name 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 one of the Capacity and InstanceClass properties.

VpcPasswordFree

Boolean

No

No

Specifies whether to enable the password-free feature for VPC-based accesses to the instance.

None.

VSwitchId

String

No

No

The vSwitch ID.

None.

ChargeType

String

No

No

The billing method of the instance.

Valid values:

  • PrePaid: subscription

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

Period

String

No

No

The subscription duration of the instance.

Valid values:

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 12

  • 24

  • 36

Unit: month.

This property must be specified when ChargeType is set to PrePaid. This property cannot be specified when ChargeType is set to PostPaid.

NetworkType

String

No

No

The network type of the instance.

Valid values:

  • CLASSIC (default)

  • VPC

Password

String

No

No

The password that is used to access the instance.

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

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

Config

String

No

No

The configurations of the instance.

Set the value to a JSON string.

PrivateIpAddress

String

No

No

The private IP address of the instance.

The private IP address of the instance 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

Type

Required

Editable

Description

Constraint

PreferredBackupTime

String

Yes

Yes

The backup window.

Specify the backup window in the HH:mmZ-HH:mmZ format.

EnableBackupLog

Integer

No

Yes

Specifies whether to enable incremental backup.

Valid values:

  • 1: enables incremental backup.

  • 0 (default): disables incremental backup.

PreferredBackupPeriod

String

Yes

Yes

The day of a week on which the system backs up data.

Valid values:

  • Monday

  • Tuesday

  • Wednesday

  • Thursday

  • Friday

  • Saturday

  • Sunday

Return values

Fn::GetAtt

  • InstanceId: the instance ID.

  • InstanceName: the name of the instance.

  • ConnectionDomain: the endpoint that is used to connect to the instance.

  • Port: the port that is used to connect to the instance.

  • QPS: the queries per second (QPS) of the instance.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Description:
  en: 'Alibaba Cloud ROS Sample Template: Create a VPC type memcache instance.'
   
Parameters:
  ZoneId:
    Type: String
    Description:
       
      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
       
  VPC:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description:
       
      en: Please search the ID starts with (vpc-xxx)from console-Virtual Private Cloud
    Label:
       
      en: Existing VPC Instance ID
  VSwitch:
    AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    Type: String
    Description:
       
      en: Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual Private Cloud-VSwitches
    Label:
       
      en: Existing VSwitch ID
    AssociationPropertyMetadata:
      VpcId: VPC
      ZoneId: ZoneId
  InstanceClass:
    Type: String
    Description:
      en: Instance specifications, please refer to the Alibaba Cloud Memcache product website documentation or online consultation.
       
    Default: memcache.master.small.default
    Label:
       
      en: Instance Type
  Password:
    Type: String
    Description:
      en: 'Length 8-32 characters, can contain size letters, Numbers and special symbols, including: !@#$%^&*()_+-='
       
    ConstraintDescription:
      en: '8-32 characters, can contain size letters, Numbers and special symbols, including: !@#$%^&*()_+-='
       
    MaxLength: 32
    MinLength: 8
    NoEcho: true
    Label:
      en: 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: Intranet connection string
    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.",
     
  },
  "Parameters": {
    "ZoneId": {
      "Type": "String",
      "Description": {
         
        "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",
         
      }
    },
    "VPC": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
         
        "en": "Please search the ID starts with (vpc-xxx)from console-Virtual Private Cloud"
      },
      "Label": {
         
        "en": "Existing VPC Instance ID"
      }
    },
    "VSwitch": {
      "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
      "Type": "String",
      "Description": {
         
        "en": "Please search the business VSwitch ID starts with(vsw-xxx)from console-Virtual Private Cloud-VSwitches"
      },
      "Label": {
         
        "en": "Existing VSwitch ID"
      },
      "AssociationPropertyMetadata": {
        "VpcId": "VPC",
        "ZoneId": "ZoneId"
      }
    },
    "InstanceClass": {
      "Type": "String",
      "Description": {
        "en": "Instance specifications, please refer to the Alibaba Cloud Memcache product website documentation or online consultation.",
         
      },
      "Default": "memcache.master.small.default",
      "Label": {
         
        "en": "Instance Type"
      }
    },
    "Password": {
      "Type": "String",
      "Description": {
        "en": "Length 8-32 characters, can contain size letters, Numbers and special symbols, including: !@#$%^&*()_+-=",
         
      },
      "ConstraintDescription": {
        "en": "8-32 characters, can contain size letters, Numbers and special symbols, including: !@#$%^&*()_+-=",
         
      },
      "MaxLength": 32,
      "MinLength": 8,
      "NoEcho": true,
      "Label": {
        "en": "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": "Intranet connection string",
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "ConnectionDomain"
        ]
      }
    },
    "InstanceId": {
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "InstanceId"
        ]
      }
    },
    "QPS": {
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "QPS"
        ]
      }
    },
    "Port": {
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "Port"
        ]
      }
    }
  }
}