From 6782a2f28e0dbde8f328c1fe7cfcd3584e03cad5 Mon Sep 17 00:00:00 2001
From: Milan <milan.danecek@gmail.com>
Date: Thu, 24 Aug 2023 23:30:59 +0200
Subject: [PATCH] s3 advanced features

---
 index.md                      |  2 +-
 object-storage/s3-features.md | 44 +++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 object-storage/s3-features.md

diff --git a/index.md b/index.md
index 1213a8c..974c476 100644
--- a/index.md
+++ b/index.md
@@ -3,7 +3,7 @@
 hide:
   - toc
 ---
-# Data Management Services
+# Data Storage Services
 
 Data Management Services is a portfolio of services allowing to facilitate the whole data workflow needed for research and academic communities.
 
diff --git a/object-storage/s3-features.md b/object-storage/s3-features.md
new file mode 100644
index 0000000..6223a99
--- /dev/null
+++ b/object-storage/s3-features.md
@@ -0,0 +1,44 @@
+---
+languages:
+  - en
+  - cs
+---
+
+# Advanced S3 features
+
+In the following sections, you can find a basic description of advanced S3 features that can enhance the effectiveness of your data workflow.
+
+## Sharing S3 object using (presigned) URL
+
+!!! warning
+    To be able to generate the URL links for objects stored on the S3 storage you have to setup **[aws tool first](aws-cli.md)**.
+
+All objects and buckets are by default private. The pre-signed URL is a reference to Ceph S3 object, which allows anyone who receives the URL to retrieve the S3 object with an HTTP GET request.
+
+The following presigning command generates a pre-signed URL for a specified bucket and key that is valid for one hour:
+
+    aws s3 --profile myprofile presign s3://bucket/file
+
+If you want to create a pre-signed URL with a custom lifetime that links to an object in an S3 bucket you have to use:
+
+    aws s3 --profile myprofile presign s3://bucket/file --expires-in 2419200
+
+This will create URL accessible for a month. Parametr `--expires-in` is in seconds.
+
+When pre-signed URL has been expired, you will see something like following:
+
+    This XML file does not appear to have any style information associated with it. The document tree is shown below.
+    <Error>
+    <link type="text/css" rel="stylesheet" id="dark-mode-general-link"/>
+    <link type="text/css" rel="stylesheet" id="dark-mode-custom-link"/>
+    <style lang="en" type="text/css" id="dark-mode-custom-style"/>
+    <Code>AccessDenied</Code>
+    <RequestId>tx0000000000000000f8f26-00sd242d-1a2234a7-storage-cl2</RequestId>
+    <HostId>1aasd67-storage-cl2-storage</HostId>
+    </Error>
+ 
+???+ note "Changing the URL lifetime"
+    Once you generate pre-signed URL, you can't change its lifetime, you have to generate a new pre-signed URL. It applies to both, expired and non-expired URLs.
+
+
+
-- 
GitLab