ALIYUN::MEMCACHE::Instance is used to create an ApsaraDB for 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 Type Required Editable Description Constraint
VpcId String No No The ID of the VPC. None
Capacity Integer No No The capacity of the instance. You must specify at least one of the Capacity and InstanceClass parameters.

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. Default value: youhuiquan_promotion_option_id_for_blank.
AutoRenewPeriod String No No The auto-renewal period for the instance. Valid values:
  • 1
  • 2
  • 3
  • 6
  • 12

Unit: months.

Note This parameter is required when the AutoRenew parameter is set to true.
AutoUseCoupon String No No Specifies whether to use coupons. Default value: false. Valid values:
  • true
  • false
ZoneId String No No The zone ID of the instance. None
InstanceName String No Yes The name of the instance. The name must be 2 to 128 characters in length and cannot contain spaces or the following special characters:
@ / : = ” < > { [ ] }
It must start with a letter.
AutoRenew String No No Specifies whether to enable auto-renewal. Default value: false. Valid values:
  • true
  • false
InstanceClass String No No The instance type. You must specify at least one of the Capacity and InstanceClass parameters.
VpcPasswordFree Boolean No No Specifies whether to enable the password-free feature for access to the instance from a VPC. None
VSwitchId String No No The ID of the VSwitch. None
ChargeType String No No The billing method of the instance. Default value: PostPaid. Valid values:
  • PrePaid: the subscription billing method.
  • PostPaid: the pay-as-you-go billing method.
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 the ChargeType parameter is set to PrePaid. This parameter cannot be specified when ChargeType is set to PostPaid.
NetworkType String No No The network type of the instance. Default value: CLASSIC. Valid values:
  • CLASSIC
  • VPC
Password String No No The password of the instance. The password must be 8 to 32 characters in length and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include
! @ # $ % ^ & * ( ) _ + - =
Config String No No The configurations of the instance. The parameter value is a JSON 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 Type Required Editable Description Constraint
PreferredBackupTime String Yes Yes The backup window. Specify the window in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
EnableBackupLog Integer No Yes Specifies whether to enable incremental backup. Default value: 0. Valid values:
  • 1: enables incremental backup.
  • 0: disables incremental backup.
PreferredBackupPeriod String Yes Yes The backup cycle. Valid values:
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday

Response parameters

Fn::GetAtt

  • InstanceId: the ID of the instance.
  • 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: queries per second.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "MemcacheInstance": {
      "Type": "ALIYUN::Memcache::Instance",
      "Properties": {
        "VpcId": {
          "Ref": "VpcId"
        },
        "Capacity": {
          "Ref": "Capacity"
        },
        "Config": {
          "Ref": "Config"
        },
        "AutoRenew": {
          "Ref": "AutoRenew"
        },
        "AutoRenewPeriod": {
          "Ref": "AutoRenewPeriod"
        },
        "CouponNo": {
          "Ref": "CouponNo"
        },
        "BackupPolicy": {
          "Ref": "BackupPolicy"
        },
        "AutoUseCoupon": {
          "Ref": "AutoUseCoupon"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "ResourceGroupId": {
          "Ref": "ResourceGroupId"
        },
        "InstanceClass": {
          "Ref": "InstanceClass"
        },
        "VpcPasswordFree": {
          "Ref": "VpcPasswordFree"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "ChargeType": {
          "Ref": "ChargeType"
        },
        "Period": {
          "Ref": "Period"
        },
        "NetworkType": {
          "Ref": "NetworkType"
        },
        "Password": {
          "Ref": "Password"
        },
        "InstanceName": {
          "Ref": "InstanceName"
        },
        "PrivateIpAddress": {
          "Ref": "PrivateIpAddress"
        }
      }
    }
  },
  "Parameters": {
    "VpcId": {
      "Type": "String",
      "Description": "The ID of the VPC."
    },
    "Capacity": {
      "Type": "Number",
      "Description": "The storage capacity of the instance. Unit: MB.\nNote You need to pass at least one of the Capacity and InstanceClass parameters when calling\nthe CreateInstance operation."
    },
    "Config": {
      "Type": "String",
      "Description": "The parameter configuration of the instance, in a JSON string. For more information,\nsee Set parameters."
    },
    "AutoRenew": {
      "Type": "String",
      "Description": "Specifies whether to enable auto renewal. Valid values:\ntrue\nfalse\nNote Default value: false."
    },
    "AutoRenewPeriod": {
      "Type": "String",
      "Description": "The period of the auto renewal. Unit: months. Valid values:\n1\n2\n3\n6\n12\nNote You must specify this parameter if the value of the AutoRenew parameter is true."
    },
    "CouponNo": {
      "Type": "String",
      "Description": "The coupon number. Default value: youhuiquan_promotion_option_id_for_blank."
    },
    "BackupPolicy": {
      "Type": "Json",
      "Description": "Backup policy"
    },
    "AutoUseCoupon": {
      "Type": "String",
      "Description": "Specifies whether to use a coupon. Valid values:\ntrue\nfalse\nNote Default value: false."
    },
    "ZoneId": {
      "Type": "String",
      "Description": "The ID of the zone in which the instance is created. You can call the DescribeRegions operation to query the latest region list."
    },
    "ResourceGroupId": {
      "Type": "String",
      "Description": "Resource group ID."
    },
    "InstanceClass": {
      "Type": "String",
      "Description": "The instance type. For more information, see Instance types.\nNote You need to pass at least one of the Capacity and InstanceClass parameters when calling\nthe CreateInstance operation."
    },
    "VpcPasswordFree": {
      "Type": "Boolean",
      "Description": "Specifies whether to enable password free for access within the VPC. If set to:\n- true: enables password free.\n- false: disables password free.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "The ID of the VSwitch."
    },
    "ChargeType": {
      "Type": "String",
      "Description": "The billing method of the instance. Valid values:\nPrePaid: subscription.\nPostPaid: pay-as-you-go.\nNote Default value: PostPaid."
    },
    "Period": {
      "Type": "String",
      "Description": "The subscription period. You must specify this parameter if the value of the ChargeType\nparameter is PrePaid. Unit: months. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24,\nand 36.\nNote This parameter is invalid if the value of the ChargeType parameter is PostPaid."
    },
    "NetworkType": {
      "Type": "String",
      "Description": "The network type of the instance. Valid values:\nCLASSIC\nVPC\nNote Default value: CLASSIC."
    },
    "Password": {
      "Type": "String",
      "Description": "The password of the instance. The password can be 8 to 32 characters in length and\nmust contain at least three types of the following characters: uppercase letters,\nlowercase letters, digits, and special characters. Special characters include ! at signs (@), number signs (#), dollar signs ($), percent signs (%), carets (^),\nampersands (&), asterisks (*), parentheses (()), underscores (_), plus signs (+),\nhyphens (-), and equal signs (=)."
    },
    "InstanceName": {
      "Type": "String",
      "Description": "The name of the instance. The name can be 2 to 128 characters in length and must start\nwith a letter. The following characters are not supported: at signs (@), forward slashes (/), colons (:), equal signs (=), double quotation marks\n(\"), angle brackets (<>), braces ([]), curly brackets ({}) and spaces."
    },
    "PrivateIpAddress": {
      "Type": "String",
      "Description": "The internal IP address of the instance.\nNote The internal IP address must be located in the Classless Inter-Domain Routing (CIDR)\nblock of the VSwitch to which the instance belongs."
    }
  },
  "Outputs": {
    "InstanceId": {
      "Description": "The globally unique identifier (GUID) of the instance.",
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "InstanceId"
        ]
      }
    },
    "ConnectionDomain": {
      "Description": "The internal endpoint of the instance.",
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "ConnectionDomain"
        ]
      }
    },
    "InstanceName": {
      "Description": "The name of the instance.",
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "InstanceName"
        ]
      }
    },
    "Port": {
      "Description": "Port of created instance.",
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "Port"
        ]
      }
    },
    "QPS": {
      "Description": "QPS.",
      "Value": {
        "Fn::GetAtt": [
          "MemcacheInstance",
          "QPS"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  MemcacheInstance:
    Type: 'ALIYUN::Memcache::Instance'
    Properties:
      VpcId:
        Ref: VpcId
      Capacity:
        Ref: Capacity
      Config:
        Ref: Config
      AutoRenew:
        Ref: AutoRenew
      AutoRenewPeriod:
        Ref: AutoRenewPeriod
      CouponNo:
        Ref: CouponNo
      BackupPolicy:
        Ref: BackupPolicy
      AutoUseCoupon:
        Ref: AutoUseCoupon
      ZoneId:
        Ref: ZoneId
      ResourceGroupId:
        Ref: ResourceGroupId
      InstanceClass:
        Ref: InstanceClass
      VpcPasswordFree:
        Ref: VpcPasswordFree
      VSwitchId:
        Ref: VSwitchId
      ChargeType:
        Ref: ChargeType
      Period:
        Ref: Period
      NetworkType:
        Ref: NetworkType
      Password:
        Ref: Password
      InstanceName:
        Ref: InstanceName
      PrivateIpAddress:
        Ref: PrivateIpAddress
Parameters:
  VpcId:
    Type: String
    Description: The ID of the VPC.
  Capacity:
    Type: Number
    Description: >-
      The storage capacity of the instance. Unit: MB.

      Note You need to pass at least one of the Capacity and InstanceClass
      parameters when calling

      the CreateInstance operation.
  Config:
    Type: String
    Description: >-
      The parameter configuration of the instance, in a JSON string. For more
      information,

      see Set parameters.
  AutoRenew:
    Type: String
    Description: |-
      Specifies whether to enable auto renewal. Valid values:
      true
      false
      Note Default value: false.
  AutoRenewPeriod:
    Type: String
    Description: >-
      The period of the auto renewal. Unit: months. Valid values:

      1

      2

      3

      6

      12

      Note You must specify this parameter if the value of the AutoRenew
      parameter is true.
  CouponNo:
    Type: String
    Description: >-
      The coupon number. Default value:
      youhuiquan_promotion_option_id_for_blank.
  BackupPolicy:
    Type: Json
    Description: Backup policy
  AutoUseCoupon:
    Type: String
    Description: |-
      Specifies whether to use a coupon. Valid values:
      true
      false
      Note Default value: false.
  ZoneId:
    Type: String
    Description: >-
      The ID of the zone in which the instance is created. You can call the
      DescribeRegions operation to query the latest region list.
  ResourceGroupId:
    Type: String
    Description: Resource group ID.
  InstanceClass:
    Type: String
    Description: >-
      The instance type. For more information, see Instance types.

      Note You need to pass at least one of the Capacity and InstanceClass
      parameters when calling

      the CreateInstance operation.
  VpcPasswordFree:
    Type: Boolean
    Description: >-
      Specifies whether to enable password free for access within the VPC. If
      set to:

      - true: enables password free.

      - false: disables password free.
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
  VSwitchId:
    Type: String
    Description: The ID of the VSwitch.
  ChargeType:
    Type: String
    Description: |-
      The billing method of the instance. Valid values:
      PrePaid: subscription.
      PostPaid: pay-as-you-go.
      Note Default value: PostPaid.
  Period:
    Type: String
    Description: >-
      The subscription period. You must specify this parameter if the value of
      the ChargeType

      parameter is PrePaid. Unit: months. Valid values: 1, 2, 3, 4, 5, 6, 7, 8,
      9, 12, 24,

      and 36.

      Note This parameter is invalid if the value of the ChargeType parameter is
      PostPaid.
  NetworkType:
    Type: String
    Description: |-
      The network type of the instance. Valid values:
      CLASSIC
      VPC
      Note Default value: CLASSIC.
  Password:
    Type: String
    Description: >-
      The password of the instance. The password can be 8 to 32 characters in
      length and

      must contain at least three types of the following characters: uppercase
      letters,

      lowercase letters, digits, and special characters. Special characters
      include ! at signs (@), number signs (#), dollar signs ($), percent signs
      (%), carets (^),

      ampersands (&), asterisks (*), parentheses (()), underscores (_), plus
      signs (+),

      hyphens (-), and equal signs (=).
  InstanceName:
    Type: String
    Description: >-
      The name of the instance. The name can be 2 to 128 characters in length
      and must start

      with a letter. The following characters are not supported: at signs (@),
      forward slashes (/), colons (:), equal signs (=), double quotation marks

      ("), angle brackets (<>), braces ([]), curly brackets ({}) and spaces.
  PrivateIpAddress:
    Type: String
    Description: >-
      The internal IP address of the instance.

      Note The internal IP address must be located in the Classless Inter-Domain
      Routing (CIDR)

      block of the VSwitch to which the instance belongs.
Outputs:
  InstanceId:
    Description: The globally unique identifier (GUID) of the instance.
    Value:
      'Fn::GetAtt':
        - MemcacheInstance
        - InstanceId
  ConnectionDomain:
    Description: The internal endpoint of the instance.
    Value:
      'Fn::GetAtt':
        - MemcacheInstance
        - ConnectionDomain
  InstanceName:
    Description: The name of the instance.
    Value:
      'Fn::GetAtt':
        - MemcacheInstance
        - InstanceName
  Port:
    Description: Port of created instance.
    Value:
      'Fn::GetAtt':
        - MemcacheInstance
        - Port
  QPS:
    Description: QPS.
    Value:
      'Fn::GetAtt':
        - MemcacheInstance
        - QPS