Max Huang
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Amazon S3 的運作方式 > Amazon S3 是**將資料當做物件存放在儲存貯體中的物件儲存服務**。 > *物件* 是一個檔案和任何描述該檔案的中繼資料(metadata)。 > 您應該先建立儲存貯體並指定儲存貯體名稱和 AWS 區域。然後,您可以將資料當做物件上傳到 Amazon S3 中的儲存貯體。每個物件都有*金鑰* (或*金鑰名稱*),它是表示儲存貯體中物件的唯一識別符。 S3 提供您可設定的功能,以支援您的特定使用案例。例如,您可以使用 S3 版本控制將物件的多個版本保留在一個儲存貯體中,並可還原意外刪除或覆寫的物件。 儲存貯體和它們中的物件是私有的,只有在您明確授予存取許可時才能進行存取。您可以使用儲存貯體政策,AWS Identity and Access Management (IAM) 政策、存取控制清單 (ACL) 和 S3 存取點來管理存取。 **主題** - [儲存貯體](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/Welcome.html#BasicsBucket) - [物件](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/Welcome.html#BasicsObjects) - [金鑰](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/Welcome.html#BasicsKeys) - [S3 版本控制](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/Welcome.html#Versions) - [版本 ID](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/Welcome.html#BasicsVersionID) - [儲存貯體政策](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/Welcome.html#BucketPolicies) - [S3 存取點](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/Welcome.html#BasicsAccessPoints) - [存取控制清單 (ACL)](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/Welcome.html#S3_ACLs) - [區域](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/Welcome.html#Regions) ### **儲存貯體** 儲存貯體是 Amazon S3 中用於存放物件的容器。 每個物件都包含在儲存貯體中。例如,如果名為 `photos/puppy.jpg` 的物件存放在美國西部 (奧勒岡) 區域的 `DOC-EXAMPLE-BUCKET` 儲存貯體中,則可以使用 URL `https://DOC-EXAMPLE-BUCKET.s3.us-west-2.amazonaws.com/photos/puppy.jpg` 定址。 建立儲存貯體時,請輸入儲存貯體名稱並選擇儲存貯體將駐留的 AWS 區域。建立儲存貯體後,便無法變更儲存貯體的名稱或其區域。 儲存貯體還可: - 以最高層級來組織 Amazon S3 命名空間。 - 識別負責儲存和數據傳輸費的帳戶。 - 提供存取控制選項,例如儲存貯體政策、存取控制清單 (ACL) 和 S3 存取點,且您可將其用來管理 Amazon S3 資源的存取。 - 充當用量報告中的彙總單位。 ### **物件** 物件是存放在 Amazon S3 中的基本實體。物件是由物件資料與中繼資料構成。中繼資料是一組成對的名稱與數值,會說明該物件。其中包含一些預設中繼資料 (如上次修改日期) 以及標準 HTTP 中繼資料 (如 `Content-Type`)。您也可以在存放物件時指定自訂中繼資料。 在儲存貯體中,每個物件都是由[金鑰 (名稱)](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/Welcome.html#BasicsKeys) 與[版本 ID](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/Welcome.html#BasicsVersionID) (如果已在儲存貯體啟用 S3 版本控制) 來唯一識別。如需物件的詳細資訊,請參閱 [Amazon S3 物件概觀](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/UsingObjects.html)。 ### **金鑰** *物件金鑰* (或*金鑰名稱*) 是儲存貯體內的物件的唯一識別符。儲存貯體中的每個物件只能有一個索引鍵。儲存貯體、物件金鑰以及選擇性的版本 ID (如果已針對儲存貯體啟用 S3 版本控制) 的組合可唯一識別每個物件。因此,您可以將 Amazon S3 視為「儲存貯體 + 金鑰 + 版本」與物件本身之間的基本資料對應。 Amazon S3 中的每個物件可透過 Web 服務端點、儲存貯體名稱、金鑰及版本 (選擇性) 的組合來唯一定址。例如,在 URL `https://DOC-EXAMPLE-BUCKET.s3.us-west-2.amazonaws.com/photos/puppy.jpg` 中,`DOC-EXAMPLE-BUCKET` 是儲存貯體的名稱,而 `photos/puppy.jpg` 是金鑰。 ### **S3 版本控制** 您可以使用 S3 版本控制,以在相同的儲存貯體中保留物件的多個變形。使用 S3 版本控制功能,您即可保留、擷取和還原在儲存貯體中所存放每個物件的各個版本。您就可以輕鬆地復原失誤的使用者動作和故障的應用程式。 ### **版本 ID** 當您在儲存貯體中啟用 S3 版本控制時,Amazon S3 會為所有新增至儲存貯體的物件提供唯一的版本 ID。啟用版本控制時已存在於儲存貯體中的物件的版本 ID 為 `null`。如果您使用其他操作修改這些 (或任何其他) 物件,例如 [CopyObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) 和 [PutObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html),新物件會取得唯一的版本 ID。 ### **儲存貯體政策** 儲存貯體政策是以資源為基礎的 AWS Identity and Access Management (IAM) 政策,您可以使用這些政策來將存取許可授予儲存貯體及其中物件。只有儲存貯體擁有者可建立政策與儲存貯體的關聯。連接到儲存貯體的許可會套用至儲存貯體擁有者帳戶擁有的所有儲存貯體物件。儲存貯體政策的大小限制為 20 KB。 儲存貯體政策會根據政策中的元素來允許或拒絕要求,包括**請求的請求者、S3 動作、資源以及其他方面或條件 (例如,用來傳送要求的 IP 地址)**。例如,您可以建立儲存貯體政策,授予跨帳戶許可,以將物件上傳至 S3 儲存貯體,同時確保儲存貯體擁有者可完全控制上傳物件。 ### **S3 存取點** Amazon S3 存取點是含有專用存取政策的命名網路端點,其中說明了如何使用該端點存取資料。存取點連線到儲存貯體,您可以使用這些存取點來執行 S3 物件操作,例如 GetObject 和 PutObject。存取點針對 Amazon S3 中的共用資料集,**簡化了大規模的資料存取管理**。 每個存取點都有其自己的存取點政策。您也可以為每個存取點設定[封鎖公開存取](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/access-control-block-public-access.html)設定。若要限制只能透過私有網絡存取 Amazon S3 資料,您可以將任何存取點設定為僅接受來自 Virtual Private Cloud (VPC) 的請求。 ### **存取控制清單 (ACL)** 您可以**向授權的使用者授予讀取和寫入個別儲存貯體和物件的許可**。每個儲存貯體與物件都會有一個與其連接的 ACL 作為子資源。其會定義哪些 AWS 帳戶 或群組會被授予存取和存取類型。ACL 是一種早於 IAM 的存取控制機制。 預設情況下,當另一個 AWS 帳戶 會將物件上傳到您的 S3 儲存貯體時,該帳戶 (物件寫入者) 擁有物件、擁有其存取權,並且可以透過 ACL 授權其他使用者存取該物件。您可以使用「物件擁有權」變更此預設行為,以便停用 ACL,並且您身為儲存貯體擁有者,自動擁有儲存貯體中的每個物件。因此,資料的存取控制是以政策為基礎,例如 IAM 政策、S3 儲存貯體政策、Virtual Private Cloud (VPC) 端點政策和 AWS Organizations 服務控制政策 (SCP)。 Amazon S3 中的大多數現代使用案例不再需要使用 ACL,建議您停用 ACL,除非在異常情況下需要個別控制每個物件的存取權。使用「物件擁有權」,您可以停用 ACL,並依賴政策來進行存取控制。停用 ACL 時,您可以輕鬆地維護具有由不同 AWS 帳戶 上傳之物件的儲存貯體。身為儲存貯體擁有者,您擁有儲存貯體中的所有物件,並且可以使用政策管理對物件的存取。如需詳細資訊,請參閱 [控制物件的擁有權並停用儲存貯體的 ACL](https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/about-object-ownership.html)。 ### **區域** 您可以選擇地理 AWS 區域 供 Amazon S3 存放您建立的儲存貯體。您可以選擇區域以最佳化延遲、降低成本或因應法規需求。除非您明確地將存放在 AWS 區域 中的物件傳輸或複寫到其他區域,否則物件絕對不會離開該區域。例如,存放在歐洲 (愛爾蘭) 區域的物件絕不會離開此區域。 ## **物件子資源** Amazon S3 定義一組與儲存貯體及物件相關聯的子資源。子資源從屬於物件。這意味著子資源本身不存在。它們一律會與物件或儲存貯體等其他實體相關聯。 下表列出與 Amazon S3 物件相關聯的子資源。 | 子資源 | 描述 | | --- | --- | | acl | 包含授予清單,其中指出被授予者及獲授予的許可。當您建立物件時,acl 會認定物件擁有者具有該物件的完整控制權。您可以擷取物件 ACL,或以更新過的授與清單取代。ACL 的任何更新都需要您取代現有的 ACL。如需 ACL 的詳細資訊,請參閱「https://docs.aws.amazon.com/zh_tw/AmazonS3/latest/userguide/acl-overview.html」。 | ## **Amazon S3 資料一致性模式** Amazon S3 為所有 AWS 區域 中 Amazon S3 儲存貯體中的物件 PUT 和 DELETE 請求提供高度的先寫後讀一致性。這一行為適用於寫入新的物件,以及覆寫現有物件的 PUT 請求與 DELETE 請求。此外,Amazon S3 Select、Amazon S3 存取控制清單 (ACL)、Amazon S3 物件標籤和物件中繼資料 (例如 HEAD 物件) 上的讀取操作均高度一致。 **單一金鑰的更新不可部分完成。** 例如,如果您從一個執行緒中向現有的金鑰傳送 PUT 請求,並同時從第二個執行緒在相同的金鑰上執行 GET 請求,則會獲得舊資料或新資料,但絕不會獲得部分或損壞的資料。 Amazon S3 在 AWS 資料中心內的多部伺服器上複寫資料,達到高可用性。如果 PUT 要求成功,則您的資料已安全地存放。收到一個成功的 PUT 回應後啟動的任何讀取(GET 或 LIST)將傳回由 PUT 請求寫入的資料。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully