Help & DocumentationCloud Object StorageBest PracticeUsing COS in the Third-party ApplicationsUse the general configuration of COS in third-party applications compatible with S3

Use the general configuration of COS in third-party applications compatible with S3

Last updated: 2020-03-30 16:03:14

PDF

Amazon Simple Storage Service (Amazon S3, hereinafter referred to as S3) is one of the earliest Tencent Cloud services launched by AWS. After years of development, S3 Protocol has actually become the standard in Cloud Object Storage industry. Tencent Cloud Cloud Object Storage COS (hereinafter referred to as COS) provides a S3-compatible implementation, so you can use COS services directly in most S3-compatible applications. This article focuses on how to configure such applications to use COS services.

Preparatory work

Confirm whether the application can use the COS service

  • If you see something similar in the description of the application S3 Compatible Word, then COS services can be used in most cases. If you find that some of the functions of the application cannot be used properly in the course of actual use, you can contact us Submit a ticket For consultation, when submitting Ticket, please state the guidelines you see in this document, and provide the name of the relevant application and screenshots and other information, so that we can help you solve the problem more quickly.
  • If your application only describes the support Amazon S3 This indicates that the application can use S3 service, but whether it can use COS service needs to be further tried in the relevant configuration, which will be further explained in the following configuration instructions.

Prepare the COS service

Step 1: sign up for Tencent Cloud account

(if you are already registered with Tencent Cloud, you can ignore this step. )

Step 2: complete Identity verification

(if completed, this step can be ignored. )

For details of Verification's process, see Introduction of Identity verification .

Step 3: Enable COS service

Step 4: prepare APPID and Access keys

In the Access Management console API Key Management Get and record in the page AppidSecretID and SecretKey .

Step 5: create Bucket

Some of you apply the built-in process of creating Bucket. If you want the app to create Bucket, you can ignore this step.

  1. In Cloud Object Storage console Left sidebar, click [Bucket list] to enter the Bucket management page.

  2. Click [create Bucket] and enter Bucket information.

    • Name: Bucket's name, such as examplebucket.
    • Region: Bucket storage area, choose the nearest area with you, for example, I am in "Shenzhen", the region can choose "Guangzhou".
    • Access Permission: Bucket Access Permission, here we choose "private reading and writing".
  3. Click "OK" to create Bucket.

Configure the COS service in the application

Basic configuration

Most applications have similar configuration items when configuring the storage services they use. The common names and descriptions of these configuration items are listed below:

If you have any questions during the configuration process, you can also contact us Submit a ticket Consult, when submitting Ticket, please state the guidelines you see in this document, and provide the name of the relevant application and screenshots and other information, so that we can help you solve the problem more quickly.

Common name of the configuration itemRelated instructions
Provider / service provider /
Storage service provider /
Service Provider/
Storage Provider/
Provider etc.
The main purpose here is to choose which kind of storage the application should use. There may be the following situations:
  • If there is an option such as S3 compatible Storage / S3 Compatible in this option, then this option takes precedence.
  • If there are only words such as amazon web services/AWS/Amazon S3, use this option first, but we need to pay attention to our further instructions in the later configuration.
  • If there are no similar options, but support for S3 services or S3 compatible services is mentioned in the description of the application, you can continue with the configuration below, but you also need to pay attention to our further instructions.
  • In other cases, I'm sorry, the application may not be able to use the COS service.
  • Service Endpoint / Service address / Service & nbsp;URL/Endpoint/Custom Endpoint/Server URL, etc.This is used for the service address of Enter S3 compatible service. When using COS service, the service address of Enter COS here is in the form:Cos..myqcloud.comor
    Https://cos..myqcloud.com.
    Do you need Enter?Https://Depending on the specific application, you can try it yourself among& lt;Region>Represents the available region of the COS.
    In the application, you can only create or select Bucket in the region specified in the service address.
  • For example, if your Bucket is in Guangzhou, then the service address should be configured asCos.ap-guangzhou.myqcloud.comIf you configure it in another region, you will not be able to find Bucket in Guangzhou region in the application.
  • If the service provider of the application can only chooseAmazon S3And the service endpoint is configurable, then you can modify the service endpoint to the aforementionedCos. .myqcloud.comorHttps://cos..myqcloud.com.
  • If the service endpoint is not configurable or there is no service endpoint configuration item, then your application cannot use COS services.
  • Access Key/Access Key ID etc.Here EnterStep 4Recorded inSecretID.
    Secret Key/Secret/
    Secret Access Key etc.
    Here EnterStep 4Recorded inSecretKey.
    Region / Region, etc.Select default, automatic, Auto, or Automatic.
    Bucket / Bucket, etc.Select or enter an existing Bucket name in the format& lt;BucketName-APPID>, for exampleExamplebucket-1250000000. WhereBucketNameForStep 5The name of Bucket of Enter when Bucket was founded in,AppidForStep 4Recorded inAppid.
    As described above, Bucket here will be limited to the region specified by the service address, and Bucket from other regions will not be listed or cannot be used normally. If you need to create a new Bucket, then the newly created Bucket name also needs to match that mentioned above.& lt;BucketName-APPID>Format, otherwise you will not be able to create Bucket normally.

    Other items and advanced configuration instructions

    In addition to the above basic configuration, some applications also have some other items and advanced configurations. The following will provide a description of the features of some COS, so that you can better use COS services in your applications.

    • Service Port and Protocol
      COS service supports HTTP Protocol and HTTPS Protocol, both of which use Protocol's default ports 80 and 443. for security reasons, we recommend that you give priority to using COS service through HTTPS Protocol.
    • Path-Style and Virtual Hosted-Style
      COS supports two usage styles at the same time.
    • AWS V2 signature and AWS V4 signature
      COS supports both signature formats.

    Conclusion

    COS does not guarantee full compatibility with S3. If you encounter any problems when using COS services in your application, please feel free to contact us. Submit a ticket Consult, when submitting Ticket, please state the guidelines you see in this document, and provide the name of the relevant application and screenshots and other information, so that we can help you solve the problem more quickly.