All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::OSS::Bucket

Last Updated:Dec 02, 2024

DATASOURCE::OSS::Bucket is used to query the information about an Object Storage Service (OSS) bucket.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

BucketName

String

Yes

Yes

The bucket name.

None.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Return values

Fn::GetAtt

  • Owner: the information about the owner of the bucket.

  • ExtranetEndpoint: the public endpoint that is used to access the bucket over the Internet.

  • StorageClass: the storage class of the bucket.

  • CreateTime: the time when the bucket was created.

  • IntranetEndpoint: the internal endpoint that is used to access the bucket from Elastic Compute Service (ECS) instances that reside in the same region as the bucket.

  • Name: the bucket name.

  • Location: the data center of the bucket.  

Examples

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