About Amazon S3 Glacier:The hyperlink login is visible.
Amazon S3 Glacier and S3 Glacier Deep Archive are secure, durable, and extremely low-cost Amazon S3 cloud storage classes for data archiving and long-term backups. With 99.9999999999% durability and comprehensive security and compliance features, they can help meet the most stringent regulatory requirements. Customers can store data for as little as $1 per TB per month, significantly reducing costs compared to on-premises solutions. To keep costs low while meeting a variety of retrieval needs, Amazon S3 Glacier offers three options for accessing archives, ranging from minutes to hours; The S3 Glacier Deep Archive offers two access options, ranging from 12 to 48 hours for retrieval.
Its advantage is that the price is very cheap, suitable for storing long-term unused resources, such as: database backup files, archival materials, data archives, etc. However, if you retrieve the download data, you will have to wait for a very long time unless you purchase an acceleration service. The prices are also different for each region, taking the Tokyo area as an example:100G files (one month) = 0.5USD = 3.5 yuan
Pricing:The hyperlink login is visible.
One: Create an access key (access key ID and secret access key)
Address:The hyperlink login is visible.
Access keys (awsAccessKeyId, awsSecretAccessKey) are used when calling the AWS API interface, and the root user access key allows unlimited access to your entire AWS account. As shown below:
Here the created key is copied for later use.
2: Create an S3 Glacier file library
For example, in the Tokyo area, the website:The hyperlink login is visible., as shown in the figure below:
Amazon Region Names and Codes:The hyperlink login is visible.
Region name | code | US East (Ohio) | us-east-2 | US East (N. Virginia) | us-east-1 | US West (N. California) | us-west-1 | US West (Oregon) | us-west-2 | Africa (Cape Town) | af-south-1 | Asia Pacific (Hong Kong) | ap-east-1 | Asia Pacific (Mumbai) | ap-south-1 | Asia Pacific (Osaka) | ap-northeast-3 | Asia Pacific (Seoul) | ap-northeast-2 | Asia Pacific (Singapore) | ap-southeast-1 | Asia Pacific (Sydney) | ap-southeast-2 | Asia Pacific (Tokyo) | ap-northeast-1 | Canada (Central) | ca-central-1 | China (Beijing) | cn-north-1 | China (Ningxia) | cn-northwest-1 | Europe (Frankfurt) | eu-central-1 | Europe (Ireland) | eu-west-1 | Europe (London) | eu-west-2 | Europe (Milan) | eu-south-1 | Europe (Paris) | eu-west-3 | Europe (Stockholm) | eu-north-1 | Middle East (Bahrain) | me-south-1 | South America (São Paulo) | sa-east-1 |
3: Create a new ASP.NET Core program
To create a new ASP.NET Core program and call the AWS SDK to upload the file to the S3 Glacier file library, you need to use nuget to reference the following package:
Upload files
The code is as follows:
Download the file
Retrieving the download file from the S3 Glacier storage, you need to wait patiently for a while (Retrieval times range from minutes to hours, and even files that have just been uploaded have to wait so longWe can see that after we send a request to retrieve the file, the program will get the result through the message queue, as shown in the figure below:
The code is as follows:
Enable log output code:
I have developed an S3 Glacier backup service that only needs to call the controller interface to upload files to S3 Glacier, as shown in the figure below:
Source code download:The hyperlink login is visible.
|