閱讀746 返回首頁    go 英雄聯盟


ALIYUN::OSS::Bucket__資源列表_資源編排-阿裏雲

ALIYUN::OSS::Bucket 類型可用於創建 OSS 存儲空間

語法

  1. {
  2. "Type" : "ALIYUN::OSS::Bucket",
  3. "Properties" : {
  4. "BucketName" : String,
  5. "AccessControl" : String,
  6. "CORSConfiguration" : Map,
  7. "LifecycleConfiguration " : Map,
  8. "LoggingConfiguration" : Map,
  9. "RefererConfiguration" : Map,
  10. "WebsiteConfiguration" : Map
  11. }
  12. }

屬性

屬性名稱 類型 必須 描述 約束
BucketName string 指定存儲空間的名字 長度限製在3-63個字符之間,隻能包含小寫字母,數字和短橫線,必須以小寫字母和數字開頭和結尾
AccessControl string 指定訪問權限 可選值:private, public-read, public-read-write
CORSConfiguration map 指定跨域訪問配置
CORSConfiguration map 指定跨域訪問配置
LifecycleConfiguration map 指定跨域訪問配置
LoggingConfiguration map 指定存儲文件生命周期配置
RefererConfiguration map 指定防盜鏈配置
WebsiteConfiguration map 指定靜態托管頁配置
  1. "CORSConfiguration": {
  2. "CORSRule": [
  3. {
  4. "AllowedHeader" : String,
  5. "AllowedMethod" : List,
  6. "AllowedOrigin" : List,
  7. "ExposeHeader" : List,
  8. "MaxAgeSeconds" : Integre
  9. }
  10. ]
  11. }
屬性名稱 類型 必須 描述 約束
CORSRule list 指定多個跨域訪問規則
AllowedHeader String 指定允許跨域請求的 header 可選值:*, Cache-Control, Content-Language, Content-Type, Expires, Last-Modified, Pragma
AllowedMethod list 指定允許跨域請求的方法 *, GET, PUT, POST, DELETE, HEAD
AllowedOrigin list 指定允許跨域請求的來源
ExposeHeader list 指定允許用戶從應用程序中訪問的響應頭(例如一個 Javascript 的 XMLHttpRequest 對象)
MaxAgeSeconds integre 指定瀏覽器對特定資源的預取(OPTIONS)請求返回結果的緩存時間
  1. "LifecycleConfiguration": {
  2. "Rule": [
  3. {
  4. "ID": String,
  5. "Prefix" : String,
  6. "Status" : String,
  7. "Expiration" :{
  8. "Days" : Integre,
  9. "CreatedBeforeDate" : String
  10. },
  11. "AbortMultipartUpload" : {
  12. "CreatedBeforeDate": String,
  13. "Days" : String
  14. }
  15. }
  16. ]
  17. }
屬性名稱 類型 必須 描述 約束
CORSRule list 指定多個跨域訪問規則
Rule list 指定生命周期規則
ID string 指定規則唯一 ID 最多由255字節組成。當用戶沒有指定,或者該值為空時,OSS會為用戶生成一個唯一值。
Prefix string 指定規則所適用的前綴 隻有匹配前綴的對象才可能被該規則所影響。不可重疊
Status string 指定啟用或停用規則 可選值: Enable, Disable
Expiration map 指定 Object 規則的過期屬性
Days string 指定規則在對象最後修改時間過後多少天生效 以該文件最後修改時間的天數為起始計算,超過設定天數時即執行規則進行刪除。如設置時間為 30 天,最後修改日期為 2016-1-1 的對象會在 1 月 31 號被後端程序掃描刪除。
CreatedBeforeDate string 指定規則何時之前生效 日期必需服從ISO8601的格式,並且總是UTC的零點。 例如:2002-10-11T00:00:00.000Z
AbortMultipartUpload map 指定過期時間
  1. "LoggingConfiguration": {
  2. "TargetBucket": String,
  3. "TargetPrefix": String
  4. }
屬性名稱 類型 必須 描述 約束
TargetBucket string 指定存放訪問日誌的 Bucket
TargetPrefix string 指定最終被保存的訪問日誌文件前綴
  1. "WebsiteConfiguration":{
  2. "IndexDocument": String,
  3. "ErrorDocument": String
  4. }
屬性名稱 類型 必須 描述 約束
IndexDocument string 指定托管的靜態錯誤頁
ErrorDocument string 指定托管的靜態首頁
  1. "RefererConfiguration":{
  2. "AllowEmptyReferer": String,
  3. "RefererList": List
  4. }
屬性名稱 類型 必須 描述 約束
AllowEmptyReferer string 指定是否允許referer字段為空的請求訪問
RefererList list 指定允許 referer 的白名單

返回值

Fn::GetAtt

  • Name Bucket 名稱,全局唯一

  • DomainName 訪問 bucket 的域名

示例

  1. {
  2. "ROSTemplateFormatVersion" : "2015-09-01",
  3. "Resources" : {
  4. "Bucket": {
  5. "Type": "ALIYUN::OSS::Bucket",
  6. "Properties": {
  7. "AccessControl": "private",
  8. "BucketName": "rostest",
  9. "WebsiteConfiguration":{
  10. "IndexDocument": "index1.html",
  11. "ErrorDocument": "error404.html"
  12. },
  13. "LoggingConfiguration": {
  14. "TargetBucket": "cos-mirror",
  15. "TargetPrefix": "test404"
  16. },
  17. "CORSConfiguration": {
  18. "CORSRule": [{
  19. "AllowedHeader": ["*"],
  20. "AllowedMethod": ["GET", "PUT"],
  21. "AllowedOrigin": ["*"],
  22. "ExposeHeader": ["Date"],
  23. "MaxAgeSeconds": 3600
  24. }]
  25. },
  26. "LifecycleConfiguration": {
  27. "Rule": [{
  28. "ID": "deleteRule",
  29. "Prefix": "test/",
  30. "Status": "Enabled",
  31. "Expiration":{
  32. "Days": 2
  33. },
  34. "AbortMultipartUpload":{
  35. "CreatedBeforeDate": "2014-10-11T00:00:00.000Z"
  36. }
  37. }]
  38. },
  39. "RefererConfiguration": {
  40. "AllowEmptyReferer": true,
  41. "RefererList": ["https://www.aliyun.com", "https://www.?.aliyuncs.com"]
  42. }
  43. }
  44. }
  45. },
  46. "Outputs": {
  47. "Name": {
  48. "Value" : {"Fn::GetAtt": ["Bucket","Name"]}
  49. },
  50. "DomainName": {
  51. "Value" : {"Fn::GetAtt": ["Bucket","DomainName"]}
  52. }
  53. }
  54. }

最後更新:2016-12-16 14:17:49

  上一篇:go ALIYUN::MONGODB::Instance__資源列表_資源編排-阿裏雲
  下一篇:go ALIYUN::RAM::AccessKey__資源列表_資源編排-阿裏雲