全部产品
Search
文档中心

资源编排:ALIYUN::OSS::Domain

更新时间:Aug 09, 2023

ALIYUN::OSS::Domain类型用于绑定自定义域名。

语法

{
  "Type": "ALIYUN::OSS::Domain",
  "Properties": {
    "BucketName": String,
    "DomainName": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

BucketName

String

存储空间名称。

DomainName

String

自定义域名。

长度为2~128个英文或中文字符。

返回值

Fn::GetAtt

  • BucketName:存储空间名称。

  • DomainName:自定义域名。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      BucketName:
        Description: bucket name.
        Type: String
      DomainName:
        Description: Domain name
        MaxLength: 64
        MinLength: 1
        Type: String
    Resources:
      BucketDomain:
        Properties:
          BucketName:
            Ref: BucketName
          DomainName:
            Ref: DomainName
        Type: ALIYUN::OSS::Domain
    Outputs:
      BucketName:
        Description: The name of Bucket
        Value:
          Fn::GetAtt:
          - BucketDomain
          - BucketName
      DomainName:
        Description: The custom domain name.
        Value:
          Fn::GetAtt:
          - BucketDomain
          - DomainName
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "BucketName": {
          "Type": "String",
          "Description": "bucket name."
        },
        "DomainName": {
          "Type": "String",
          "Description": "Domain name",
          "MinLength": 1,
          "MaxLength": 64
        }
      },
      "Resources": {
        "BucketDomain": {
          "Type": "ALIYUN::OSS::Domain",
          "Properties": {
            "BucketName": {
              "Ref": "BucketName"
            },
            "DomainName": {
              "Ref": "DomainName"
            }
          }
        }
      },
      "Outputs": {
        "BucketName": {
          "Description": "The name of Bucket",
          "Value": {
            "Fn::GetAtt": [
              "BucketDomain",
              "BucketName"
            ]
          }
        },
        "DomainName": {
          "Description": "The custom domain name.",
          "Value": {
            "Fn::GetAtt": [
              "BucketDomain",
              "DomainName"
            ]
          }
        }
      }
    }