All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::OSS::Domain

更新時間:Sep 08, 2023

ALIYUN::OSS::Domain is used to bind a custom domain name.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

BucketName

String

Yes

No

The bucket name.

None.

DomainName

String

Yes

No

The custom domain name.

The domain name must be 2 to 128 characters in length.

Return values

Fn::GetAtt

  • BucketName: the bucket name.

  • DomainName: the custom domain name.

Examples

  • YAML format

    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 format

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