From 3b38ae3ecc86084937b5c76189b46f9401c8a34d Mon Sep 17 00:00:00 2001 From: Cassie Coyle Date: Fri, 16 Aug 2024 16:44:10 -0500 Subject: [PATCH] add storageClass example for s3 metadata (#4308) * add storageClass example to docs Signed-off-by: Cassandra Coyle * add field to table Signed-off-by: Cassandra Coyle * update data indentation for example curl Signed-off-by: Cassandra Coyle * Update daprdocs/content/en/reference/components-reference/supported-bindings/s3.md Co-authored-by: Mark Fussell Signed-off-by: Cassie Coyle * tweaks Signed-off-by: Cassandra Coyle * add to template example Signed-off-by: Cassandra Coyle * add doc link for storage class Signed-off-by: Cassandra Coyle * Update daprdocs/content/en/reference/components-reference/supported-bindings/s3.md Signed-off-by: Mark Fussell * Update daprdocs/content/en/reference/components-reference/supported-bindings/s3.md Signed-off-by: Mark Fussell * Update daprdocs/content/en/reference/components-reference/supported-bindings/s3.md Signed-off-by: Mark Fussell --------- Signed-off-by: Cassandra Coyle Signed-off-by: Cassie Coyle Signed-off-by: Mark Fussell Co-authored-by: Mark Fussell --- .../components-reference/supported-bindings/s3.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md b/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md index 2de9b95a727..d91818a1d8f 100644 --- a/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md +++ b/daprdocs/content/en/reference/components-reference/supported-bindings/s3.md @@ -44,6 +44,8 @@ spec: value: "" - name: insecureSSL value: "" + - name: storageClass + value: "" ``` {{% alert title="Warning" color="warning" %}} @@ -65,6 +67,7 @@ The above example uses secrets as plain strings. It is recommended to use a secr | `encodeBase64` | N | Output | Configuration to encode base64 file content before return the content. (In case of opening a file with binary content). `"true"` is the only allowed positive value. Other positive variations like `"True", "1"` are not acceptable. Defaults to `"false"` | `"true"`, `"false"` | | `disableSSL` | N | Output | Allows to connect to non `https://` endpoints. Defaults to `"false"` | `"true"`, `"false"` | | `insecureSSL` | N | Output | When connecting to `https://` endpoints, accepts invalid or self-signed certificates. Defaults to `"false"` | `"true"`, `"false"` | +| `storageClass` | N | Output | The desired storage class for objects during the create operation. [Valid aws storage class types can be found here](https://aws.amazon.com/s3/storage-classes/) | `STANDARD_IA` | {{% alert title="Important" color="warning" %}} When running the Dapr sidecar (daprd) with your application on EKS (AWS Kubernetes), if you're using a node/pod that has already been attached to an IAM policy defining access to AWS resources, you **must not** provide AWS access-key, secret-key, and tokens in the definition of the component spec you're using. @@ -165,10 +168,20 @@ To perform a create operation, invoke the AWS S3 binding with a `POST` method an ```json { "operation": "create", - "data": "YOUR_CONTENT" + "data": "YOUR_CONTENT", + "metadata": { + "storageClass": "STANDARD_IA" + } } ``` +For example you can provide a storage class while using the `create` operation with a Linux curl command + +```bash +curl -d '{ "operation": "create", "data": "YOUR_BASE_64_CONTENT", "metadata": { "storageClass": "STANDARD_IA" } }' / +http://localhost:/v1.0/bindings/ +``` + #### Share object with a presigned URL To presign an object with a specified time-to-live, use the `presignTTL` metadata key on a `create` request.