ALIYUN::ServiceCatalog::Constraint

更新时间:
复制为 MD 格式

ALIYUN::ServiceCatalog::Constraint类型用于创建约束。

语法

{
  "Type": "ALIYUN::ServiceCatalog::Constraint",
  "Properties": {
    "Config": Map,
    "ConstraintType": String,
    "PortfolioId": String,
    "ProductId": String,
    "Description": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Config

Map

约束配置。

格式:

{ "LocalRoleName": "<role_name>" }

ConstraintType

String

约束类型。

取值为 Launch,表示启动约束。

PortfolioId

String

约束所属的产品组合 ID。

ProductId

String

约束对应的产品 ID。

Description

String

约束描述。

长度为 1~128 个字符。

返回值

Fn::GetAtt

ConstraintId:约束 ID。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Config:
    Type: Json
    Description:
      en: The configuration of the constraint.
    Required: true
  PortfolioId:
    Type: String
    Description:
      en: The ID of the portfolio.
    Required: true
  ConstraintType:
    Type: String
    Description:
      en: The type of the constraint.
    Required: true
  ProductId:
    Type: String
    Description:
      en: The ID of the product.
    Required: true
Resources:
  Constraint:
    Type: ALIYUN::ServiceCatalog::Constraint
    Properties:
      Config:
        Ref: Config
      PortfolioId:
        Ref: PortfolioId
      ConstraintType:
        Ref: ConstraintType
      ProductId:
        Ref: ProductId
Outputs:
  ConstraintId:
    Description: The ID of the constraint.
    Value:
      Fn::GetAtt:
        - Constraint
        - ConstraintId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Config": {
      "Type": "Json",
      "Description": {
        "en": "The configuration of the constraint."
      },
      "Required": true
    },
    "PortfolioId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the portfolio."
      },
      "Required": true
    },
    "ConstraintType": {
      "Type": "String",
      "Description": {
        "en": "The type of the constraint."
      },
      "Required": true
    },
    "ProductId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the product."
      },
      "Required": true
    }
  },
  "Resources": {
    "Constraint": {
      "Type": "ALIYUN::ServiceCatalog::Constraint",
      "Properties": {
        "Config": {
          "Ref": "Config"
        },
        "PortfolioId": {
          "Ref": "PortfolioId"
        },
        "ConstraintType": {
          "Ref": "ConstraintType"
        },
        "ProductId": {
          "Ref": "ProductId"
        }
      }
    }
  },
  "Outputs": {
    "ConstraintId": {
      "Description": "The ID of the constraint.",
      "Value": {
        "Fn::GetAtt": [
          "Constraint",
          "ConstraintId"
        ]
      }
    }
  }
}