全部产品
Search
文档中心

资源编排:DATASOURCE::OSS::Bucket

更新时间:Nov 01, 2024

DATASOURCE::OSS::Bucket类型用于查询OSS存储空间的基本信息。

语法

{
  "Type": "DATASOURCE::OSS::Bucket",
  "Properties": {
    "BucketName": String,
    "RefreshOptions": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

BucketName

String

Bucket名称。

RefreshOptions

String

当资源栈更新时,数据源资源的刷新策略。

有效值:

  • Never(默认值):更新堆栈时,从不刷新数据源资源。

  • Always:更新堆栈时,始终刷新数据源资源。

返回值

Fn::GetAtt

  • Owner:Bucket所有者信息

  • ExtranetEndpoint:用于通过Internet访问Bucket的公共端点。

  • StorageClass:Bucket的存储类型。

  • CreateTime:创建Bucket的时间。

  • IntranetEndpoint:用于从同一区域的ECS实例访问Bucket的内部端点。

  • Name:Bucket名称。

  • Location:Bucket所在的数据中心。 

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  BucketName:
    Description:
      en: 'Bucket name. The naming conventions for buckets are as follows:

        Only lowercase letters, numbers, and dashes (-) can be included.

        Must start and end with lowercase letters or numbers.

        The length must be between 3 and 63 characters.'
    Required: true
    Type: String
Resources:
  ExtensionDataSource:
    Properties:
      BucketName:
        Ref: BucketName
    Type: DATASOURCE::OSS::Bucket
Outputs:
  CreateTime:
    Description: The creation time of the Bucket.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - CreateTime
  ExtranetEndpoint:
    Description: The domain name of the Bucket.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - ExtranetEndpoint
  IntranetEndpoint:
    Description: The intranet domain name of the ECS instance that accesses the Bucket
      in the same region.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - IntranetEndpoint
  Location:
    Description: The region where the Bucket is located.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - Location
  Name:
    Description: Bucket name.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - Name
  Owner:
    Description: Container for storing Bucket owner information.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - Owner
  StorageClass:
    Description: The storage type of the Bucket.
    Value:
      Fn::GetAtt:
      - ExtensionDataSource
      - StorageClass
                        
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "BucketName": {
      "Type": "String",
      "Description": {
        "en": "Bucket name. The naming conventions for buckets are as follows:\nOnly lowercase letters, numbers, and dashes (-) can be included.\nMust start and end with lowercase letters or numbers.\nThe length must be between 3 and 63 characters."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::OSS::Bucket",
      "Properties": {
        "BucketName": {
          "Ref": "BucketName"
        }
      }
    }
  },
  "Outputs": {
    "Owner": {
      "Description": "Container for storing Bucket owner information.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Owner"
        ]
      }
    },
    "ExtranetEndpoint": {
      "Description": "The domain name of the Bucket.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "ExtranetEndpoint"
        ]
      }
    },
    "StorageClass": {
      "Description": "The storage type of the Bucket.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "StorageClass"
        ]
      }
    },
    "CreateTime": {
      "Description": "The creation time of the Bucket.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "CreateTime"
        ]
      }
    },
    "IntranetEndpoint": {
      "Description": "The intranet domain name of the ECS instance that accesses the Bucket in the same region.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "IntranetEndpoint"
        ]
      }
    },
    "Name": {
      "Description": "Bucket name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Name"
        ]
      }
    },
    "Location": {
      "Description": "The region where the Bucket is located.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Location"
        ]
      }
    }
  }
}