ALIYUN::Memcache::Instance类型用于创建Memcache实例。

语法

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

属性

属性名称 类型 必须 允许更新 描述 约束
VpcId String 专有网络ID
Capacity Integer 实例容量 必须指定Capacity或InstanceClass其中一个属性。

单位:MB。

ResourceGroupId String 资源组ID
BackupPolicy Map 备份策略
CouponNo String 优惠码 默认值:youhuiquan_promotion_option_id_for_blank
AutoRenewPeriod String 自动续费周期 取值:
  • 1
  • 2
  • 3
  • 6
  • 12

单位:月。

说明 当AutoRenew为true时该参数必选。
AutoUseCoupon String 是否使用代金券 取值:
  • true
  • false(默认值)
ZoneId String 可用区ID
InstanceName String 实例名称
  • 长度为2~128个字符。
  • 以大小写字母或中文字符开头,不支持空格( )和如下特殊字符:

    @/:=”<>{[]}

AutoRenew String 是否开启自动续费 取值:
  • true
  • false(默认值)
InstanceClass String 实例规格 必须指定Capacity或InstanceClass其中一个属性。
VpcPasswordFree Boolean 是否在专有网络中启用免密码访问该实例
VSwitchId String 交换机ID
ChargeType String 付费类型 取值:
  • PrePaid:预付费
  • PostPaid(默认值):按量付费
Period String 付费周期,ChargeType(付费类型)为PrePaid时为必选参数。 取值:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 12
  • 24
  • 36

单位:月。

ChargeType为PostPaid时不支持指定该参数。
NetworkType String 网络类型 取值:
  • CLASSIC(默值认):经典网络
  • VPC:专有网络
Password String 实例密码
  • 长度为8~32个字符。
  • 需包含大写字母、小写字母、特殊字符和数字中的至少三种,支持的特殊字符如下:

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

Config String 实例的详细配置 取值是JSON格式的字符串。
PrivateIpAddress String 实例的私网IP地址 私网IP需在实例所属的交换机网段内。

BackupPolicy语法

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

BackupPolicy属性

属性名称 类型 必须 允许更新 描述 约束
PreferredBackupTime String 备份时间段 格式:HH:mmZ-HH:mmZ
EnableBackupLog Integer 是否开启增量备份 取值:
  • 1:开启
  • 0(默认值):关闭
PreferredBackupPeriod String 备份周期 取值:
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday

返回值

Fn::GetAtt

  • InstanceId:实例ID。
  • InstanceName:实例名称。
  • ConnectionDomain:实例连接地址。
  • Port:实例端口。
  • QPS:每秒查询率。

示例

JSON格式

{
  "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格式

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